@@ -455,17 +455,17 @@ where
455
455
let req = CompactReq {
456
456
shard_id,
457
457
desc : req. desc ,
458
- inputs : req
459
- . inputs
460
- . into_iter ( )
461
- . map ( |b| Arc :: unwrap_or_clone ( b. batch ) )
462
- . collect ( ) ,
458
+ inputs : req. inputs ,
463
459
} ;
464
- let parts = req. inputs . iter ( ) . map ( |x| x. part_count ( ) ) . sum :: < usize > ( ) ;
460
+ let parts = req
461
+ . inputs
462
+ . iter ( )
463
+ . map ( |x| x. batch . part_count ( ) )
464
+ . sum :: < usize > ( ) ;
465
465
let bytes = req
466
466
. inputs
467
467
. iter ( )
468
- . map ( |x| x. encoded_size_bytes ( ) )
468
+ . map ( |x| x. batch . encoded_size_bytes ( ) )
469
469
. sum :: < usize > ( ) ;
470
470
let start = Instant :: now ( ) ;
471
471
info ! (
@@ -743,14 +743,18 @@ pub async fn dangerous_force_compaction_and_break_pushdown<K, V, T, D>(
743
743
let ( reqs, mut maintenance) = machine. spine_exert ( fuel) . await ;
744
744
for req in reqs {
745
745
info ! (
746
- "force_compaction {} {} compacting {} batches in {} parts totaling {} bytes: lower={:?} upper={:?} since={:?}" ,
746
+ "force_compaction {} {} compacting {} batches in {} parts with {} runs totaling {} bytes: lower={:?} upper={:?} since={:?}" ,
747
747
machine. applier. shard_metrics. name,
748
748
machine. applier. shard_metrics. shard_id,
749
749
req. inputs. len( ) ,
750
- req. inputs. iter( ) . flat_map( |x| & x. parts) . count( ) ,
750
+ req. inputs. iter( ) . flat_map( |x| & x. batch. parts) . count( ) ,
751
+ req. inputs
752
+ . iter( )
753
+ . map( |x| x. batch. runs( ) . count( ) )
754
+ . sum:: <usize >( ) ,
751
755
req. inputs
752
756
. iter( )
753
- . flat_map( |x| & x. parts)
757
+ . flat_map( |x| & x. batch . parts)
754
758
. map( |x| x. encoded_size_bytes( ) )
755
759
. sum:: <usize >( ) ,
756
760
req. desc. lower( ) . elements( ) ,
@@ -795,13 +799,18 @@ pub async fn dangerous_force_compaction_and_break_pushdown<K, V, T, D>(
795
799
796
800
// NB: This check is intentionally at the end so that it's safe to call
797
801
// this method in a loop.
798
- let num_batches = machine. applier . all_batches ( ) . len ( ) ;
799
- if num_batches < 2 {
802
+ let num_runs: usize = machine
803
+ . applier
804
+ . all_batches ( )
805
+ . iter ( )
806
+ . map ( |x| x. runs ( ) . count ( ) )
807
+ . sum ( ) ;
808
+ if num_runs <= 1 {
800
809
info ! (
801
- "force_compaction {} {} exiting with {} batches " ,
810
+ "force_compaction {} {} exiting with {} runs " ,
802
811
machine. applier. shard_metrics. name,
803
812
machine. applier. shard_metrics. shard_id,
804
- num_batches
813
+ num_runs
805
814
) ;
806
815
return ;
807
816
}
0 commit comments