cockroachdb / cockroachdb/cockroach

kv: apply log entries outside of raft state machine loop

Open
#94,854 4 comments 0 reactions 0 assignees View on GitHub
A-kv-replication C-performance T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Extracted from #17500.

After #94165, raft log entry disk writes are asynchronous with respect to the raft state machine loop. However, the (non-durable) engine access for state machine application is still performed inline. The [async storage writes interface](https://github.com/etcd-io/raft/pull/8) permits us to extract all of this work onto a separate goroutine.

This would provide three benefits:
1. faster state machine loop iteration => less interference between entries => lower latency
2. larger apply batches => more efficient state machine application => higher throughput
3. flexible scheduling permits deferred application on followers => bigger batches, see benefit 2

Jira issue: CRDB-23189

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.