Skip to content

[raftstore] Embed memstore and use checkpoint - #1669

Open
MariemBaccari wants to merge 19 commits into
interuss:masterfrom
Orbitalize:use_checkpoint
Open

[raftstore] Embed memstore and use checkpoint#1669
MariemBaccari wants to merge 19 commits into
interuss:masterfrom
Orbitalize:use_checkpoint

Conversation

@MariemBaccari

@MariemBaccari MariemBaccari commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Chained PR: #1627 -> #1642 -> #1643 -> #1644 -> #1645 -> #1646 -> #1649 -> #1650 -> #1651 -> #1653 -> #1654 -> #1656 -> #1657 -> #1655 -> #1666 -> #1667 -> #1668 -> #1669

This PR adds the use of the memstore checkpoint to ensure raft operations are atomic and embeds the memstore directly to simplify the raftstore.

@mickmis mickmis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(5fe0a16) LGTM modulo comments

Comment thread pkg/raftstore/store.go
proposalCtx = locality.NewContext(proposalCtx, commit.Prop.Locality)
s.raftRepo.Checkpoint()
result, err := s.raftRepo.Apply(proposalCtx, commit.Prop)
if err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some logging advising of the restore could be handy here.

Comment thread pkg/raftstore/store.go

// Restore reverts the state to the last Checkpoint, called when Apply returns an error so a
// failed proposal cannot leave a partial mutation in place.
Restore()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end shouldn't RaftRepo embed the MemRepo interface? It just has Apply in addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants