Skip to content

Commit 6551f3d

Browse files
committed
Add assertion in expand_vacuum_rel() for non-autovacuum path
The code path where the assertion is added helps to check that autovacuum always includes a relation OID when doing a vacuum on it. Extracted from a larger patch set to add support for SKIP LOCKED with manual VACUUM commands. Author: Nathan Bossart Discussion: https://postgr.es/m/9EF7EBE4-720D-4CF1-9D0E-4403D7E92990@amazon.com
1 parent 9a7b7ad commit 6551f3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/commands/vacuum.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ expand_vacuum_rel(VacuumRelation *vrel)
443443
Form_pg_class classForm;
444444
bool include_parts;
445445

446+
/*
447+
* Since autovacuum workers supply OIDs when calling vacuum(), no
448+
* autovacuum worker should reach this code.
449+
*/
450+
Assert(!IsAutoVacuumWorkerProcess());
451+
446452
/*
447453
* We transiently take AccessShareLock to protect the syscache lookup
448454
* below, as well as find_all_inheritors's expectation that the caller

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy