Skip to content

Conversation

@milindl
Copy link
Contributor

@milindl milindl commented Apr 10, 2025

Currently, when creating a new rkt via the public api, rd_kafka_topic_new(), causes us to immediately make a leader query if the topic is unknown.

On the other hand, using the internal rd_kafka_topic_new0() does not do this. producev and produceva both call rd_kafka_topic_new0 in case topic is provided by name. So this delays produce until scan_all is run, which runs on a 1s timer.

Definitely affects JS client and I think it affects python client and dotnet client as well.

Copilot AI review requested due to automatic review settings April 10, 2025 03:57
@milindl milindl requested a review from a team as a code owner April 10, 2025 03:57
@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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

tests/0055-producer_latency.c:496

  • [nitpick] The variable 'wait_time_mss' appears ambiguous; consider renaming it to 'wait_times_ms' for clarity.
int wait_time_mss[] = {500, 1200, 2500, 3700, 4900};

@milindl milindl requested a review from Copilot April 10, 2025 04:07
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_metadata_new_topic_pullback_1s branch from a500cd0 to 7cf8368 Compare April 10, 2025 04:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

tests/0055-producer_latency.c:500

  • [nitpick] The variable name 'wait_time_mss' appears to contain a typo; consider renaming it to 'wait_time_ms' for clarity.
int wait_time_mss[] = {500, 1200, 2500, 3700, 4900};

@milindl milindl changed the title (Draft) Fix 1s delay in first produce Fix up to a 1s delay in first produce to new topic Apr 10, 2025
Copy link
Contributor

@emasab emasab left a comment

Choose a reason for hiding this comment

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

Thanks for the fix Milind, sent some improvements

rd_kafka_conf_set_dr_msg_cb(conf, dr_msg_cb_first_message);
rk = test_create_handle(RD_KAFKA_PRODUCER, conf);

switch (case_number) {
Copy link
Contributor

@emasab emasab May 27, 2025

Choose a reason for hiding this comment

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

let's repeat this 50 times instead of changing the sleep. Every time with a different topic name. this way we can also evaluate the number of metadata requests done

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_metadata_new_topic_pullback_1s branch from a32284a to 7638b5f Compare May 28, 2025 10:26
Copy link
Contributor

@emasab emasab left a comment

Choose a reason for hiding this comment

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

Thanks Milind! Approving

@milindl milindl merged commit 3f52de4 into master May 29, 2025
2 checks passed
@milindl milindl deleted the dev_metadata_new_topic_pullback_1s branch May 29, 2025 13:26
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.

3 participants