From 9ea759ca688bfa15c0f4c0fc092e87068f51cb70 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 20 Nov 2026 06:01:08 -0800 Subject: [PATCH] lance worker: a withdrawal recovers interrupted adds first An add whose commit overwrote another key's request and stopped before setting it again hides that request. A withdrawal of it then found nothing to do, and the add's later recovery brought the request back. request_removal now recovers such adds before it decides. Co-Authored-By: Claude Opus 5.5 --- seaweed-worker/crates/lance/src/metadata_index.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/seaweed-worker/crates/lance/src/metadata_index.rs b/seaweed-worker/crates/lance/src/metadata_index.rs index 61cadf63c4..38a966d6ef 100644 --- a/seaweed-worker/crates/lance/src/metadata_index.rs +++ b/seaweed-worker/crates/lance/src/metadata_index.rs @@ -276,6 +276,11 @@ pub async fn request(dataset: &mut Dataset, key: &str) -> Result<()> { /// so queries stop using it, and the worker removes it. A key not indexed /// needs nothing, so asking again is done. pub async fn request_removal(dataset: &mut Dataset, key: &str) -> Result<()> { + // An add that stopped before setting again what it overwrote may hide + // this key's request, which its recovery would bring back later. + for added in keys_of(dataset) { + recover_add(dataset, &added).await?; + } if let Some(column) = keys_of(dataset).into_iter().find(|k| k.key == key) { if column.state != Some(State::Off) { set_state(dataset, &column.column, State::Off).await?;