-
Notifications
You must be signed in to change notification settings - Fork 390
feat: add RegionId
to FileId
#6410
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: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
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.
Pull Request Overview
This PR refactors stale manifest structures and updates file identification by adding a RegionId field to the FileId struct. Key changes include removing the old manifest module, updating API paths and file handling functions to use table_dir instead of region_dir, and replacing FileId::random() calls with FileId::new(region_id).
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/store-api/src/manifest.rs | Removed stale manifest module |
src/store-api/src/lib.rs | Commented out manifest module and added manifest version constants |
src/mito2/* | Updated API and tests to use table_dir and new FileId creation methods |
Comments suppressed due to low confidence (2)
src/mito2/src/sst/file.rs:48
- The doc comment for FileId declares its string representation as
{region_id}_{uuid}
but the Display implementation formats it as{region_name}/{uuid}
. Please update the documentation or the implementation for consistency.
///
src/mito2/src/sst/file.rs:575
- The test 'test_file_id_serialization' is currently marked as ignored with a TODO comment. It is recommended to either fix or remove the test to ensure adequate test coverage for FileId serialization.
#[ignore = "TODO: fix this test or remove it"]
RegionId
to FileId
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
I'm going to refactor this by adding another struct with region id and file id. Adding region id to @v0y4g3r Do you have any suggestions for this new struct? |
➕1️⃣ for |
- FileId still only consist of an uuid - PathProvider accepts RegionFileId and doesn't need to keep a region id in it - All Index applier takes RegionFileId and respects the region id in the RegionFileId - FileMeta can still derive Serialize/Deserialize - Refactor the CacheManager to accept RegionFileId Signed-off-by: evenyag <[email protected]>
Done in a3bfb58 I also modified the code that uses both region id and file id to respect the region id in the |
dc11254
to
0b23527
Compare
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Move region_dir_from_table_dir to mito and use join_dir internally Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
We can get table_dir and path_type from the access layer Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
0b23527
to
31eceb5
Compare
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
We have to introduce an enum pub enum PathType {
/// A bare path - the original path of an engine.
///
/// The path prefix is `{table_dir}/{table_id}_{region_sequence}/`.
Bare,
/// A path for the data region of a metric engine table.
///
/// The path prefix is `{table_dir}/{table_id}_{region_sequence}/data/`.
Data,
/// A path for the metadata region of a metric engine table.
///
/// The path prefix is `{table_dir}/{table_id}_{region_sequence}/metadata/`.
Metadata,
} I added the Note that when opening a region in the metric engine, we still specify We still need to rename other region_dir fields in the mito crate to table_dir later. This PR is already too large, so I didn't do this refactoring. |
Signed-off-by: evenyag <[email protected]>
9c509eb
to
3fc2e64
Compare
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Lots of conflicts @waynexia |
I'll address them later. It's ok to review before addressing the conflicts. |
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: evenyag <[email protected]>
Signed-off-by: Ruihang Xia [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 a
RegionId
field toFileId
structPR Checklist
Please convert it to a draft if some of the following conditions are not met.