-
Notifications
You must be signed in to change notification settings - Fork 419
feat: gc worker heartbeat instruction #7118
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: discord9 <[email protected]>
Signed-off-by: discord9 <[email protected]>
fa0c303
to
deaf5d5
Compare
Signed-off-by: discord9 <[email protected]>
pub fn into_extensions(&self, extensions: &mut std::collections::HashMap<String, Vec<u8>>) { | ||
let bytes = serde_json::to_vec(self).unwrap_or_default(); | ||
extensions.insert(Self::GC_STAT_KEY.to_string(), bytes); | ||
} | ||
|
||
pub fn from_extensions( | ||
extensions: &std::collections::HashMap<String, Vec<u8>>, | ||
) -> Option<Self> { | ||
extensions | ||
.get(Self::GC_STAT_KEY) | ||
.and_then(|bytes| serde_json::from_slice(bytes).ok()) | ||
} | ||
} |
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.
How's the safety to ignore the serde errors(using default and none)?
get_file_refs: GetFileRefs, | ||
) -> Option<InstructionReply> { | ||
let region_server = self.region_server; | ||
info!("Getting mito Engine"); |
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.
seems like a meaningless log
error: Some("MitoEngine not found".to_string()), | ||
})); | ||
}; | ||
info!( |
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.
info!( | |
debug!( |
gc_regions: GcRegions, | ||
) -> Option<InstructionReply> { | ||
let region_ids = gc_regions.regions.clone(); | ||
info!("Received gc regions instruction: {:?}", region_ids); |
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.
info!("Received gc regions instruction: {:?}", region_ids); | |
debug!("Received gc regions instruction: {:?}", region_ids); |
let region_ids = gc_regions.regions.clone(); | ||
info!("Received gc regions instruction: {:?}", region_ids); | ||
|
||
let mut table_id = None; |
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.
Seems this table_id
is useless?
| ParseAddr { .. } | ||
| TomlFormat { .. } => StatusCode::InvalidArguments, | ||
| TomlFormat { .. } | ||
| InvalidGcArgs { .. } => StatusCode::InvalidArguments, |
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 remember InvalidArguments
is for hinting user. But InvalidGcArgs
is produced by us, so it should be "internal".
|
||
#[snafu(display("Failed to run gc for mito engine"))] | ||
GcMitoEngine { | ||
region_id: RegionId, |
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.
this should be presented in the error message, otherwise why carry it
ref_files.extend(files); | ||
} | ||
} | ||
info!("Unfiltered ref files: {:?}", ref_files); |
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.
info!("Unfiltered ref files: {:?}", ref_files); | |
debug!("Unfiltered ref files: {:?}", ref_files); |
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.
please check other places that info logs are too verbose
.iter() | ||
.filter(|file_id| !in_use_filenames.contains(*file_id)) | ||
.copied() | ||
.copied() |
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.
why copy twice
.copied() |
/// ``` | ||
#[derive(Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] | ||
pub struct RegionId(u64); | ||
pub struct RegionId(#[serde(deserialize_with = "str_or_u64")] u64); |
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.
When is region id being serialized as string at the first place?
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?
as title, related instructions for running gc worker
PR Checklist
Please convert it to a draft if some of the following conditions are not met.