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
ISSUE-4241: version of storage layout #4244
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/databend/databend/EMFak54XKZ4RKqCaNhj88i8C57qh [Deployment for 4e90427 canceled] |
Thanks for the contribution! Please review the labels and make any necessary changes. |
@@ -1,4 +1,4 @@ | |||
// Copyright 2021 Datafuse Labs. | |||
// Copyright 2022 Datafuse Labs. |
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.
See that we make a new v1
directory for the v1 version, if we only add a new field of the block layout, how about the new directory?
v2/block.rs or ?
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.
yeah, there is another versioned mod (but is v0 :D). will be pushed 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.
😎
let snapshot = match self.read(loc, None, ver).await { | ||
Ok(s) => s, | ||
Err(e) => { | ||
if e.code() == ErrorCode::dal_path_not_found_code() { |
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.
Reminder for myself: #4575
We need to implement From opendal::error::Error so that we can avoid code like this.
use crate::storages::fuse::meta::v0; | ||
use crate::storages::fuse::meta::v1; | ||
|
||
pub const CURRNET_SEGMETN_VERSION: u64 = v1::SegmentInfo::VERSION; |
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.
Guess CURRNET_*
should be CURRENT_*
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.
Technically, these constants could be removed. these are the legacy code to ensure that for each type of table meta type (e.g. SegmentInfo), there is only one numeric number has been bound to it (the impl Version<n> for SegmentInfo
)
impl SnapshotLocationCreator for SnapshotVersion { | ||
fn create(&self, id: &Uuid, prefix: impl AsRef<str>) -> String { | ||
match self { | ||
SnapshotVersion::V0(_) => { |
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.
👍
Thank you!
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 hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
Issues trying to be addressed in the PR:
which marks the current format version of the snapshot inside meta-server.
Changelog
Related Issues
Fixes #4243
Test Plan
Unit Tests
Stateless Tests