Skip to content

adapter: introduce UserWriteResponder for PendingWriteTxn::User#36670

Open
aljoscha wants to merge 1 commit into
MaterializeInc:mainfrom
aljoscha:push-xoyusvunplzw
Open

adapter: introduce UserWriteResponder for PendingWriteTxn::User#36670
aljoscha wants to merge 1 commit into
MaterializeInc:mainfrom
aljoscha:push-xoyusvunplzw

Conversation

@aljoscha
Copy link
Copy Markdown
Contributor

Wrap the per-session PendingTxn inside PendingWriteTxn::User in a new UserWriteResponder enum (single Session(PendingTxn) variant for now). Construction and pattern-matching sites are updated to thread the value through UserWriteResponder::Session(...); DeferredWrite keeps its raw pending_txn: PendingTxn because the deferred-op machinery is session-only and doesn't gain by going through the responder.

This is preparation: the read-then-write OCC path will need to commit writes whose result is delivered via a oneshot rather than retired through an ExecuteContext. Introducing the abstraction with one variant first makes the OCC commit additive (a new Internal variant plus the call sites that produce/consume it) instead of also having to rename the field at every existing site. No behavior change.

Work towards https://github.com/MaterializeInc/database-issues/issues/6686

Wrap the per-session `PendingTxn` inside `PendingWriteTxn::User` in a new
`UserWriteResponder` enum (single `Session(PendingTxn)` variant for now).
Construction and pattern-matching sites are updated to thread the value
through `UserWriteResponder::Session(...)`; `DeferredWrite` keeps its raw
`pending_txn: PendingTxn` because the deferred-op machinery is
session-only and doesn't gain by going through the responder.

This is preparation: the read-then-write OCC path will need to commit
writes whose result is delivered via a oneshot rather than retired
through an `ExecuteContext`. Introducing the abstraction with one
variant first makes the OCC commit additive (a new `Internal` variant
plus the call sites that produce/consume it) instead of also having to
rename the field at every existing site. No behavior change.

Work towards MaterializeInc/database-issues#6686

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aljoscha aljoscha requested a review from a team as a code owner May 21, 2026 12:38
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