-
Notifications
You must be signed in to change notification settings - Fork 69
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
[store] bump CommitKVStoreCache limit and switch to 2Q from arc #152
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d705aba
Bump CacheKV limit
BrandonWeng b9a130e
LRU cache bump
BrandonWeng f6085b4
revert to arc
BrandonWeng 939a3b4
use 2q cache
BrandonWeng 9f9dea2
Test rollback tm
BrandonWeng a1b398a
fix
BrandonWeng b93efa9
bump TM
BrandonWeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ var ( | |
|
||
// DefaultCommitKVStoreCacheSize defines the persistent ARC cache size for a | ||
// CommitKVStoreCache. | ||
DefaultCommitKVStoreCacheSize uint = 1000 | ||
DefaultCommitKVStoreCacheSize uint = 100000 | ||
) | ||
|
||
type ( | ||
|
@@ -28,7 +28,7 @@ type ( | |
// CommitKVStore and below is completely irrelevant to this layer. | ||
CommitKVStoreCache struct { | ||
types.CommitKVStore | ||
cache *lru.ARCCache | ||
cache *lru.TwoQueueCache | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reason for investigating ARCCache was due to this exception that caused a consensus issue And another git issues reporting non-threadsafe behaviour hashicorp/golang-lru#71
|
||
cacheKVSize int | ||
|
||
// the same CommitKVStoreCache may be accessed concurrently by multiple | ||
|
@@ -48,7 +48,7 @@ type ( | |
) | ||
|
||
func NewCommitKVStoreCache(store types.CommitKVStore, size uint, cacheKVSize int) *CommitKVStoreCache { | ||
cache, err := lru.NewARC(int(size)) | ||
cache, err := lru.New2Q(int(size)) | ||
if err != nil { | ||
panic(fmt.Errorf("failed to create KVStore cache: %s", err)) | ||
} | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore, just wanted to confirm the data race issue is related to a tendermint change. Which seems to be the case :(