File tree 1 file changed +14
-1
lines changed
src/meta/src/hummock/manager
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,7 @@ impl HummockManager {
444
444
Ok ( count)
445
445
}
446
446
447
+ let mut batch = vec ! [ ] ;
447
448
for ( table_id, cg_id, committed_epoch) in tables_to_commit {
448
449
if !select_groups. contains ( cg_id) {
449
450
continue ;
@@ -454,8 +455,20 @@ impl HummockManager {
454
455
table_id : Set ( table_id. table_id . into ( ) ) ,
455
456
version_id : Set ( version_id. try_into ( ) . unwrap ( ) ) ,
456
457
} ;
458
+ batch. push ( m) ;
459
+ // Use the same batch size as hummock_time_travel_sst_info_insert_batch_size.
460
+ if batch. len ( ) >= self . env . opts . hummock_time_travel_sst_info_insert_batch_size {
461
+ // There should be no conflict rows.
462
+ hummock_epoch_to_version:: Entity :: insert_many ( std:: mem:: take ( & mut batch) )
463
+ . do_nothing ( )
464
+ . exec ( txn)
465
+ . await ?;
466
+ }
467
+ }
468
+ if !batch. is_empty ( ) {
457
469
// There should be no conflict rows.
458
- hummock_epoch_to_version:: Entity :: insert ( m)
470
+ hummock_epoch_to_version:: Entity :: insert_many ( batch)
471
+ . do_nothing ( )
459
472
. exec ( txn)
460
473
. await ?;
461
474
}
You can’t perform that action at this time.
0 commit comments