Skip to content

Commit 03318a9

Browse files
lakshmisahasranhackorum
authored andcommitted
Add CHECK_FOR_INTERRUPTS in autovacuum table-scanning loops
1 parent b597835 commit 03318a9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/backend/postmaster/autovacuum.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,8 @@ get_database_list(void)
18611861
avw_dbase *avdb;
18621862
MemoryContext oldcxt;
18631863

1864+
CHECK_FOR_INTERRUPTS();
1865+
18641866
/*
18651867
* If database has partially been dropped, we can't, nor need to,
18661868
* vacuum it.
@@ -2044,6 +2046,8 @@ do_autovacuum(void)
20442046
bool wraparound;
20452047
AutoVacuumScores scores;
20462048

2049+
CHECK_FOR_INTERRUPTS();
2050+
20472051
if (classForm->relkind != RELKIND_RELATION &&
20482052
classForm->relkind != RELKIND_MATVIEW)
20492053
continue;
@@ -2148,6 +2152,8 @@ do_autovacuum(void)
21482152
bool wraparound;
21492153
AutoVacuumScores scores;
21502154

2155+
CHECK_FOR_INTERRUPTS();
2156+
21512157
/*
21522158
* We cannot safely process other backends' temp tables, so skip 'em.
21532159
*/
@@ -3676,6 +3682,8 @@ pg_stat_get_autovacuum_scores(PG_FUNCTION_ARGS)
36763682
Datum vals[10];
36773683
bool nulls[10] = {false};
36783684

3685+
CHECK_FOR_INTERRUPTS();
3686+
36793687
/* skip ineligible entries */
36803688
if (form->relkind != RELKIND_RELATION &&
36813689
form->relkind != RELKIND_MATVIEW &&

0 commit comments

Comments
 (0)