mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Use MyBackendType in more places to check what process this is
Remove IsBackgroundWorker, IsAutoVacuumLauncherProcess(), IsAutoVacuumWorkerProcess(), and IsLogicalSlotSyncWorker() in favor of new Am*Process() macros that use MyBackendType. For consistency with the existing Am*Process() macros. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/f3ecd4cb-85ee-4e54-8278-5fabfb3a4ed0@iki.fi
This commit is contained in:
@@ -812,7 +812,7 @@ ginInsertCleanup(GinState *ginstate, bool full_clean,
|
||||
*/
|
||||
LockPage(index, GIN_METAPAGE_BLKNO, ExclusiveLock);
|
||||
workMemory =
|
||||
(IsAutoVacuumWorkerProcess() && autovacuum_work_mem != -1) ?
|
||||
(AmAutoVacuumWorkerProcess() && autovacuum_work_mem != -1) ?
|
||||
autovacuum_work_mem : maintenance_work_mem;
|
||||
}
|
||||
else
|
||||
|
@@ -590,7 +590,7 @@ ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
|
||||
/*
|
||||
* and cleanup any pending inserts
|
||||
*/
|
||||
ginInsertCleanup(&gvs.ginstate, !IsAutoVacuumWorkerProcess(),
|
||||
ginInsertCleanup(&gvs.ginstate, !AmAutoVacuumWorkerProcess(),
|
||||
false, true, stats);
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
|
||||
*/
|
||||
if (info->analyze_only)
|
||||
{
|
||||
if (IsAutoVacuumWorkerProcess())
|
||||
if (AmAutoVacuumWorkerProcess())
|
||||
{
|
||||
initGinState(&ginstate, index);
|
||||
ginInsertCleanup(&ginstate, false, true, true, stats);
|
||||
@@ -717,7 +717,7 @@ ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
|
||||
{
|
||||
stats = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
|
||||
initGinState(&ginstate, index);
|
||||
ginInsertCleanup(&ginstate, !IsAutoVacuumWorkerProcess(),
|
||||
ginInsertCleanup(&ginstate, !AmAutoVacuumWorkerProcess(),
|
||||
false, true, stats);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user