-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
added offline replicas operation to client for kafka version >= 1.x #1318
Conversation
metadata_request.go
Outdated
@@ -42,7 +42,7 @@ func (r *MetadataRequest) decode(pd packetDecoder, version int16) error { | |||
} else { | |||
topicCount := size | |||
if topicCount == 0 { | |||
return nil | |||
goto SKIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not return here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the protocol version is higher than 3 (0.11.0.0), which is the case of version 1.0.0.0 (5) that supports the offline replicas request, the if block on the bottom of the function would be skipped:
if r.Version > 3 {
autoCreation, err := pd.getBool()
if err != nil {
return err
}
r.AllowAutoTopicCreation = autoCreation
}
But obviously I admit this is a potential point of improvement, I can try to refactor this to a more idiomatic way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, please have a look, if it's can't be refactored, I am not super against GOTO's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This breaks the API, so you should probably bump your next major version to |
Upstream repository broke semver in IBM/sarama#1318
Upstream repository broke semver in IBM/sarama#1318
Upstream repository broke semver in IBM/sarama#1318
Upstream repository broke semver in IBM/sarama#1318
Upstream repository broke semver in IBM/sarama#1318
Can you please clarify where were the breaking changes introduced? Apologies in advance. |
OfflineReplicas was a new method in client interface. We have some internal stuff where we implement the interface. So when I ran tests with new version, it was complaining for that method, I implemented it and all fine. But it seems that @gbbr had a breaking build too. |
There was however a breaking change introduced on the testing api, however there's nothing stoping you from using those methods on your code as helpers, perhaps they should be moved into some internal package. |
Upstream repository broke semver in IBM/sarama#1318
You've actually motivated me to write this (very experimental) package over the weekend: https://github.com/gbbr/breakcheck |
@gbbr that's great, I will have a look and might help with some issues(time permitted). |
Upstream repository broke semver in IBM/sarama#1318
Added Offline Replicas Operation to
Client
.OfflineReplicas
OperationConfig
#1311