From 79110bf7b1712916409c30994198d5b421dedc03 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 27 Feb 2025 10:30:28 +0100 Subject: [PATCH] Support dumpless upgrade for all v1.13 patches --- crates/index-scheduler/src/upgrade/mod.rs | 7 ++++--- crates/milli/src/update/upgrade/mod.rs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/index-scheduler/src/upgrade/mod.rs b/crates/index-scheduler/src/upgrade/mod.rs index cfc351b09..017685198 100644 --- a/crates/index-scheduler/src/upgrade/mod.rs +++ b/crates/index-scheduler/src/upgrade/mod.rs @@ -24,10 +24,11 @@ pub fn upgrade_index_scheduler( let current_minor = to.1; let current_patch = to.2; - let upgrade_functions: &[&dyn UpgradeIndexScheduler] = &[&V1_12_ToCurrent {}]; + let upgrade_functions: &[&dyn UpgradeIndexScheduler] = &[&ToCurrentNoOp {}]; let start = match from { (1, 12, _) => 0, + (1, 13, _) => 0, (major, minor, patch) => { if major > current_major || (major == current_major && minor > current_minor) @@ -85,9 +86,9 @@ pub fn upgrade_index_scheduler( } #[allow(non_camel_case_types)] -struct V1_12_ToCurrent {} +struct ToCurrentNoOp {} -impl UpgradeIndexScheduler for V1_12_ToCurrent { +impl UpgradeIndexScheduler for ToCurrentNoOp { fn upgrade( &self, _env: &Env, diff --git a/crates/milli/src/update/upgrade/mod.rs b/crates/milli/src/update/upgrade/mod.rs index 0ed67f2cb..98cad3dad 100644 --- a/crates/milli/src/update/upgrade/mod.rs +++ b/crates/milli/src/update/upgrade/mod.rs @@ -39,9 +39,8 @@ pub fn upgrade( (1, 12, 0..=2) => 0, (1, 12, 3..) => 1, (1, 13, 0) => 2, - (1, 13, 1) => 3, // We must handle the current version in the match because in case of a failure some index may have been upgraded but not other. - (1, 13, _) => return Ok(false), + (1, 13, _) => 3, (major, minor, patch) => { return Err(InternalError::CannotUpgradeToVersion(major, minor, patch).into()) }