@@ -232,7 +232,8 @@ async fn delete_splits(
232
232
}
233
233
}
234
234
} )
235
- . buffer_unordered ( 10 ) ;
235
+ . buffer_unordered ( get_index_gc_concurrency ( ) . unwrap_or ( 10 ) ) ;
236
+
236
237
let mut error_encountered = false ;
237
238
while let Some ( delete_split_result) = delete_split_from_index_res_stream. next ( ) . await {
238
239
match delete_split_result {
@@ -298,15 +299,20 @@ async fn list_splits_metadata(
298
299
/// In order to avoid hammering the load on the metastore, we can throttle the rate of split
299
300
/// deletion by setting this environment variable.
300
301
fn get_maximum_split_deletion_rate_per_sec ( ) -> Option < usize > {
301
- static MAXIMUM_SPLIT_DELETION_RATE_PER_SEC : std:: sync:: OnceLock < Option < usize > > =
302
- OnceLock :: new ( ) ;
303
- * MAXIMUM_SPLIT_DELETION_RATE_PER_SEC . get_or_init ( || {
302
+ static MAX_SPLIT_DELETION_RATE_PER_SEC : OnceLock < Option < usize > > = OnceLock :: new ( ) ;
303
+ * MAX_SPLIT_DELETION_RATE_PER_SEC . get_or_init ( || {
304
304
quickwit_common:: get_from_env_opt :: < usize > ( "QW_MAX_SPLIT_DELETION_RATE_PER_SEC" )
305
305
} )
306
306
}
307
307
308
+ fn get_index_gc_concurrency ( ) -> Option < usize > {
309
+ static INDEX_GC_CONCURRENCY : OnceLock < Option < usize > > = OnceLock :: new ( ) ;
310
+ * INDEX_GC_CONCURRENCY
311
+ . get_or_init ( || quickwit_common:: get_from_env_opt :: < usize > ( "QW_INDEX_GC_CONCURRENCY" ) )
312
+ }
313
+
308
314
/// Removes any splits marked for deletion which haven't been
309
- /// updated after `updated_before_timestamp` in batches of 1000 splits.
315
+ /// updated after `updated_before_timestamp` in batches of 1,000 splits.
310
316
///
311
317
/// Only splits from index_uids in the `storages` map will be deleted.
312
318
///
@@ -463,7 +469,7 @@ pub async fn delete_splits_from_storage_and_metastore(
463
469
error ! (
464
470
error=?bulk_delete_error. error,
465
471
index_id=index_uid. index_id,
466
- "Failed to delete split file(s) {:?} from storage. " ,
472
+ "failed to delete split file(s) {:?} from storage" ,
467
473
PrettySample :: new( & failed_split_paths, 5 ) ,
468
474
) ;
469
475
storage_error = Some ( bulk_delete_error) ;
0 commit comments