Skip to content

Commit fd86561

Browse files
sjuddConvex, Inc.
authored and
Convex, Inc.
committed
Build indexes with too large instead of too old if both are true (#24866)
GitOrigin-RevId: 06f11b4cfaaf40c8cedbaeaa99b62ae7d4d49666
1 parent 7de2464 commit fd86561

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crates/database/src/search_index_worker/flusher.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ impl<RT: Runtime> SearchIndexFlusher<RT> {
177177
let too_large =
178178
(index_size > self.index_size_soft_limit).then_some(BuildReason::TooLarge);
179179

180-
too_old.or(too_large)
180+
// Order matters! Too large is more urgent than too old.
181+
too_large.or(too_old)
181182
},
182183
};
183184
if let Some(build_reason) = needs_backfill {

crates/database/src/vector_index_worker/flusher.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ impl<RT: Runtime> VectorIndexFlusher<RT> {
211211
}
212212
let too_large =
213213
(index_size > self.index_size_soft_limit).then_some(BuildReason::TooLarge);
214-
too_old.or(too_large)
214+
// Order matters! Too large is more urgent than too old.
215+
too_large.or(too_old)
215216
},
216217
};
217218
if let Some(build_reason) = needs_backfill {

0 commit comments

Comments
 (0)