Skip to content

[KIP-932] Skip offset filter for share consumers in msgset parser#5354

Merged
Pranav Rathi (pranavrth) merged 1 commit intodev_kip-932_queues-for-kafkafrom
dev_kip-932_remove-fetch-pos-from-message-parsing
Mar 13, 2026
Merged

[KIP-932] Skip offset filter for share consumers in msgset parser#5354
Pranav Rathi (pranavrth) merged 1 commit intodev_kip-932_queues-for-kafkafrom
dev_kip-932_remove-fetch-pos-from-message-parsing

Conversation

@pranavrth
Copy link
Member

Share consumers may receive re-delivered records at earlier offsets after RELEASE. The three offset checks in the msgset parser that skip messages where offset < fetch_pos.offset are correct for regular consumers (monotonically increasing offsets) but cause share consumers to drop re-delivered records, resulting in spurious GAP acks.

Add RD_KAFKA_IS_SHARE_CONSUMER guard to all three offset checks so share consumers never skip messages based on offset position.

@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip-932_remove-fetch-pos-from-message-parsing branch from e9cf84e to 8ef7362 Compare March 11, 2026 13:24
…parser

Share consumers may receive re-delivered records at earlier offsets
after RELEASE. The offset checks in the msgset parser that skip
messages where offset < fetch_pos.offset are correct for regular
consumers (monotonically increasing offsets) but cause share consumers
to drop re-delivered records, resulting in spurious GAP acks.

1. Add RD_KAFKA_IS_SHARE_CONSUMER guard to all four offset checks
   (msg_v0_1, msg_v2, msgset_reader_v2, peek_msg_version) so share
   consumers never skip messages based on offset position.

2. Add TODO comments for future investigation of fetch_pos.offset
   handling in share consumers (postproc relative offset fixup,
   fetch_pos update after message delivery, and next_offset outlier
   adjustment).
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip-932_remove-fetch-pos-from-message-parsing branch from 8ef7362 to 9600c85 Compare March 12, 2026 22:21
@pranavrth Pranav Rathi (pranavrth) marked this pull request as ready for review March 13, 2026 07:04
@pranavrth Pranav Rathi (pranavrth) requested a review from a team as a code owner March 13, 2026 07:04
@@ -653,7 +653,8 @@ rd_kafka_msgset_reader_msg_v0_1(rd_kafka_msgset_reader_t *msetr) {
* we cant perform this offset check here
* in that case. */

Choose a reason for hiding this comment

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

Suggested change
* in that case. */
* in that case.
* Share consumers may receive re-delivered records at earlier offsets
* after RELEASE, so skip this check for them.*/

Choose a reason for hiding this comment

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

Or maybe add a TODO to remove this handling after making sure we dont recieve Messages v0 and v1 after broker v4.0

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks Pranav Rathi (@pranavrth) We can do the comment change in another PR

@pranavrth Pranav Rathi (pranavrth) merged commit a380f92 into dev_kip-932_queues-for-kafka Mar 13, 2026
3 checks passed
@pranavrth Pranav Rathi (pranavrth) deleted the dev_kip-932_remove-fetch-pos-from-message-parsing branch March 13, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants