diff options
author | Heikki Linnakangas | 2024-03-04 08:25:12 +0000 |
---|---|---|
committer | Heikki Linnakangas | 2024-03-04 08:25:12 +0000 |
commit | 393b5599e5177e456cdce500039813629d370b38 (patch) | |
tree | bafd118d5dd94f63bcc711457a6d9c9248064051 /src/backend/commands | |
parent | 067701f57758f9baed5bd9d868539738d77bfa92 (diff) |
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
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/analyze.c | 4 | ||||
-rw-r--r-- | src/backend/commands/vacuum.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index a03495d6c95..d105d2fad7b 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -351,7 +351,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params, save_nestlevel = NewGUCNestLevel(); /* measure elapsed time iff autovacuum logging requires it */ - if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) + if (AmAutoVacuumWorkerProcess() && params->log_min_duration >= 0) { if (track_io_timing) { @@ -729,7 +729,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params, vac_close_indexes(nindexes, Irel, NoLock); /* Log the action if appropriate */ - if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) + if (AmAutoVacuumWorkerProcess() && params->log_min_duration >= 0) { TimestampTz endtime = GetCurrentTimestamp(); diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 64da8486276..e40cef6566e 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -564,7 +564,7 @@ vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, else { Assert(params->options & VACOPT_ANALYZE); - if (IsAutoVacuumWorkerProcess()) + if (AmAutoVacuumWorkerProcess()) use_own_xacts = true; else if (in_outer_xact) use_own_xacts = false; @@ -809,7 +809,7 @@ vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options, * statements in the permission checks; otherwise, only log if the caller * so requested. */ - if (!IsAutoVacuumWorkerProcess()) + if (!AmAutoVacuumWorkerProcess()) elevel = WARNING; else if (verbose) elevel = LOG; @@ -896,7 +896,7 @@ expand_vacuum_rel(VacuumRelation *vrel, MemoryContext vac_context, * Since autovacuum workers supply OIDs when calling vacuum(), no * autovacuum worker should reach this code. */ - Assert(!IsAutoVacuumWorkerProcess()); + Assert(!AmAutoVacuumWorkerProcess()); /* * We transiently take AccessShareLock to protect the syscache lookup @@ -2336,7 +2336,7 @@ vacuum_delay_point(void) * [autovacuum_]vacuum_cost_delay to take effect while a table is being * vacuumed or analyzed. */ - if (ConfigReloadPending && IsAutoVacuumWorkerProcess()) + if (ConfigReloadPending && AmAutoVacuumWorkerProcess()) { ConfigReloadPending = false; ProcessConfigFile(PGC_SIGHUP); |