Support RBM_ZERO_AND_CLEANUP_LOCK in ExtendBufferedRelTo(), add tests
Andres Freund <andres@anarazel.de>
Support RBM_ZERO_AND_CLEANUP_LOCK in ExtendBufferedRelTo(), add tests For some reason I had not implemented RBM_ZERO_AND_CLEANUP_LOCK support in ExtendBufferedRelTo(), likely thinking it not being reachable. But it is reachable, e.g. when replaying a WAL record for a page in a relation that subsequently is truncated (likely only reachable when doing crash recovery or PITR, not during ongoing streaming replication). As now all of the RBM_* modes are supported, remove assertions checking mode. As we had no test coverage for this scenario, add a new TAP test. There's plenty more that ought to be tested in this area... Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Reported-by: Alexander Lakhin <exclusion@gmail.com> Reviewed-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/392271.1681238924%40sss.pgh.pa.us Discussion: https://postgr.es/m/0b5eb82b-cb99-e0a4-b932-3dc60e2e3926@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/buffer/bufmgr.c | modified | +17 −11 |
| src/test/recovery/meson.build | modified | +1 −0 |
| src/test/recovery/t/036_truncated_dropped.pl | added | +136 −0 |
Discussion
- refactoring relation extension and BufferAlloc(), faster COPY 57 messages · 2022-10-29 → 2023-05-03
- Assertion being hit during WAL replay 6 messages · 2023-04-11 → 2023-04-14