Skip to content

Add decoding_xid_status_hook and RBTXN_NO_STREAMING for storage-engine logical xids#79

Open
DmitryNFomin wants to merge 2 commits into
orioledb:patches17from
DmitryNFomin:oriole-663-pr
Open

Add decoding_xid_status_hook and RBTXN_NO_STREAMING for storage-engine logical xids#79
DmitryNFomin wants to merge 2 commits into
orioledb:patches17from
DmitryNFomin:oriole-663-pr

Conversation

@DmitryNFomin

@DmitryNFomin DmitryNFomin commented Jul 24, 2026

Copy link
Copy Markdown

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:

  1. decoding_xid_status_hook (src/include/access/xact.h). Storage
    engines whose decoded transactions carry logical-only xids (no clog
    backing) cannot answer TransactionIdIsInProgress() /
    TransactionIdDidCommit() during streamed decoding: the clog lookup
    fails with could not access status of transaction N — the failure
    mode 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) and HandleConcurrentAbort() (genam.c), before
    falling back to the clog paths. With no hook installed the code is
    unchanged.

  2. RBTXN_NO_STREAMING transaction flag
    (src/include/replication/reorderbuffer.h), checked in
    ReorderBufferLargestStreamableTopTXN() and the post-serialize
    stream 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->streaming for 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 / isolationcheck pass. Ports of this patch to patches16
and patches18 are mechanical; available on request.

proto 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant