diff --git a/crates/index-scheduler/src/error.rs b/crates/index-scheduler/src/error.rs index e9fa9bb59..f6ee1f685 100644 --- a/crates/index-scheduler/src/error.rs +++ b/crates/index-scheduler/src/error.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use meilisearch_types::batches::BatchId; use meilisearch_types::error::{Code, ErrorCode}; use meilisearch_types::tasks::{Kind, Status}; -use meilisearch_types::{heed, milli, versioning}; +use meilisearch_types::{heed, milli}; use thiserror::Error; use crate::TaskId; diff --git a/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs b/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs index e01958902..0c3af1386 100644 --- a/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs +++ b/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs @@ -2,7 +2,6 @@ use meilisearch_types::{ milli, milli::progress::{Progress, VariableNameStep}, tasks::{KindWithContent, Status, Task}, - versioning::{VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH}, }; use crate::{processing::UpgradeDatabaseProgress, Error, IndexScheduler, Result}; @@ -30,7 +29,8 @@ impl IndexScheduler { indexes.len() as u32, )); let index = self.index(uid)?; - milli::update::upgrade::upgrade(&index, from, progress.clone()); + milli::update::upgrade::upgrade(&index, from, progress.clone()) + .map_err(|e| Error::from_milli(e, Some(uid.to_string())))?; } for task in tasks.iter_mut() { diff --git a/crates/milli/src/error.rs b/crates/milli/src/error.rs index 4ed526324..b5bcc6fba 100644 --- a/crates/milli/src/error.rs +++ b/crates/milli/src/error.rs @@ -288,7 +288,7 @@ and can not be more than 511 bytes.", .document_id.to_string() DocumentEmbeddingError(String), #[error("Upgrade could not be processed because v{0}.{1}.{2} of the database is too old. Please re-open the v{0}.{1}.{2} and use a dump to upgrade your version. The oldest version meilisearch can upgrade from is v1.12.0.")] TooOldForUpgrade(u32, u32, u32), - #[error("Upgrade could not be processed because the database version (v{0}.{1}.{2}) is newer than the targeted version (v{}.{}.{})", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)] + #[error("Upgrade could not be processed because the database version (v{0}.{1}.{2}) is newer than the targeted version (v{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_PATCH})")] CannotDowngrade(u32, u32, u32), #[error("Cannot upgrade to unknown version v{0}.{1}.{2}.")] CannotUpgradeToUnknownVersion(u32, u32, u32), diff --git a/crates/milli/src/heed_codec/version.rs b/crates/milli/src/heed_codec/version.rs index d63ae91d4..ce9724889 100644 --- a/crates/milli/src/heed_codec/version.rs +++ b/crates/milli/src/heed_codec/version.rs @@ -8,8 +8,7 @@ const VERSION_SIZE: usize = std::mem::size_of::() * 3; #[derive(thiserror::Error, Debug)] #[error( - "Could not decode the version: Expected {} bytes but instead received {0} bytes", - VERSION_SIZE + "Could not decode the version: Expected {VERSION_SIZE} bytes but instead received {0} bytes" )] pub struct DecodeVersionError(usize);