add the version to the index-scheduler snapshots + fix a bug when opening an index scheduler for the first time

This commit is contained in:
Tamo 2025-01-23 00:39:28 +01:00 committed by Louis Dureuil
parent b9e9fc376a
commit 7eb23f73ba
No known key found for this signature in database
4 changed files with 23 additions and 2 deletions

View file

@ -54,8 +54,15 @@ impl Versioning {
let to = (bin_major, bin_minor, bin_patch);
if from != to {
upgrade_index_scheduler(env, from, to)?;
upgrade_index_scheduler(env, &this, from, to)?;
}
// Once we reach this point it means the upgrade process, if there was one is entirely finished
// we can safely say we reached the latest version of the index scheduler
let mut wtxn = env.write_txn()?;
this.set_current_version(&mut wtxn)?;
wtxn.commit()?;
Ok(this)
}
}