Skip to content

kvserver: add ability to lazily initialize Raft engine batches#160565

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
arulajmani:rse-split-writes
Jan 17, 2026
Merged

kvserver: add ability to lazily initialize Raft engine batches#160565
craig[bot] merged 1 commit intocockroachdb:masterfrom
arulajmani:rse-split-writes

Conversation

@arulajmani
Copy link
Copy Markdown
Collaborator

Previously, we were not distinguishing between the State engine and Raft engine when preparing a split. This patch fixes that, by adding the ability to lazily initialize a Raft batch, which will be written to the Raft engine, and passing it to splitPreApply.

Epic: none

Release note: None

@arulajmani arulajmani requested a review from pav-kv January 6, 2026 18:38
@arulajmani arulajmani requested a review from a team as a code owner January 6, 2026 18:38
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@pav-kv pav-kv left a comment

Choose a reason for hiding this comment

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

Looks good, LGTMable in the next iteration.

}

// Commit the Raft batch to Pebble, if it exists. Note unlike batches to the
// State engine, we always sync writes to the Raft engine.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TODO to revisit how the state engine is synced below? In separated engines mode, we can skip the second sync entirely by design (unless there are some corner cases to yet fix).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, let's leave this to a subsequent PR. Need to understand some of the commentary here better.

Copy link
Copy Markdown
Collaborator Author

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

@arulajmani made 6 comments and resolved 1 discussion.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @pav-kv).

}

// Commit the Raft batch to Pebble, if it exists. Note unlike batches to the
// State engine, we always sync writes to the Raft engine.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, let's leave this to a subsequent PR. Need to understand some of the commentary here better.

@arulajmani
Copy link
Copy Markdown
Collaborator Author

TFTR!

bors r=pav-kv

Previously, we were not distinguishing between the State engine and
Raft engine when preparing a split. This patch fixes that, by adding the
ability to lazily initialize a Raft batch, which will be written to the
Raft engine, and passing it to splitPreApply.

Epic: none

Release note: None
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 16, 2026

Canceled.

@arulajmani
Copy link
Copy Markdown
Collaborator Author

Reverted the comment wrap.

bors r=pav-kv

craig bot pushed a commit that referenced this pull request Jan 16, 2026
160565: kvserver: add ability to lazily initialize Raft engine batches r=pav-kv a=arulajmani

Previously, we were not distinguishing between the State engine and Raft engine when preparing a split. This patch fixes that, by adding the ability to lazily initialize a Raft batch, which will be written to the Raft engine, and passing it to splitPreApply.

Epic: none

Release note: None

Co-authored-by: Arul Ajmani <arulajmani@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 16, 2026

Build failed:

@pav-kv
Copy link
Copy Markdown
Collaborator

pav-kv commented Jan 17, 2026

bors retry

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 17, 2026

@craig craig bot merged commit af550e4 into cockroachdb:master Jan 17, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants