v8-0005-Add-assertion-that-we-are-not-an-autovacuum-worke.patch

application/octet-stream

Filename: v8-0005-Add-assertion-that-we-are-not-an-autovacuum-worke.patch
Type: application/octet-stream
Part: 4
Message: Add SKIP LOCKED to VACUUM and ANALYZE

Patch

Format: format-patch
Series: patch v8-0005
Subject: Add assertion that we are not an autovacuum worker in expand_vacuum_rel().
File+
src/backend/commands/vacuum.c 6 0
From 10dee9e8ecbf8351c362e0d480172cec48f1025b Mon Sep 17 00:00:00 2001
From: Nathan Bossart <bossartn@amazon.com>
Date: Wed, 4 Apr 2018 16:55:33 +0000
Subject: [PATCH v8 05/12] Add assertion that we are not an autovacuum worker
 in expand_vacuum_rel().

---
 src/backend/commands/vacuum.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 8902eba337..d539e33b8b 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -443,6 +443,12 @@ expand_vacuum_rel(VacuumRelation *vrel)
 		Form_pg_class classForm;
 		bool		include_parts;
 
+		/*
+		 * Since autovacuum workers supply OIDs when calling vacuum(), no
+		 * autovacuum worker should reach this code.
+		 */
+		Assert(!IsAutoVacuumWorkerProcess());
+
 		/*
 		 * We transiently take AccessShareLock to protect the syscache lookup
 		 * below, as well as find_all_inheritors's expectation that the caller
-- 
2.16.2