Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Fix #204: Have the consuming client refresh its metadata if the partition leadership changes. #206

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

k-wall
Copy link
Contributor

@k-wall k-wall commented Nov 25, 2022

This minimises the time the canary spends consuming from followers after the partition leadership changes on the cluster. This avoid the end to end latency measure being skewed by the additional latency introduced by the highwatermark propagation between leader/followers. I left a fuller explanation on this comment: #204 (comment)

@k-wall k-wall changed the title Fix #204: Have the consuming client refresh it metadata if the partition leadership changes. Fix #204: Have the consuming client refresh its metadata if the partition leadership changes. Nov 25, 2022
Copy link
Member

@showuon showuon 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. Left some comments.

Comment on lines +161 to +169
topicMetadata, err = ts.describeCanaryTopic()
if err != nil {
return result, err
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a side bug fix, right? Before this change, we'll just return empty result even if the topic is created, which is unexpected.

Copy link
Contributor Author

@k-wall k-wall Dec 1, 2022

Choose a reason for hiding this comment

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

No, it is because I want topicMetadata to be populated in the case where the topic has just been created so that I can do ts.currentLeaders(topicMetadata) later on in the method.

Copy link
Member

Choose a reason for hiding this comment

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

Is that worth a code comment?

internal/services/consumer.go Show resolved Hide resolved
internal/workers/canary_manager.go Show resolved Hide resolved
@k-wall
Copy link
Contributor Author

k-wall commented Dec 1, 2022

I want to write unit tests to help with the refactoring. Please review #207 first. I can then build the unit tests on top of that.

@ppatierno
Copy link
Member

@k-wall while I am fine with this change, I left a comment on #204 just to get your feedback about it before approving this one.

@k-wall
Copy link
Contributor Author

k-wall commented Dec 6, 2022

@k-wall while I am fine with this change, I left a comment on #204 just to get your feedback about it before approving this one.

Great. I've got a unit test ready to push onto this PR once #207 is merged.

@ppatierno ppatierno requested a review from a team December 6, 2022 12:05
@ppatierno ppatierno added this to the 0.6.0 milestone Dec 6, 2022
@ppatierno
Copy link
Member

You are right. Thanks.

@ppatierno ppatierno requested a review from a team December 6, 2022 13:17
…e partition leadership changes

This minimises the time the canary spends consumer from followers after the partition leadership changes on the broker, and so avoid end
to end latency measure being skewed.

Signed-off-by: kwall <[email protected]>
@k-wall
Copy link
Contributor Author

k-wall commented Dec 7, 2022

Supporting unit test added.

Comment on lines +161 to +169
topicMetadata, err = ts.describeCanaryTopic()
if err != nil {
return result, err
}
Copy link
Member

Choose a reason for hiding this comment

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

Is that worth a code comment?

@k-wall
Copy link
Contributor Author

k-wall commented Dec 8, 2022

@tombentley comment added.

@ppatierno ppatierno merged commit b3e187a into strimzi:main Dec 8, 2022
@k-wall k-wall deleted the issue-204 branch December 8, 2022 16:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants