From ad18b02d5e1f072cb05b1e5e87efc2fa13b4fc95 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 22 Jan 2025 14:30:14 +0100 Subject: [PATCH] apply all the comments changes --- crates/index-scheduler/src/scheduler/test_failure.rs | 2 +- crates/index-scheduler/src/upgrade/mod.rs | 4 ++-- crates/meilisearch/src/lib.rs | 2 +- crates/meilisearch/tests/upgrade/mod.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/index-scheduler/src/scheduler/test_failure.rs b/crates/index-scheduler/src/scheduler/test_failure.rs index 8307e6aa7..3b895ef2f 100644 --- a/crates/index-scheduler/src/scheduler/test_failure.rs +++ b/crates/index-scheduler/src/scheduler/test_failure.rs @@ -300,7 +300,7 @@ fn upgrade_failure() { handle.advance_one_successful_batch(); snapshot!(snapshot_index_scheduler(&index_scheduler), name: "after_processing_everything"); - // When deleting the single upgrade task it should remove the three associated batches + // When deleting the single upgrade task it should remove the associated batch let _task = index_scheduler .register( KindWithContent::TaskDeletion { diff --git a/crates/index-scheduler/src/upgrade/mod.rs b/crates/index-scheduler/src/upgrade/mod.rs index 981dc8eb8..989ed6ea5 100644 --- a/crates/index-scheduler/src/upgrade/mod.rs +++ b/crates/index-scheduler/src/upgrade/mod.rs @@ -25,11 +25,11 @@ pub fn upgrade_task_queue(tasks_path: &Path, from: (u32, u32, u32)) -> anyhow::R || (major == current_major && minor == current_minor && patch > current_patch) { bail!( - "Database version {major}.{minor}.{patch} is higher than the binary version {current_major}.{current_minor}.{current_patch}. Downgrade is not supported", + "Database version {major}.{minor}.{patch} is higher than the Meilisearch version {current_major}.{current_minor}.{current_patch}. Downgrade is not supported", ); } else if major < 1 || (major == current_major && minor < 12) { bail!( - "Database version {major}.{minor}.{patch} is too old for the experimental dumpless upgrade feature. Please generate a dump using the v{major}.{minor}.{patch} and imports it in the v{current_major}.{current_minor}.{current_patch}", + "Database version {major}.{minor}.{patch} is too old for the experimental dumpless upgrade feature. Please generate a dump using the v{major}.{minor}.{patch} and import it in the v{current_major}.{current_minor}.{current_patch}", ); } else { bail!("Unknown database version: v{major}.{minor}.{patch}"); diff --git a/crates/meilisearch/src/lib.rs b/crates/meilisearch/src/lib.rs index 4f513532b..f7ef01f97 100644 --- a/crates/meilisearch/src/lib.rs +++ b/crates/meilisearch/src/lib.rs @@ -339,7 +339,7 @@ fn open_or_create_database_unchecked( } } -/// Ensures Meilisearch version is compatible with the database, returns an error versions mismatch. +/// Ensures Meilisearch version is compatible with the database, returns an error in case of version mismatch. fn check_version_and_update_task_queue( db_path: &Path, experimental_dumpless_upgrade: bool, diff --git a/crates/meilisearch/tests/upgrade/mod.rs b/crates/meilisearch/tests/upgrade/mod.rs index 83914220a..f26d99402 100644 --- a/crates/meilisearch/tests/upgrade/mod.rs +++ b/crates/meilisearch/tests/upgrade/mod.rs @@ -43,7 +43,7 @@ async fn version_too_old() { std::fs::write(db_path.join("VERSION"), "1.11.9999").unwrap(); let options = Opt { experimental_dumpless_upgrade: true, ..default_settings }; let err = Server::new_with_options(options).await.map(|_| ()).unwrap_err(); - snapshot!(err, @"Database version 1.11.9999 is too old for the experimental dumpless upgrade feature. Please generate a dump using the v1.11.9999 and imports it in the v1.13.0"); + snapshot!(err, @"Database version 1.11.9999 is too old for the experimental dumpless upgrade feature. Please generate a dump using the v1.11.9999 and import it in the v1.13.0"); } #[actix_rt::test] @@ -58,7 +58,7 @@ async fn version_requires_downgrade() { std::fs::write(db_path.join("VERSION"), format!("{major}.{minor}.{patch}")).unwrap(); let options = Opt { experimental_dumpless_upgrade: true, ..default_settings }; let err = Server::new_with_options(options).await.map(|_| ()).unwrap_err(); - snapshot!(err, @"Database version 1.13.1 is higher than the binary version 1.13.0. Downgrade is not supported"); + snapshot!(err, @"Database version 1.13.1 is higher than the Meilisearch version 1.13.0. Downgrade is not supported"); } #[actix_rt::test]