diff --git a/meilisearch-lib/src/index/updates.rs b/meilisearch-lib/src/index/updates.rs index 0ae0aefdb..92d1bdcfe 100644 --- a/meilisearch-lib/src/index/updates.rs +++ b/meilisearch-lib/src/index/updates.rs @@ -202,7 +202,9 @@ impl Index { Ok(UpdateResult::DocumentDeletion { deleted }) } }; - txn.commit()?; + if result.is_ok() { + txn.commit()?; + } result })(); diff --git a/meilisearch-lib/src/index_controller/mod.rs b/meilisearch-lib/src/index_controller/mod.rs index 3ca1d3f3f..050767c0f 100644 --- a/meilisearch-lib/src/index_controller/mod.rs +++ b/meilisearch-lib/src/index_controller/mod.rs @@ -276,8 +276,6 @@ impl IndexController { let index = self.index_resolver.create_index(name, None).await?; let update_result = UpdateMsg::update(&self.update_sender, index.uuid, update).await?; - // ignore if index creation fails now, since it may already have been created - Ok(update_result) } else { Err(IndexResolverError::UnexistingIndex(name).into())