node-rdkafka icon indicating copy to clipboard operation
node-rdkafka copied to clipboard

Add cooperative rebalance support

Open thynson opened this issue 4 years ago • 18 comments

thynson avatar Aug 11 '21 15:08 thynson

incremetalAssign and incrementalUnassign are already exposed to Node, and anyone can call them in a rebalance callback when partition.assignment.strategy is cooperative-sticky. Does the KafkaConsumer need to be also modified to provide a default rebalance_cb for cooperative-sticky?

thynson avatar Aug 11 '21 15:08 thynson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 08 '22 22:01 stale[bot]

I would love to see this feature added. 🙏

As far as I can tell, the cooperative-sticky partition assignment strategy can't work without adding the bindings for incremental assign/unassign.

I've tried but always received the error application *assign() call failed: Changes to the current assignment must be made using incremental_assign() or incremental_unassign() when rebalance protocol type is COOPERATIVE.

@thynson are there any plans to re-open this PR?

johncsnyder avatar Mar 05 '22 18:03 johncsnyder

As far as I can tell, the cooperative-sticky partition assignment strategy can't work without adding the bindings for incremental assign/unassign.

They were implemented in this PR, https://github.com/Blizzard/node-rdkafka/pull/907/commits/21a222635127a04904a6f9d97c09edefde30dd87#diff-e574f6617d5a1bd9fb35fab6b02e906b120024e0dcae87b010eed716e23820d4R45, but you need to set partition.assignment.strategy to cooperative-sticky. Or if you're using custom rebalance_cb, call incrementalAssign and incrementalUnassign.

thynson avatar Mar 05 '22 22:03 thynson

@thynson Yeah, I saw, looks great.

Any chance this will be merged into master? I'd prefer not to maintain my own fork.

johncsnyder avatar Mar 06 '22 12:03 johncsnyder

Any chance this will be merged into master? I'd prefer not to maintain my own fork.

If @iradul has time to take a look.

thynson avatar Mar 07 '22 12:03 thynson

Sweet, thanks 🙏

johncsnyder avatar Mar 08 '22 00:03 johncsnyder

@thynson, thank you for the PR

iradul avatar Mar 21 '22 01:03 iradul

I'll try to implement the missing parts, but I'm still busy for some days.

thynson avatar Mar 22 '22 09:03 thynson

Any hope this will get implemented? @thynson :) It would be extremely useful for us

micheleangioni avatar May 04 '22 10:05 micheleangioni

@micheleangioni Did you find a way to solve this? We also really need it @thynson )

neuralspin avatar May 12 '23 09:05 neuralspin

and we need it a lot :)

spalax avatar May 12 '23 09:05 spalax

We are eagerly awaiting this feature 🙏

serj026 avatar May 12 '23 09:05 serj026

we need it also :)

notgosu avatar May 12 '23 09:05 notgosu

It can save the world, great the feature! @micheleangioni

votar1408 avatar May 12 '23 09:05 votar1408

Thanks for the PR. It will significantly reduce our struggling and help us!

I did not have any experience of writing an e2e test for rdkafka. So any help would be great, or I have to take some time to finish the e2e test.

thynson avatar May 12 '23 10:05 thynson