From a42390353d1250a3f772e7326990671a6668ab29 Mon Sep 17 00:00:00 2001 From: Guga Cavalieri Date: Tue, 8 Nov 2022 22:14:17 -0700 Subject: [PATCH 1/3] Fix Dumps ordering problem when writing --- replibyte/src/datastore/local_disk.rs | 4 ++-- replibyte/src/datastore/s3.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/replibyte/src/datastore/local_disk.rs b/replibyte/src/datastore/local_disk.rs index 6825c67c..0fee1afc 100644 --- a/replibyte/src/datastore/local_disk.rs +++ b/replibyte/src/datastore/local_disk.rs @@ -124,7 +124,7 @@ impl Datastore for LocalDisk { let data_size = data.len(); let dump_dir_path = format!("{}/{}", self.dir, self.dump_name); - let dump_file_path = format!("{}/{}.dump", dump_dir_path, file_part); + let dump_file_path = format!("{}/{:02}.dump", dump_dir_path, file_part); // create the dump directory if needed DirBuilder::new() @@ -314,7 +314,7 @@ mod tests { // part 1 of dump should exists assert!(Path::new(&format!( - "{}/{}/1.dump", + "{}/{}/01.dump", dir.path().to_str().unwrap(), dump.directory_name )) diff --git a/replibyte/src/datastore/s3.rs b/replibyte/src/datastore/s3.rs index faddb4c6..e6970201 100644 --- a/replibyte/src/datastore/s3.rs +++ b/replibyte/src/datastore/s3.rs @@ -314,9 +314,9 @@ fn write_objects( }; let data_size = data.len(); - let key = format!("{}/{}.dump", root_key, file_part); + let key = format!("{}/{:02}.dump", root_key, file_part); - info!("upload object '{}' part {} on", key.as_str(), file_part); + info!("upload object '{}' part {:02} on", key.as_str(), file_part); let _ = create_object(client, bucket, key.as_str(), data)?; From aa1528d06db973130201329a705b1b4e7b094a48 Mon Sep 17 00:00:00 2001 From: Guga Cavalieri Date: Wed, 9 Nov 2022 18:42:43 -0700 Subject: [PATCH 2/3] Use 4 digits when outputting dumps --- replibyte/src/datastore/local_disk.rs | 4 ++-- replibyte/src/datastore/s3.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/replibyte/src/datastore/local_disk.rs b/replibyte/src/datastore/local_disk.rs index 0fee1afc..c2c9d938 100644 --- a/replibyte/src/datastore/local_disk.rs +++ b/replibyte/src/datastore/local_disk.rs @@ -124,7 +124,7 @@ impl Datastore for LocalDisk { let data_size = data.len(); let dump_dir_path = format!("{}/{}", self.dir, self.dump_name); - let dump_file_path = format!("{}/{:02}.dump", dump_dir_path, file_part); + let dump_file_path = format!("{}/{:04}.dump", dump_dir_path, file_part); // create the dump directory if needed DirBuilder::new() @@ -314,7 +314,7 @@ mod tests { // part 1 of dump should exists assert!(Path::new(&format!( - "{}/{}/01.dump", + "{}/{}/0001.dump", dir.path().to_str().unwrap(), dump.directory_name )) diff --git a/replibyte/src/datastore/s3.rs b/replibyte/src/datastore/s3.rs index e6970201..32a7752b 100644 --- a/replibyte/src/datastore/s3.rs +++ b/replibyte/src/datastore/s3.rs @@ -314,9 +314,9 @@ fn write_objects( }; let data_size = data.len(); - let key = format!("{}/{:02}.dump", root_key, file_part); + let key = format!("{}/{:04}.dump", root_key, file_part); - info!("upload object '{}' part {:02} on", key.as_str(), file_part); + info!("upload object '{}' part {:04} on", key.as_str(), file_part); let _ = create_object(client, bucket, key.as_str(), data)?; From 6a79e81620f5cc8e2a62f7ff4957e95d679ee53e Mon Sep 17 00:00:00 2001 From: Guga Cavalieri Date: Sun, 20 Nov 2022 13:01:53 -0700 Subject: [PATCH 3/3] trigger-ci