-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
RemoteCompaction support Fallback to local compaction #8709
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7aa35a0
RemoteCompaction support Fallback to local compaction
jay-zhuang deba8de
review feedbacks
jay-zhuang c74cea5
Add HISTORY
jay-zhuang ec7334f
Fix a test issue
jay-zhuang c707c18
update test
jay-zhuang 6fa2ecf
fix build
jay-zhuang 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
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
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.
Do we expect some stat to have increased on primary side , like COMPACTION_BYTES_READ?
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.
I added check for
statistics->getTickerCount(COMPACTION_KEY_DROP_NEWER_ENTRY)
, which shows the updated keys.Not sure how we could check
COMPACTION_BYTES_READ
, seems we need to doGetThreadList()
and check?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.
Sounds good, thanks. COMPACTION_BYTES_READ is also a stat you can get from
statistics->getTickerCount()
.Is this the fix?
If no compaction happened on the primary would that still pass because the ticker stat would equal primary_new_key?
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.
my mistake, it should ASSERT_GT not GE.
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.
Sorry for the confusion. COMPACT_READ_BYTES is the name of the ticker stat as we discussed.
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.
make sense.
But currently, we record the compact_read/write_bytes on both remote and local side (which should be fixed):
https://github.com/facebook/rocksdb/blob/9dd09dc4f302f2de5a2c34ab2cbc4c393b4503cc/db/compaction/compaction_job.cc#L1117-L1118
I think we did that at the beginning just to make sure with/without remote compaction it behaves exactly the same, which it's not necessary. I'll fix that and maybe add new metrics for remote compaction if we need record that.
On the other hand, I think because of the how the test CompactionService is implemented (which runs the remote compaction with the local compaction thread), the read/write bytes is still counted locally. I think we may need to update the test CompactionService, maybe to a separate process (ideally).
Anyway, I'm not going to fix it in this diff. Will follow up on that.