Skip to content

Commit df791bf

Browse files
committed
[refer #PGPRO-1940] Fix disabling autovacuum in snapshot
1 parent 3a8d333 commit df791bf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/postmaster/autovacuum.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,8 @@ AutoVacWorkerMain(int argc, char *argv[])
17041704
recentMulti = ReadNextMultiXactId();
17051705

17061706
LWLockAcquire(DoAutovacuumLock, LW_SHARED);
1707-
do_autovacuum();
1707+
if (!SFS_IN_SNAPSHOT()) /* Do not perform autovacuum in snapshot */
1708+
do_autovacuum();
17081709
LWLockRelease(DoAutovacuumLock);
17091710
}
17101711

@@ -1961,10 +1962,6 @@ do_autovacuum(void)
19611962
bool found_concurrent_worker = false;
19621963
int i;
19631964

1964-
/* Do not perform autovacuum in snapshot */
1965-
if (!SFS_IN_SNAPSHOT())
1966-
return;
1967-
19681965
/*
19691966
* StartTransactionCommand and CommitTransactionCommand will automatically
19701967
* switch to other contexts. We need this one to keep the list of

0 commit comments

Comments
 (0)