-
Notifications
You must be signed in to change notification settings - Fork 333
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
feat: use cache kv manager for SchemaMetadataManager #5053
feat: use cache kv manager for SchemaMetadataManager #5053
Conversation
…'s heartbeat task • Implement InvalidateSchemaCacheHandler in heartbeat.rs to handle cache invalidation instructions. • Update HeartbeatTask constructor to accept cached_kv_backend and pass it to InvalidateSchemaCacheHandler. • Modify DatanodeBuilder to clone cached_kv_backend when creating schema_metadata_manager. • Refactor MetasrvCacheInvalidator in cache_invalidator.rs to reuse MailboxMessage for broadcasting to different channels.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Lack of prefetching the database ttl option, are you gonna do it in next PR?
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.
Rest LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5053 +/- ##
==========================================
- Coverage 83.93% 83.77% -0.17%
==========================================
Files 1155 1156 +1
Lines 216134 216244 +110
==========================================
- Hits 181418 181156 -262
- Misses 34716 35088 +372 |
…arate module • Extracted InvalidateSchemaCacheHandler and associated tests into a new file cache_invalidator.rs • Removed async_trait and CacheInvalidator related code from heartbeat.rs • Added cache_invalidator module declaration in handler.rs
e576fd2
to
f25fbad
Compare
|
Standardize TODO comment format in CachedKvBackend txn method
@v0y4g3r do we need to prefetch the database options when opening the region in the datanode? |
I think it's ok for the first time? |
@v0y4g3r hmm... just some picky ones would complain about the first time performance. But let's not block this PR, I'll do it. |
* feat: add cache for schema options * fix/use-cache-kv-manager: Add cache invalidation handling to Datanode's heartbeat task • Implement InvalidateSchemaCacheHandler in heartbeat.rs to handle cache invalidation instructions. • Update HeartbeatTask constructor to accept cached_kv_backend and pass it to InvalidateSchemaCacheHandler. • Modify DatanodeBuilder to clone cached_kv_backend when creating schema_metadata_manager. • Refactor MetasrvCacheInvalidator in cache_invalidator.rs to reuse MailboxMessage for broadcasting to different channels. * fix: only remove schema related cache entries * chore: add more tests * fix/use-cache-kv-manager: Moved InvalidateSchemaCacheHandler to a separate module • Extracted InvalidateSchemaCacheHandler and associated tests into a new file cache_invalidator.rs • Removed async_trait and CacheInvalidator related code from heartbeat.rs • Added cache_invalidator module declaration in handler.rs * fix: unit tests * fix/use-cache-kv-manager: Standardize TODO comment format in CachedKvBackend txn method * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs --------- Co-authored-by: jeremyhi <[email protected]>
* feat: add cache for schema options * fix/use-cache-kv-manager: Add cache invalidation handling to Datanode's heartbeat task • Implement InvalidateSchemaCacheHandler in heartbeat.rs to handle cache invalidation instructions. • Update HeartbeatTask constructor to accept cached_kv_backend and pass it to InvalidateSchemaCacheHandler. • Modify DatanodeBuilder to clone cached_kv_backend when creating schema_metadata_manager. • Refactor MetasrvCacheInvalidator in cache_invalidator.rs to reuse MailboxMessage for broadcasting to different channels. * fix: only remove schema related cache entries * chore: add more tests * fix/use-cache-kv-manager: Moved InvalidateSchemaCacheHandler to a separate module • Extracted InvalidateSchemaCacheHandler and associated tests into a new file cache_invalidator.rs • Removed async_trait and CacheInvalidator related code from heartbeat.rs • Added cache_invalidator module declaration in handler.rs * fix: unit tests * fix/use-cache-kv-manager: Standardize TODO comment format in CachedKvBackend txn method * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs * Update src/datanode/src/heartbeat/handler/cache_invalidator.rs --------- Co-authored-by: jeremyhi <[email protected]>
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
Add cache layer for SchemaMetadataManager
Checklist