Skip to content

[raft/store] Update Transact signature#1577

Open
MariemBaccari wants to merge 1 commit into
interuss:masterfrom
Orbitalize:change_transact_signature_prototype
Open

[raft/store] Update Transact signature#1577
MariemBaccari wants to merge 1 commit into
interuss:masterfrom
Orbitalize:change_transact_signature_prototype

Conversation

@MariemBaccari

@MariemBaccari MariemBaccari commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Transact currently takes a raw func(ctx, R) error closure which works for the sqlstore but can't be replicated by the Raftstore since it needs a request type, payload and an independently accessible function to execute on the apply side.

This PR changes the interface to accept a store.Action[R] instead in preparation for the raftstore implementation.
The interface function Execute should contain the current action (business logic) defined in the handlers.

To keep changes minimal in this PR, the FuncAction[R] adapter wraps the existing closures as a stub Action.
Follow-up PRs will remove FuncAction[R] and extract the actions for all handlers.

The PR also adds TransactWithResult[R, Res], a generic function wrapping Transact which serves as a helper for result type asserts to avoid code duplication on the handler side. The reason why we need a wrapper instead of making Transact generic is that Go does not currently allow generic methods.

@MariemBaccari MariemBaccari force-pushed the change_transact_signature_prototype branch 3 times, most recently from adc2bed to 558c48b Compare June 29, 2026 12:50
@barroco barroco added the dss-raft Relating to the application-layer consensus implemenation based on raft label Jun 29, 2026
@MariemBaccari MariemBaccari force-pushed the change_transact_signature_prototype branch 4 times, most recently from 5dcae06 to 373d538 Compare June 30, 2026 14:11
@MariemBaccari MariemBaccari force-pushed the change_transact_signature_prototype branch from 373d538 to 1c46a39 Compare July 1, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dss-raft Relating to the application-layer consensus implemenation based on raft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants