Buffer manager modifications to keep a local buffer-dirtied bit as well
Tom Lane <tgl@sss.pgh.pa.us>
Buffer manager modifications to keep a local buffer-dirtied bit as well as a shared dirtybit for each shared buffer. The shared dirtybit still controls writing the buffer, but the local bit controls whether we need to fsync the buffer's file. This arrangement fixes a bug that allowed some required fsyncs to be missed, and should improve performance as well. For more info see my post of same date on pghackers.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xact.c | modified | +7 −4 |
| src/backend/catalog/catalog.c | modified | +68 −6 |
| src/backend/storage/buffer/buf_init.c | modified | +9 −5 |
| src/backend/storage/buffer/bufmgr.c | modified | +419 −187 |
| src/backend/storage/buffer/freelist.c | modified | +4 −4 |
| src/backend/storage/file/fd.c | modified | +92 −15 |
| src/backend/storage/smgr/md.c | modified | +210 −164 |
| src/backend/storage/smgr/smgr.c | modified | +91 −23 |
| src/include/catalog/catalog.h | modified | +3 −1 |
| src/include/storage/buf_internals.h | modified | +15 −4 |
| src/include/storage/bufmgr.h | modified | +2 −2 |
| src/include/storage/fd.h | modified | +3 −2 |
| src/include/storage/smgr.h | modified | +28 −14 |