-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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: Reset message-header index while verify checksum-strip at Reconnection #89
Conversation
CLA is valid! |
d1db08c
to
299429f
Compare
@@ -791,9 +791,10 @@ private void resendMessages(ClientCnx cnx) { | |||
|
|||
log.info("[{}] [{}] Re-Sending {} messages to server", topic, producerName, messagesToResend); | |||
|
|||
final boolean stipChecksum = cnx.getRemoteEndpointProtocolVersion() < brokerChecksumSupportedVersion(); |
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.
small typo: stripChecksum
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.
fixed. thanks.
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.
👍
* Use internal.Buffer() for message metadata parsing * Fixed test
Motivation
At reconnection: before resending messages, producer verifies broker-version and removes checksum and modifies prepared message if requires. If message is not modified then message-header index is not reset correctly which can corrupt the message.
This problem would only happen in a mixed environment with 1.15 and 1.14 clients.
Modifications
Reset message-header index while stripping checksum.
Result
It will not corrupt message while resending message on reconnection.