Skip to content

Store offset commit metadata when calling rd_kafka_offsets_store#4084

Merged
Emanuele Sabellico (emasab) merged 9 commits intoconfluentinc:feature/store-offsets-metadatafrom
mathispesch:store-offsets-metadata
Feb 2, 2023
Merged

Store offset commit metadata when calling rd_kafka_offsets_store#4084
Emanuele Sabellico (emasab) merged 9 commits intoconfluentinc:feature/store-offsets-metadatafrom
mathispesch:store-offsets-metadata

Conversation

@mathispesch
Copy link
Copy Markdown

@mathispesch Mathis (mathispesch) commented Nov 30, 2022

Fixes #3927.

Offset commit metadata can be used to send additional data to the broker when making an offset commit. See this doc from the Java consumer.

Librdkafka currently sends the offset commit metadata when the commit is requested by calling rd_kafka_commit_queue but not when calling rd_kafka_offsets_store to use the auto-commit. This PR fixes that by storing the offset commit metadata when calling rd_kafka_offsets_store.

@mathispesch
Copy link
Copy Markdown
Author

Hey Magnus Edenhill (@edenhill) or Ismael Juma (@ijuma),
Could you please give this PR a look? 🙂

@ijuma
Copy link
Copy Markdown
Member

cc Emanuele Sabellico (@emasab)

@milindl Milind L (milindl) requested a review from a team January 5, 2023 11:49
@mathispesch
Copy link
Copy Markdown
Author

Hey folks,
Have you had the chance to look into this PR?

Copy link
Copy Markdown
Contributor

@milindl Milind L (milindl) left a comment

Choose a reason for hiding this comment

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

Looks good to me, besides the tiny issue with the test. I'd like Emanuele Sabellico (@emasab) to weigh in.
We should add back the CHANGELOG, but under the next version, (we can use 2.1.0, or just call it vNext or something).

"Retrieving committed offsets to verify committed offset "
"metadata\n");
rd_kafka_topic_partition_list_t *committed_toppar;
committed_toppar = rd_kafka_topic_partition_list_new(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be destroyed at the end of the test, rd_kafka_topic_partition_list_destroy(committed_toppar);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch! Fixed this in 5d37ab1.

@emasab Emanuele Sabellico (emasab) changed the base branch from master to feature/store-offsets-metadata February 2, 2023 09:12
@emasab
Copy link
Copy Markdown
Contributor

Mathis (@mathispesch) Thanks for the contribution! For security reason currently it's not allowed to run SemaphoreCI on forked PRs. I merge it into an internal branch and open a new PR. If you want to do additional changes before merging to master please open a new PR based on that branch.

@mensfeld
Copy link
Copy Markdown

Mathis (@mathispesch) Emanuele Sabellico (@emasab) should it also store metadata when using rd_kafka_offsets_store and then rd_kafka_commit with null or not? 🤔

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.

rd_kafka_offsets_store does not store and send offset commit metadata

5 participants