File tree 1 file changed +8
-7
lines changed
ydb/core/kafka_proxy/actors
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -599,18 +599,19 @@ void TKafkaReadSessionActor::HandleReleasePartition(TEvPersQueue::TEvReleasePart
599
599
}
600
600
601
601
NeedRebalance = true ;
602
- size_t partitionToReleaseIndex = 0 ;
603
- size_t i = 0 ;
602
+ ui32 partitionToRelease = 0 ;
603
+ ui32 i = 0 ;
604
604
605
- for (size_t partIndex = 0 ; partIndex < topicPartitionsIt->second .ReadingNow . size (); partIndex++ ) {
606
- if (!topicPartitionsIt->second .ToRelease .contains (partIndex ) && (group == 0 || partIndex + 1 == group)) {
605
+ for (auto curPartition : topicPartitionsIt->second .ReadingNow ) {
606
+ if (!topicPartitionsIt->second .ToRelease .contains (curPartition ) && (group == 0 || curPartition + 1 == group)) {
607
607
++i;
608
- if (rand () % i == 0 ) { // will lead to 1/n probability for each of n partitions
609
- partitionToReleaseIndex = partIndex ;
608
+ if (rand () % i == 0 ) {
609
+ partitionToRelease = curPartition ;
610
610
}
611
611
}
612
612
}
613
- topicPartitionsIt->second .ToRelease .emplace (partitionToReleaseIndex);
613
+
614
+ topicPartitionsIt->second .ToRelease .emplace (partitionToRelease);
614
615
}
615
616
}
616
617
You can’t perform that action at this time.
0 commit comments