Commit 5871f09c authored by Andres Freund's avatar Andres Freund

Fix autovacuum cancellation.

The problem is caused by me (Andres) having ProcSleep() look at the
wrong PGPROC entry in 5788e258.

Unfortunately it seems hard to write a reliable test for autovacuum
cancellations. Perhaps somebody will come up with a good approach, but
it seems worth fixing the issue even without a test.
Reported-By: default avatarJeff Janes <jeff.janes@gmail.com>
Author: Jeff Janes <jeff.janes@gmail.com>
Discussion: https://postgr.es/m/CAMkU=1wH2aUy+wDRDz+5RZALdcUnEofV1t9PzXS_gBJO9vZZ0Q@mail.gmail.com
parent 3438c988
......@@ -1318,7 +1318,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
* Only do it if the worker is not working to protect against Xid
* wraparound.
*/
vacuumFlags = ProcGlobal->vacuumFlags[proc->pgxactoff];
vacuumFlags = ProcGlobal->vacuumFlags[autovac->pgxactoff];
if ((vacuumFlags & PROC_IS_AUTOVACUUM) &&
!(vacuumFlags & PROC_VACUUM_FOR_WRAPAROUND))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment