mirror of
https://github.com/postgres/postgres.git
synced 2026-03-14 06:32:18 -04:00
If vacuum fails to remove a tuple with xmax older than
VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed,
it may attempt to freeze the tuple's xmax and then ERROR out in
pre-freeze checks with "cannot freeze committed xmax".
Fix this by having vacuum always remove tuples older than OldestXmin.
It is possible for GlobalVisState->maybe_needed to precede OldestXmin if
maybe_needed is forced to go backward while vacuum is running. This can
happen if a disconnected standby with a running transaction older than
VacuumCutoffs->OldestXmin reconnects to the primary after vacuum
initially calculates GlobalVisState and OldestXmin.
In back branches starting with 14, the first version using
GlobalVisState, failing to remove tuples older than OldestXmin during
pruning caused vacuum to infinitely loop in lazy_scan_prune(), as
investigated on this [1] thread. After
|
||
|---|---|---|
| .. | ||
| brin | ||
| common | ||
| gin | ||
| gist | ||
| hash | ||
| heap | ||
| index | ||
| nbtree | ||
| rmgrdesc | ||
| sequence | ||
| spgist | ||
| table | ||
| tablesample | ||
| transam | ||
| Makefile | ||
| meson.build | ||