Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix for a wrong error returned on full metadata refresh before joining a consumer group #4678

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

emasab
Copy link
Contributor

@emasab emasab commented Apr 8, 2024

A metadata call before member joins
consumer group, could lead to
an UNKNOWN_TOPIC_OR_PART error.
Solved by updating the consumer group
following a metadata refresh only in safe states.
Happening since 2.1.0

Closes #4589

@emasab emasab force-pushed the dev_fix_metadata_call_before_join_group branch from 799491c to 3e05712 Compare April 8, 2024 19:03
@emasab emasab force-pushed the dev_fix_metadata_cache_cleared_full_request branch from 6f3c1b5 to b27ccc6 Compare April 11, 2024 09:18
@emasab emasab force-pushed the dev_fix_metadata_call_before_join_group branch from 3e05712 to fc00cfc Compare April 11, 2024 09:18
@emasab emasab force-pushed the dev_fix_metadata_cache_cleared_full_request branch 2 times, most recently from d4d40c1 to d9540da Compare April 11, 2024 16:34
@emasab emasab force-pushed the dev_fix_metadata_call_before_join_group branch from fc00cfc to 420116d Compare April 11, 2024 17:17
Comment on lines 2336 to 2339
/* Insert all non-wildcard topics in cache. */
rd_kafka_metadata_cache_hint_rktparlist(
rkcg->rkcg_rk, rkcg->rkcg_subscription, NULL, 0 /*dont replace*/);

Copy link
Member

Choose a reason for hiding this comment

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

We can keep this here as well I think as its just adding the hints. This function is used during rejoin as well.

rkcg->rkcg_subscription = rktparlist;
if (rkcg->rkcg_subscription) {
/* Insert all non-wildcard topics in cache immediately.
* to avoid problems with subsequent metadata
Copy link
Member

Choose a reason for hiding this comment

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

What problems? Let's elaborate more in the comments.

@emasab emasab force-pushed the dev_fix_metadata_cache_cleared_full_request branch from d9540da to a159193 Compare April 14, 2024 10:54
@emasab emasab force-pushed the dev_fix_metadata_call_before_join_group branch from 420116d to 60045b7 Compare April 14, 2024 11:01
Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

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

Minor comments.

test_mock_cluster_destroy(mcluster);

SUB_TEST_PASS();
}

int main_0146_metadata_mock(int argc, char **argv) {
TEST_SKIP_MOCK_CLUSTER(0);

do_test_metadata_persists_in_cache("range");

Copy link
Member

Choose a reason for hiding this comment

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

Remove extra line from here.


int main_0146_metadata_mock(int argc, char **argv) {
TEST_SKIP_MOCK_CLUSTER(0);

do_test_metadata_persists_in_cache("range");

do_test_metadata_persists_in_cache("cooperative-sticky");
do_test_metadata_call_before_join();
Copy link
Member

Choose a reason for hiding this comment

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

Add extra line before this.

CHANGELOG.md Outdated
@@ -36,6 +38,10 @@ librdkafka v2.3.1 is a maintenance release:
refreshes and occasional `UNKNOWN_TOPIC_OR_PART` errors. Solved by updating
cache for existing or hinted entries instead of clearing them.
Happening since 2.1.0 (#4677).
* A metadata call before member joins consumer group,
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the issue as well here for all the previous fixes as well?

Base automatically changed from dev_fix_metadata_cache_cleared_full_request to dev_kip848 April 15, 2024 07:38
@emasab emasab force-pushed the dev_fix_metadata_call_before_join_group branch 2 times, most recently from 78a5434 to 31fea0e Compare April 15, 2024 09:43
on full metadata refresh before
joining a consumer group

A metadata call before member joins
consumer group, could lead to
an `UNKNOWN_TOPIC_OR_PART` error.
Solved by updating the consumer group
following a metadata refresh only in safe states.
Happening since 2.1.0
Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

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

LGTM!..

@emasab emasab merged commit 102ca15 into dev_kip848 Apr 15, 2024
2 checks passed
@emasab emasab deleted the dev_fix_metadata_call_before_join_group branch April 15, 2024 15:20
emasab added a commit that referenced this pull request Apr 18, 2024
…g a consumer group (#4678)

A metadata call before member joins
consumer group, could lead to
an `UNKNOWN_TOPIC_OR_PART` error.
Solved by updating the consumer group
following a metadata refresh only in safe states.
Happening since 2.1.0
anchitj pushed a commit that referenced this pull request Jun 10, 2024
…g a consumer group (#4678)

A metadata call before member joins
consumer group, could lead to
an `UNKNOWN_TOPIC_OR_PART` error.
Solved by updating the consumer group
following a metadata refresh only in safe states.
Happening since 2.1.0
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