From a8de5368e54a7d39914bdfc8b32390e17e18f166 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Sat, 22 Oct 2022 14:57:59 +0200 Subject: [PATCH] fix the index creation in case an index already exists --- index-scheduler/src/batch.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index aaf63ed97..d23a0dbfd 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -661,6 +661,9 @@ impl IndexScheduler { } Batch::IndexCreation { index_uid, primary_key, task } => { let mut wtxn = self.env.write_txn()?; + if self.index_mapper.exists(&wtxn, &index_uid)? { + return Err(Error::IndexAlreadyExists(index_uid)); + } self.index_mapper.create_index(&mut wtxn, &index_uid)?; wtxn.commit()?;