-
Notifications
You must be signed in to change notification settings - Fork 2k
refactor(cubestore): Replace invalidate_tables_cache flag with generi… #10683
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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.
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.
Minor observation:
self.clone()here clones the entireRocksMetaStoreon every write operation. Since all fields areArc-wrapped this is just reference count bumps (cheap), so it's fine. But it's worth noting that adding#[derive(Clone)]toRocksMetaStorewidens the API surface — if any non-Arcfield is added in the future, this clone could become expensive. A comment or a targetedclone_for_callback()method might make the intent clearer.Also, accessing
self.store.rw_loop_default_cfdirectly (instead of going through a method) requires the field to bepub(crate)— that visibility change is visible inrocks_store.rs. This is fine but creates a tighter coupling between the two modules.Uh oh!
There was an error while loading. Please reload this page.
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.
@claude how will it affect performance? As I can see, this struct containts 4 fields and all of them are under Arc(s), it should clone 4 Arc(s)?
Uh oh!
There was an error while loading. Please reload this page.
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.
Claude finished @ovr's task in 34s —— View job
Performance impact of
self.clone()onRocksMetaStoreYes, you're right.
RocksMetaStorehas exactly 4 fields, allArc-wrapped:So
self.clone()is 4 atomic reference count increments — no heap allocations, no deep copies. EachArc::cloneis a singlefetch_add(or equivalent) on the refcount'sAtomicUsize, typically ~1–3 ns on modern hardware.This happens once per
write_operationcall, well before the actual RocksDB commit (batch_write_rows). RocksDB write + fsync will dominate by 3–6 orders of magnitude (~milliseconds vs. nanoseconds), so the clone cost is immeasurable in practice. No performance concern here.The only theoretical concern with frequent
Arc::cloneacross threads is cache-line contention on the refcount, but since this is on the single RW-loop thread, that doesn't apply either.