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

@ -6,6 +6,7 @@ use time::OffsetDateTime;
use tracing::info;
use crate::queue::TaskQueue;
use crate::versioning::Versioning;
trait UpgradeIndexScheduler {
fn upgrade(&self, env: &Env, wtxn: &mut RwTxn, original: (u32, u32, u32))
@ -15,6 +16,7 @@ trait UpgradeIndexScheduler {
pub fn upgrade_index_scheduler(
env: &Env,
versioning: &Versioning,
from: (u32, u32, u32),
to: (u32, u32, u32),
) -> anyhow::Result<()> {
@ -55,6 +57,7 @@ pub fn upgrade_index_scheduler(
);
let mut wtxn = env.write_txn()?;
upgrade.upgrade(env, &mut wtxn, from)?;
versioning.set_version(&mut wtxn, target)?;
wtxn.commit()?;
current_version = target;
}