mirror of
https://github.com/postgres/postgres.git
synced 2025-12-10 14:22:35 +03:00
Log when a BRIN autosummarization request fails
Autovacuum's 'workitem' request queue is of limited size, so requests can fail if they arrive more quickly than autovacuum can process them. Emit a log message when this happens, to provide better visibility of this. Backpatch to 10. While this represents an API change for AutoVacuumRequestWork, that function is not yet prepared to deal with external modules calling it, so there doesn't seem to be any risk (other than log spam, that is.) Author: Masahiko Sawada Reviewed-by: Fabrízio Mello, Ildar Musin, Álvaro Herrera Discussion: https://postgr.es/m/CAD21AoB1HrQhp6_4rTyHN5kWEJCEsG8YzsjZNt-ctoXSn5Uisw@mail.gmail.com
This commit is contained in:
@@ -3227,12 +3227,14 @@ AutoVacuumingActive(void)
|
||||
|
||||
/*
|
||||
* Request one work item to the next autovacuum run processing our database.
|
||||
* Return false if the request can't be recorded.
|
||||
*/
|
||||
void
|
||||
bool
|
||||
AutoVacuumRequestWork(AutoVacuumWorkItemType type, Oid relationId,
|
||||
BlockNumber blkno)
|
||||
{
|
||||
int i;
|
||||
bool result = false;
|
||||
|
||||
LWLockAcquire(AutovacuumLock, LW_EXCLUSIVE);
|
||||
|
||||
@@ -3252,12 +3254,15 @@ AutoVacuumRequestWork(AutoVacuumWorkItemType type, Oid relationId,
|
||||
workitem->avw_database = MyDatabaseId;
|
||||
workitem->avw_relation = relationId;
|
||||
workitem->avw_blockNumber = blkno;
|
||||
result = true;
|
||||
|
||||
/* done */
|
||||
break;
|
||||
}
|
||||
|
||||
LWLockRelease(AutovacuumLock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user