xloginsert_fix.patch
application/octet-stream
Filename: xloginsert_fix.patch
Type: application/octet-stream
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 | 13 | 1 |
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index ba83123..a950518 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -1168,6 +1168,7 @@ PerformXLogInsert(int write_len, bool isLogSwitch, XLogRecord *rechdr, * record, and continue. */ XLogContRecord *contrecord; + int freespace2; memcpy(currpos, rdata->data, freespace); rdata->data += freespace; @@ -1191,7 +1192,18 @@ PerformXLogInsert(int write_len, bool isLogSwitch, XLogRecord *rechdr, UpdateSlotCurrPos(myslot, CurrPos); /* Now skip page header */ - CurrPos = AdvanceXLogRecPtrToNextPage(CurrPos); +// CurrPos = AdvanceXLogRecPtrToNextPage(CurrPos); + + freespace2 = INSERT_FREESPACE(CurrPos); + XLByteAdvance(CurrPos, freespace2); + + currpos = GetXLogBuffer(CurrPos); + ((XLogPageHeader)currpos)->xlp_info |= XLP_FIRST_IS_CONTRECORD; + + if (CurrPos.xrecoff % XLogSegSize == 0) + CurrPos.xrecoff += SizeOfXLogLongPHD; + else + CurrPos.xrecoff += SizeOfXLogShortPHD; currpos = GetXLogBuffer(CurrPos);