aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2024-12-03 09:27:05 +1300
committerThomas Munro <tmunro@postgresql.org>2024-12-03 10:20:10 +1300
commitad5aa7bfd042c9d0588f206f4c4ac65c3203bd48 (patch)
tree90ce3bfa4808ef2d84d86bf19b9fafd21dc9d50e /src/backend/tcop/postgres.c
parentcca34f68c6fa827728f16e563b16d90aa1679ab2 (diff)
downloadpostgresql-ad5aa7bfd042c9d0588f206f4c4ac65c3203bd48.tar.gz
postgresql-ad5aa7bfd042c9d0588f206f4c4ac65c3203bd48.zip
RelationTruncate() must set DELAY_CHKPT_START.
Previously, it set only DELAY_CHKPT_COMPLETE. That was important, because it meant that if the XLOG_SMGR_TRUNCATE record preceded a XLOG_CHECKPOINT_ONLINE record in the WAL, then the truncation would also happen on disk before the XLOG_CHECKPOINT_ONLINE record was written. However, it didn't guarantee that the sync request for the truncation was processed before the XLOG_CHECKPOINT_ONLINE record was written. By setting DELAY_CHKPT_START, we guarantee that if an XLOG_SMGR_TRUNCATE record is written to WAL before the redo pointer of a concurrent checkpoint, the sync request queued by that operation must be processed by that checkpoint, rather than being left for the following one. This is a refinement of commit 412ad7a5563. Back-patch to all supported releases, like that commit. Author: Robert Haas <robertmhaas@gmail.com> Reported-by: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKG%2B-2rjGZC2kwqr2NMLBcEBp4uf59QT1advbWYF_uc%2B0Aw%40mail.gmail.com
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions