Skip to content

raft: use term cache for leader commit term check #143362

@hakuuww

Description

@hakuuww

Previously, we avoided calling term(index) for leader commit term check by keeping the first entry index for the current leader term in memory, and comparing against that index. (see #137826)

Now, since we have implemented term cache (which keeps track of a suffix of raft log entryIDs, and allow us to get the term of an entry by index), lets use the term cache for that check to reduce the complexity of our code. (see #142239 )

Jira issue: CRDB-48779

Metadata

Metadata

Assignees

Labels

A-kv-replicationRelating to Raft, consensus, and coordination.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)v25.2.0-prerelease

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions