v2-0001-Add-CHECK_FOR_INTERRUPTS-in-autovacuum-table-scannin.patch

application/octet-stream

Filename: v2-0001-Add-CHECK_FOR_INTERRUPTS-in-autovacuum-table-scannin.patch
Type: application/octet-stream
Part: 0
Message: Re: Add missing CHECK_FOR_INTERRUPTS in autovacuum catalog scan loops

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v2-0001
Subject: Add CHECK_FOR_INTERRUPTS in autovacuum table-scanning loops
File+
src/backend/postmaster/autovacuum.c 8 0
From d2d31987d2e479a8d92494644c183c8bd2f749b2 Mon Sep 17 00:00:00 2001
From: Lakshmi N <lakshmin.jhs@gmail.com>
Date: Fri, 10 Apr 2026 01:39:04 -0700
Subject: [PATCH] Add CHECK_FOR_INTERRUPTS in autovacuum table-scanning loops

---
 src/backend/postmaster/autovacuum.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 82061247988..5e36137925a 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1859,6 +1859,8 @@ get_database_list(void)
 		avw_dbase  *avdb;
 		MemoryContext oldcxt;
 
+		CHECK_FOR_INTERRUPTS();
+
 		/*
 		 * If database has partially been dropped, we can't, nor need to,
 		 * vacuum it.
@@ -2042,6 +2044,8 @@ do_autovacuum(void)
 		bool		wraparound;
 		AutoVacuumScores scores;
 
+		CHECK_FOR_INTERRUPTS();
+
 		if (classForm->relkind != RELKIND_RELATION &&
 			classForm->relkind != RELKIND_MATVIEW)
 			continue;
@@ -2146,6 +2150,8 @@ do_autovacuum(void)
 		bool		wraparound;
 		AutoVacuumScores scores;
 
+		CHECK_FOR_INTERRUPTS();
+
 		/*
 		 * We cannot safely process other backends' temp tables, so skip 'em.
 		 */
@@ -3669,6 +3675,8 @@ pg_stat_get_autovacuum_scores(PG_FUNCTION_ARGS)
 		Datum		vals[10];
 		bool		nulls[10] = {false};
 
+		CHECK_FOR_INTERRUPTS();
+
 		/* skip ineligible entries */
 		if (form->relkind != RELKIND_RELATION &&
 			form->relkind != RELKIND_MATVIEW &&
-- 
2.43.0