From 40f8c0d84032212f41be7f2fec52549696b6aa6c Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 20 Jan 2025 11:16:18 +0100 Subject: [PATCH] Remove batch ids on export --- crates/index-scheduler/src/batch.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/index-scheduler/src/batch.rs b/crates/index-scheduler/src/batch.rs index 3d45ce1fe..89c7f6f45 100644 --- a/crates/index-scheduler/src/batch.rs +++ b/crates/index-scheduler/src/batch.rs @@ -819,6 +819,13 @@ impl IndexScheduler { t.started_at = Some(started_at); t.finished_at = Some(finished_at); } + + // Patch the task to remove the batch uid, because as of v1.12.5 batches are not persisted. + // This prevent from referencing *future* batches not actually associated with the task. + // + // See for details. + t.batch_uid = None; + let mut dump_content_file = dump_tasks.push_task(&t.into())?; // 2.1. Dump the `content_file` associated with the task if there is one and the task is not finished yet.