Add decoding_xid_status_hook and RBTXN_NO_STREAMING for storage-engine logical xids#79
Open
DmitryNFomin wants to merge 2 commits into
Open
Add decoding_xid_status_hook and RBTXN_NO_STREAMING for storage-engine logical xids#79DmitryNFomin wants to merge 2 commits into
DmitryNFomin wants to merge 2 commits into
Conversation
added 2 commits
July 24, 2026 17:08
Storage engines whose transactions carry logical-only xids (no clog backing) cannot answer TransactionIdIsInProgress()/TransactionIdDidCommit() during streamed logical decoding: the clog lookup fails with 'could not access status of transaction N'. Let the engine supply the status via a hook, consulted by SetupCheckXidLive() and HandleConcurrentAbort() before falling back to the clog paths.
Lets an rmgr decode callback exclude specific transactions from streaming selection while leaving streaming enabled for the rest of the decoding session. Checked in ReorderBufferLargestStreamableTopTXN() and in the post-serialize stream path.
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Infrastructure for orioledb/orioledb#663 (paired extension PR: orioledb/orioledb#988).
Two additions to the logical decoding machinery, both inert unless a
storage engine opts in:
decoding_xid_status_hook(src/include/access/xact.h). Storageengines whose decoded transactions carry logical-only xids (no clog
backing) cannot answer
TransactionIdIsInProgress()/TransactionIdDidCommit()during streamed decoding: the clog lookupfails with
could not access status of transaction N— the failuremode that motivated the extension-side commit e7feb24448ad
("Temporarily disable streaming replication"). The hook is consulted
by the only two such call sites,
SetupCheckXidLive()(
reorderbuffer.c) andHandleConcurrentAbort()(genam.c), beforefalling back to the clog paths. With no hook installed the code is
unchanged.
RBTXN_NO_STREAMINGtransaction flag(
src/include/replication/reorderbuffer.h), checked inReorderBufferLargestStreamableTopTXN()and the post-serializestream path. Lets an rmgr decode callback exclude specific
transactions from streaming selection while leaving streaming enabled
for the rest of the decoding session — replacing the current
extension behavior of clearing
ctx->streamingfor the whole session(which also stops heap transactions from streaming; see the paired PR
for measurements).
Validation is in the paired extension PR: with these hooks plus the
extension change, heap transactions stream again (including after
OrioleDB records in the same decode pass), OrioleDB transactions decode
completely via the spill path, and
test.t.logical_test/regresscheck/isolationcheckpass. Ports of this patch to patches16and patches18 are mechanical; available on request.