-
Notifications
You must be signed in to change notification settings - Fork 334
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(remote_wal): support persisting per-region unique metadata #2816
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2816 +/- ##
===========================================
- Coverage 84.75% 84.41% -0.35%
===========================================
Files 730 733 +3
Lines 113790 114843 +1053
===========================================
+ Hits 96445 96947 +502
- Misses 17345 17896 +551 |
fn region_meta_value_decoder(kv: KeyValue) -> Result<((), RegionMetaValue)> { | ||
let value = RegionMetaValue::try_from_raw_value(&kv.value)?; | ||
Ok(((), value)) | ||
} |
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.
It seems like it always allocates a new function.
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.
@WenyXu Moved the function outside.
// TODO(niebayes): to be removed when `Kafka Remote Wal` is merged. | ||
pub type KafkaTopic = String; |
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.
Question: so what it should be🥲
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.
Could be WalTopic
.
#[derive(Clone)] | ||
pub struct RegionMeta { | ||
region_id: RegionId, | ||
topic: Option<KafkaTopic>, |
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 think wal_topic
is more meaningful. If you agree, please rename all places that use "topic" in this file.
// TODO(niebayes): to be removed when `Kafka Remote Wal` is merged. | ||
pub type KafkaTopic = String; |
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.
Could be WalTopic
.
Closed for now and maybe reopened in the future. |
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
Support persisting per-region unique metadata to kv backend through the
RegionMetadataManager
in theTableMetadataManager
.This feature is currently to support persisting the allocated kafka topic for each region. Meta srv now is able to store per-region topics in the kv backend while handling create table requests. Datanode now is able to retrieve the stored per-region topics while re-opening regions for a table during initializing a region server.
Checklist
Refer to a related PR or issue link (optional)