Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug: implement unsigned modulus for partitioning with crc32 hashing #2560

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

csm8118
Copy link
Contributor

@csm8118 csm8118 commented Aug 4, 2023

See #2430 for a discussion of the issue. Relevant items from that issue are copied here for visibility:

Problem Description

There is a difference between how sarama partitions when using the Crc32 hash and what is done in librdkafka (and ruby-kafka). It looks like this issue was reported some time ago but nothing came of it (#1213). The main issue is that librdkafka/ruby-kafka treat the hashed value from Crc32 as an unsigned value, whereas sarama casts it to a signed value. However, when using other hashing algorithms, the signed cast is necessary.

@dnwe dnwe force-pushed the unsigned-crc32-mod-partitioning branch from f4fdb32 to 1e3e096 Compare August 5, 2023 14:04
@dnwe dnwe added the fix label Aug 5, 2023
Copy link
Collaborator

@dnwe dnwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 👍🏻

@dnwe dnwe merged commit 29487f1 into IBM:main Aug 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants