Tracking issue for the review items Kirk Wolak raised against v5 of "PoC: Simplify recovery after dropping a table by LOGGING the restore LSN" (log_object_drops GUC), posted verbatim to the Hacking Postgres call chat. Andrey Borodin confirmed on the call this is "a real list of problems in the patch".
Kirk's four items
Additional findings
Open questions for the list
- Should unlogged tables be skipped as well? Contents are not PITR-recoverable either, though the definition is. Kirk's item said TEMP only, so scope was not expanded.
- Is end-of-commit-record or start-of-commit-record the right thing for a general
XactCallback LSN (item 5)?
- v5's
Assert(!XLogRecPtrIsInvalid(commit_lsn)) is retained — it holds, but fires on every commit.
Not done
- Not posted to pgsql-hackers / not attached to CF #6272 — GitHub PR only so far.
- Docs not rendered (DocBook DTD unavailable offline locally); pgindent not run (
pg_bsd_indent not installed); verified on macOS/arm64 + meson + cassert only. See the PR's "What I could NOT verify" section.
Tracking issue for the review items Kirk Wolak raised against v5 of "PoC: Simplify recovery after dropping a table by LOGGING the restore LSN" (
log_object_dropsGUC), posted verbatim to the Hacking Postgres call chat. Andrey Borodin confirmed on the call this is "a real list of problems in the patch".Kirk's four items
errmsgformat has 4%X("drop LSN: %X/%X, commit LSN: %X/%X") but passes oneLSN_FORMAT_ARGS()= 2 args. Confirmed real UB, not cosmetic — clang:warning: more '%' conversions than data arguments [-Wformat-insufficient-args]. The last two%Xread past the varargs. No "drop LSN" is recorded anywhere in the patch; message now reports the commit LSN only, in master's%X/%08Xformat.GetXLogInsertRecPtr(). Kirill Reshke's issue, unfixed on that path. Read before the commit record exists, anddropdb()forces an immediate checkpoint before committing, so it could be far behind the real commit LSN. Now routed through the same deferredXactCallbackpath as tables.ON COMMIT DROP/ session exit).recovery_target_inclusive). The trap: it defaults toon= stop after the target, so setting onlyrecovery_target_lsnreplays the drop and loses the table again. Documented with the requiredrecovery_target_inclusive = off.Additional findings
XactLogCommitRecord()returnsEndRecPtr, butrecovery_target_lsnis compared against each record's start (recoveryStopsBefore()testsrecord->ReadRecPtr). The end LSN is the start of the next record, so evenrecovery_target_inclusive = offreplays the drop — the documented recipe in item 4 does not work without this fix. Now reportsProcLastRecPtr. This one deserves list discussion: it changes the meaning of the LSN in theXactCallbackAPI v5 introduces.guc_parameters.datnow enforces alphabetical ordering;log_object_dropswas appended afterzero_damaged_pages→ hard build failure.t/050_drop_table_logging.plcollides with master's050_redo_segment_missing.pl→ renumbered to055.recovery_target_inclusivetrap.Open questions for the list
XactCallbackLSN (item 5)?Assert(!XLogRecPtrIsInvalid(commit_lsn))is retained — it holds, but fires on every commit.Not done
pg_bsd_indentnot installed); verified on macOS/arm64 + meson + cassert only. See the PR's "What I could NOT verify" section.