Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNR Introduce term cache v1 in memory rebase pav #142084

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

hakuuww
Copy link
Contributor

@hakuuww hakuuww commented Feb 27, 2025

No description provided.

hakuuww and others added 11 commits February 14, 2025 13:02
This is a draft commit that adds a metric to record the latency for loading term if there is a cache miss.

Also adds separate metrics for raftRntry cache accesses from loadTerm.

Running roachtests against this build will help us with understanding the access patterns of raftEntry Cache, and understand how much performance improvement we may get when we introduce a term cache.

This commit is only for reference purpose, shouldn't be merged.

References: cockroachdb#136296
Epic: None
Release note: None
Prototype for the termCache.
And append logic.

References: cockroachdb#136296
Epic: None
Release note: None
Passed all unit tests in kv/kvserver!

References: cockroachdb#136296
Epic: None
Release note: None
Integrate with metrics from another branch cockroachdb#141159

References: cockroachdb#136296
Epic: None
Release note: None
…sing snapshot and cold restart

References: cockroachdb#136296
Epic: None
Release note: None
recover from snapshot

References: cockroachdb#136296
Epic: None
Release note: None
See the function comment. RawNode never accesses log indices above the
storage.LastIndex() because it has them covered by the unstable log.

Epic: none
Release note: none
Epic: none
Release note: none
We already read the last entry term when initializing RawNode, so there
is no additional overhead, except the fact that this entry is now not
stashed into the raft entry cache. There appears to be low benefit in
putting it into the cache though. Typically, we wouldn't need exactly
the LastIndex entry post startup.

Eventually, on startup we will load the term cache instead of the last
entry.

Epic: none
Release note: none
We always know the term of the last entry. It is now loaded on replica
startup. The applySnapshot code resets the log to empty, and knows the
term of the last entry.

Epic: none
Release note: none
recover from snapshot, and recover from cold restart

References: cockroachdb#136296
Epic: None
Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

References: cockroachdb#136296
Epic: None
Release note: None
@hakuuww hakuuww force-pushed the introduceTermCacheV1InMemoryRebasePav branch from 4ae3684 to 32382cc Compare March 1, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants