From 2b154524bbeef1a51dc9726545c0e59842803672 Mon Sep 17 00:00:00 2001 From: Marin Postma Date: Tue, 13 Apr 2021 18:11:37 +0200 Subject: [PATCH] fix filtered out pending update --- .../index_controller/update_actor/update_store.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meilisearch-http/src/index_controller/update_actor/update_store.rs b/meilisearch-http/src/index_controller/update_actor/update_store.rs index c0c76283c..a8f5fe800 100644 --- a/meilisearch-http/src/index_controller/update_actor/update_store.rs +++ b/meilisearch-http/src/index_controller/update_actor/update_store.rs @@ -331,7 +331,18 @@ where .pending_meta .prefix_iter(&rtxn, index_uuid.as_bytes())? .filter_map(Result::ok) - .filter_map(|(_, p)| (Some(p.id()) != processing.as_ref().map(|p| p.1.id())).then(|| p)) + .filter_map(|(_, p)| { + if let Some((uuid, ref processing)) = *processing { + // Filter out the currently processing update if it is from this index. + if uuid == index_uuid && processing.id() == p.id() { + None + } else { + Some(p) + } + } else { + Some(p) + } + }) .map(UpdateStatus::from); updates.extend(pending);