diff options
author | Alex <alex@adnab.me> | 2024-03-08 13:43:42 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-03-08 13:43:42 +0000 |
commit | 2128b5febd97eb6c95e3bdd380dcba39b860c0e3 (patch) | |
tree | f37726dda012541cf8f2be81a0197fdf0b889a8b /src/model/s3/version_table.rs | |
parent | 1ace34adbb05bb10cf7a2c8d0d2b84769ca797df (diff) | |
parent | f537f76681760e9b2b3cc095a6031ebb59ca4733 (diff) | |
download | garage-2128b5febd97eb6c95e3bdd380dcba39b860c0e3.tar.gz garage-2128b5febd97eb6c95e3bdd380dcba39b860c0e3.zip |
Merge pull request 'Remove migration path from Garage v0.5' (#766) from rm-migration into next-0.10
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/766
Diffstat (limited to 'src/model/s3/version_table.rs')
-rw-r--r-- | src/model/s3/version_table.rs | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/src/model/s3/version_table.rs b/src/model/s3/version_table.rs index b4662a55..d611a9e3 100644 --- a/src/model/s3/version_table.rs +++ b/src/model/s3/version_table.rs @@ -11,7 +11,7 @@ use garage_table::*; use crate::s3::block_ref_table::*; -mod v05 { +mod v08 { use garage_util::crdt; use garage_util::data::{Hash, Uuid}; use serde::{Deserialize, Serialize}; @@ -35,7 +35,7 @@ mod v05 { // Back link to bucket+key so that we can figure if // this was deleted later on /// Bucket in which the related object is stored - pub bucket: String, + pub bucket_id: Uuid, /// Key in which the related object is stored pub key: String, } @@ -61,57 +61,6 @@ mod v05 { impl garage_util::migrate::InitialFormat for Version {} } -mod v08 { - use garage_util::crdt; - use garage_util::data::Uuid; - use serde::{Deserialize, Serialize}; - - use super::v05; - - pub use v05::{VersionBlock, VersionBlockKey}; - - /// A version of an object - #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] - pub struct Version { - /// UUID of the version, used as partition key - pub uuid: Uuid, - - // Actual data: the blocks for this version - // In the case of a multipart upload, also store the etags - // of individual parts and check them when doing CompleteMultipartUpload - /// Is this version deleted - pub deleted: crdt::Bool, - /// list of blocks of data composing the version - pub blocks: crdt::Map<VersionBlockKey, VersionBlock>, - /// Etag of each part in case of a multipart upload, empty otherwise - pub parts_etags: crdt::Map<u64, String>, - - // Back link to bucket+key so that we can figure if - // this was deleted later on - /// Bucket in which the related object is stored - pub bucket_id: Uuid, - /// Key in which the related object is stored - pub key: String, - } - - impl garage_util::migrate::Migrate for Version { - type Previous = v05::Version; - - fn migrate(old: v05::Version) -> Version { - use garage_util::data::blake2sum; - - Version { - uuid: old.uuid, - deleted: old.deleted, - blocks: old.blocks, - parts_etags: old.parts_etags, - bucket_id: blake2sum(old.bucket.as_bytes()), - key: old.key, - } - } - } -} - pub(crate) mod v09 { use garage_util::crdt; use garage_util::data::Uuid; |