From 771fe5f994b4d872b2f4ef99323e2934388dcb6c Mon Sep 17 00:00:00 2001 From: Rob Meng Date: Wed, 24 Jan 2024 19:04:08 -0500 Subject: [PATCH] fix: latent bug in index append (#1865) this is a latent bug that only happens when there is concurrent: * compact WITH index remap, and * index append because compact can reserve fragment ids and a smaller fragment id can now show up in a later commit. By calling `push`, the new fragment with smaller id is never added to the bitmap --- rust/lance/src/index/append.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/lance/src/index/append.rs b/rust/lance/src/index/append.rs index 453478f6ed..22a6aeeedc 100644 --- a/rust/lance/src/index/append.rs +++ b/rust/lance/src/index/append.rs @@ -85,7 +85,7 @@ pub async fn merge_indices<'a>( frag_bitmap.extend(idx.fragment_bitmap.as_ref().unwrap().iter()); }); unindexed.iter().for_each(|frag| { - frag_bitmap.push(frag.id as u32); + frag_bitmap.insert(frag.id as u32); }); let (new_uuid, indices_merged) = match indices[0].index_type() {