Prevent re-use of a deleted relation's relfilenode until after the next
Tom Lane <tgl@sss.pgh.pa.us>
Prevent re-use of a deleted relation's relfilenode until after the next checkpoint. This guards against an unlikely data-loss scenario in which we re-use the relfilenode, then crash, then replay the deletion and recreation of the file. Even then we'd be OK if all insertions into the new relation had been WAL-logged ... but that's not guaranteed given all the no-WAL-logging optimizations that have recently been added. Patch by Heikki Linnakangas, per a discussion last month.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xlog.c | modified | +15 −1 |
| src/backend/commands/tablespace.c | modified | +23 −6 |
| src/backend/storage/smgr/md.c | modified | +193 −11 |
| src/backend/storage/smgr/smgr.c | modified | +38 −6 |
| src/include/storage/smgr.h | modified | +5 −1 |