-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
hakuuww
wants to merge
12
commits into
cockroachdb:master
Choose a base branch
from
hakuuww:introduceTermCacheV1InMemoryRebasePav
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
DNR Introduce term cache v1 in memory rebase pav #142084
hakuuww
wants to merge
12
commits into
cockroachdb:master
from
hakuuww:introduceTermCacheV1InMemoryRebasePav
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
References: cockroachdb#136296 Epic: None Release note: None
4ae3684
to
32382cc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.