Repository navigation
fix : for issue 606 : exclude stale containers from counting and add remove add remove staled work containers function in ProcessingShard - #623
Conversation
…ontainers function in ProcessingShard 3. update changelog
PR Summary
|
|
Edward Vaisman (@eddyv) Thanks a lot for your quick response. Actually we are kind of blocked by this issue, when could we expect this fix merged? |
|
Hey! Allow us some time to do a quick cleanup of some open issues / pr's, and we'll get a new version out asap. Thanks for all the work and effort put into this. |
|
Edward Vaisman (@eddyv) Thank you so much for your help here! We are rolling out parallel consumer to company wide usage, this fix is very crucial for us. |
Description...
This is the fix for #606
The issue happens when rebalancing and partitions got re-assigned:
The
workcontainerwill be marked as stale container since its epoch is mismatch betweenpartitionsAssignmentEpochofPartitionStateandepochfromWorkContainerhttps://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/state/PartitionState.java#L655
inFlightofWorkContainerwill be stay false since they will be filtered to be selected inrunUserFunctioninAbstractParallelEoSStreamProcessorhttps://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/internal/AbstractParallelEoSStreamProcessor.java#L1256
The consumer paused will be triggered since if the number of staled messages are big enough
isSufficientlyLoadedinWorkManagerwill return true.https://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/state/WorkManager.java#L232C1-L232C1
https://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/state/WorkContainer.java#L230
Since the staled
workcontainercan never be selected to run user function. The consumer will be paused infinitely until next-time rebalancinghttps://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/internal/BrokerPollSystem.java#L304
Meanwhile, while
getWorkIfAvailableinWorkManagerwill try to extract active workcontainers, but since the staled containers have the lower offsets, they will be extracted always earlier than the new ones. (if the same partitions have been assigned to the consumer again). Then the new records have no chances to be processed since the it will break out of the while loop.https://github.com/confluentinc/parallel-consumer/blob/master/parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/state/ProcessingShard.java#L134
The proposed solution:
Checklist