Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8c7f40

Browse files
committed
logical decoding: process ASSIGNMENT during snapshot build
Most WAL records are ignored in early SnapBuild snapshot build phases.But it's critical to process some of them, so that later messages havethe correct transaction state after the snapshot is completely built; inparticular, XLOG_XACT_ASSIGNMENT messages are critical in order forsub-transactions to be correctly assigned to their parent transactions,or at least one assert misbehaves, as reported by Ildar Musin.Diagnosed-by: Masahiko SawadaAuthor: Masahiko SawadaDiscussion:https://postgr.es/m/CAONYFtOv+Er1p3WAuwUsy1zsCFrSYvpHLhapC_fMD-zNaRWxYg@mail.gmail.com
1 parentca08ea5 commite8c7f40

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎src/backend/replication/logical/decode.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,15 @@ DecodeXactOp(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
202202
uint8info=r->xl_info& ~XLR_INFO_MASK;
203203

204204
/*
205-
* No point in doing anything yet, data could not be decoded anyway. It's
206-
* ok not to call ReorderBufferProcessXid() in that case, except in the
207-
* assignment case there'll not be any later records with the same xid;
208-
* and in the assignment case we'll not decode those xacts.
205+
* If the snapshot isn't yet fully built, we cannot decode anything, so
206+
* bail out.
207+
*
208+
* However, it's critical to process XLOG_XACT_ASSIGNMENT records even
209+
* when the snapshot is being built: it is possible to get later records
210+
* that require subxids to be properly assigned.
209211
*/
210-
if (SnapBuildCurrentState(builder)<SNAPBUILD_FULL_SNAPSHOT)
212+
if (SnapBuildCurrentState(builder)<SNAPBUILD_FULL_SNAPSHOT&&
213+
info!=XLOG_XACT_ASSIGNMENT)
211214
return;
212215

213216
switch (info)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp