Subject: Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN
Hi all,
I've implemented an improved version of this feature that addresses
Kirill's concern about logging the wrong LSN [1].
The key difference: instead of logging WAL insert pointer at lock time,
this patch logs the actual commit LSN by extending XactCallback to pass
the commit LSN from the commit record.
Main improvements:
- Logs real commit LSN, not an earlier position
- Handles ROLLBACK correctly (no log for aborted drops)
- Supports SAVEPOINT, ROLLBACK TO, COMMIT AND CHAIN
- New GUC: log_object_drops (default: off)
- Includes DROP DATABASE support
- Comprehensive TAP tests
This makes the LSN reliable for PITR recovery regardless of system load.
Patch attached. Feedback welcome!
[1]
https://www.postgresql.org/message-id/CALdSSPiRDvbuPgZKAB1%2BBDb3Nfe-i3PYkiy%3DScMZ7tU5f0toKQ%40mail.gmail.com--