forked from apache/cassandra
-
Notifications
You must be signed in to change notification settings - Fork 22
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
CNDB-9104: Port over chunk cache improvements from DSE #1495
Open
blambov
wants to merge
34
commits into
datastax:main
Choose a base branch
from
blambov:CNDB-9104
base: main
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.
Open
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3968200
Remove unused BufferHolder methods
blambov 1ad3ac4
DB-2904 port: Use same size buffers in chunk cache
blambov cfa0842
Always use off-heap memory for chunk cache.
blambov 0f84fc2
Use networking buffer pool for compressed reads.
blambov 31a5fda
Allow buffer pool to return one-buffer multi-page chunks
blambov 6aa0130
Port over some chunk cache tests
blambov 1a15fa5
Set up for on-heap memory usage test
blambov c4f14ee
Introduce fileID and invalidate file by dropping id.
blambov 307aa7f
Store addresses and attachments to avoid a direct buffer per entry
blambov be317b2
Sleep for jmap
blambov 1313839
Remove pre-computed key hash
blambov 36be7e5
Revert "Sleep for jmap"
blambov 9190348
Revert "Set up for on-heap memory usage test"
blambov d4e230e
Review changes and license fix
blambov d5a22c8
Drop ChunkReader reference from Key
blambov fa2551f
Revert unneeded change
blambov 89817b4
Test improvements
blambov c0c4716
Use page splitting for large buffers too, to avoid having to store a …
blambov 7ab70b0
Fix test.
blambov 2539b18
Review comments
blambov c01dbb7
Move code unchanged in ChunkCache.java
blambov 5262c59
Fix test compilation
blambov 7f0d6ba
Change sizeOfFile to accept File
blambov 6686f6d
Fix and test chunk cache retention after early open
blambov 462fb34
Provide precise end position for early-open sstables
blambov d755d32
Move cache invalidation FileHandle.Builder creation
blambov 9fc879e
Add comment and remove unused method
blambov 09199b3
Test fix
blambov 3f08d7f
Test fix
blambov ba1232f
Invalidate cache only on request by calling file handle builder's inv…
blambov 226bc15
Revert "Invalidate cache only on request by calling file handle build…
blambov 743e53a
Invalidate both on making SequentialWriter and on global SSTableReade…
blambov 1bbc990
Remove invalidation in SequentialWriter and rely on invalidation duri…
blambov dac75ad
Change order of cache invalidation and obsoletion
blambov 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
In theory I like that option, but I'll note 2 things:
discoverComponentsFor
only include components whose files still exists, but thisinvalidateFileSystemCache
method run afterobsoletion.commit()
inSSTableReader.GlobalTidy.tidy()
and the later deletes the files, so I wonder if this couldn't be a problem in some case (but I'm only so familiar with the whole tidying code so maybe theobsoletion
only do something in cases where nothing can be in caches?discoverComponentsFor
also has the misleading behavior of only including "hard-coded" components, meaning no "custom" ones and so none of the SAI files. To include SAI files we'd probably have to callSSTable.readTOC(desc, false)
, though that implies the TOC is still there so previous point also a question here. I'll note that C* proper never put SAI files into the chunk cache, and that we can override this method in CNDB, so I'm ok if we prefer to stick to hard coded components here and leave the concern for SAI files to CNDB, but figure it was worth mentioning.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.
Changed the test to catch this problem.
Changed the order of cache invalidation and obsoletion to fix it. Looking at relevant code in CC and CNDB, there doesn't appear to be anything that depends on this order.
Kept the discovery's use of
discoverComponentsFor
for now, because that is what the obsoletion code does. How do SAI components get deleted?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.
Honestly, I'm not sure.
StorageAttachedIndexGroup.handleNotification
has a bunch of code that run when it's notified of the removal of a sstable, but look at it right now, I'm not finding where it actually delete the files in the case of, say, a compacted sstable. And SSTableIndex has a comment that says it's happening inLogTransaction
, but I'm not sure how given the tidier...@jasonstack do you know off the top of your head?