File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -439,13 +439,15 @@ def join_group
439
439
if old_generation_id && @group . generation_id != old_generation_id + 1
440
440
# We've been out of the group for at least an entire generation, no
441
441
# sense in trying to hold on to offset data
442
+ clear_current_offsets
442
443
@offset_manager . clear_offsets
443
444
else
444
445
# After rejoining the group we may have been assigned a new set of
445
446
# partitions. Keeping the old offset commits around forever would risk
446
447
# having the consumer go back and reprocess messages if it's assigned
447
448
# a partition it used to be assigned to way back. For that reason, we
448
449
# only keep commits for the partitions that we're still assigned.
450
+ clear_current_offsets ( excluding : @group . assigned_partitions )
449
451
@offset_manager . clear_offsets_excluding ( @group . assigned_partitions )
450
452
end
451
453
@@ -532,5 +534,13 @@ def fetch_batches
532
534
def pause_for ( topic , partition )
533
535
@pauses [ topic ] [ partition ]
534
536
end
537
+
538
+ def clear_current_offsets ( excluding : { } )
539
+ @current_offsets . each do |topic , partitions |
540
+ partitions . keep_if do |partition , _ |
541
+ excluding . fetch ( topic , [ ] ) . include? ( partition )
542
+ end
543
+ end
544
+ end
535
545
end
536
546
end
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module Kafka
4
- VERSION = "0.6.8 "
4
+ VERSION = "0.6.10-beta1 "
5
5
end
You can’t perform that action at this time.
0 commit comments