hack.diff
text/x-patch
Filename: hack.diff
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/access/transam/xlog.c | 1 | 0 |
| src/backend/catalog/storage.c | 4 | 0 |
| src/backend/storage/smgr/smgr.c | 2 | 0 |
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index fcbde10529..cc51a0ea44 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7051,6 +7051,7 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags) CheckPointSUBTRANS(); CheckPointMultiXact(); CheckPointPredicate(); + sleep(3); CheckPointBuffers(flags); /* Perform all queued up fsyncs */ diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index 93f07e49b7..3785ecd699 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -28,6 +28,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "miscadmin.h" +#include "postmaster/bgwriter.h" /* XXX for RequestCheckpoint() (!!!) */ #include "storage/freespace.h" #include "storage/smgr.h" #include "utils/hsearch.h" @@ -389,6 +390,9 @@ RelationTruncate(Relation rel, BlockNumber nblocks) XLogFlush(lsn); } + /* XXX unlucky timing, a checkpoint happens to start now */ + RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE); + /* * This will first remove any buffers from the buffer pool that should no * longer exist after truncation is complete, and then truncate the diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 5d0f3d515c..30ef9263f4 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -663,6 +663,8 @@ smgrtruncate(SMgrRelation reln, ForkNumber *forknum, int nforks, BlockNumber *nb */ DropRelationBuffers(reln, forknum, nforks, nblocks); + sleep(5); + /* * Send a shared-inval message to force other backends to close any smgr * references they may have for this rel. This is useful because they