Refer to v1.19 and remove arroy -> hannoy dumpless upgrade

This commit is contained in:
Louis Dureuil
2025-09-01 12:10:13 +02:00
parent 381de52fc5
commit 231f86decf
4 changed files with 20 additions and 60 deletions

View File

@ -1,4 +1,3 @@
mod new_hannoy;
mod v1_12;
mod v1_13;
mod v1_14;
@ -6,7 +5,6 @@ mod v1_15;
mod v1_16;
use heed::RwTxn;
use new_hannoy::Latest_V1_18_New_Hannoy;
use v1_12::{V1_12_3_To_V1_13_0, V1_12_To_V1_12_3};
use v1_13::{V1_13_0_To_V1_13_1, V1_13_1_To_Latest_V1_13};
use v1_14::Latest_V1_13_To_Latest_V1_14;
@ -38,7 +36,7 @@ const UPGRADE_FUNCTIONS: &[&dyn UpgradeIndex] = &[
&Latest_V1_14_To_Latest_V1_15 {},
&Latest_V1_15_To_V1_16_0 {},
&ToTargetNoOp { target: (1, 18, 0) },
&Latest_V1_18_New_Hannoy {},
&ToTargetNoOp { target: (1, 19, 0) },
// This is the last upgrade function, it will be called when the index is up to date.
// any other upgrade function should be added before this one.
&ToCurrentNoOp {},
@ -68,8 +66,7 @@ const fn start(from: (u32, u32, u32)) -> Option<usize> {
(1, 15, _) => function_index!(6),
(1, 16, _) | (1, 17, _) => function_index!(7),
(1, 18, _) => function_index!(8),
(1, 19, _) => function_index!(8),
(1, 22, _) => function_index!(9),
(1, 19, _) => function_index!(9),
// We deliberately don't add a placeholder with (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH) here to force manually
// considering dumpless upgrade.
(_major, _minor, _patch) => return None,

View File

@ -1,37 +0,0 @@
use heed::RwTxn;
use super::UpgradeIndex;
use crate::progress::Progress;
use crate::vector::VectorStore;
use crate::{Index, Result};
#[allow(non_camel_case_types)]
pub(super) struct Latest_V1_18_New_Hannoy();
impl UpgradeIndex for Latest_V1_18_New_Hannoy {
fn upgrade(
&self,
wtxn: &mut RwTxn,
index: &Index,
_original: (u32, u32, u32),
progress: Progress,
) -> Result<bool> {
let embedding_configs = index.embedding_configs();
let backend = index.get_vector_store(wtxn)?;
for config in embedding_configs.embedding_configs(wtxn)? {
// TODO use the embedder name to display progress
/// REMOVE THIS FILE, IMPLEMENT CONVERSION AS A SETTING CHANGE
let quantized = config.config.quantized();
let embedder_id = embedding_configs.embedder_id(wtxn, &config.name)?.unwrap();
let mut vector_store =
VectorStore::new(backend, index.vector_store, embedder_id, quantized);
vector_store.change_backend(wtxn, progress.clone())?;
}
Ok(false)
}
fn target_version(&self) -> (u32, u32, u32) {
(1, 22, 0)
}
}