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: Reset message-header index while verify checksum-strip at Reconnection #89

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

rdhabalia
Copy link
Contributor

@rdhabalia rdhabalia commented Oct 27, 2016

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.

@yahoocla
Copy link

CLA is valid!

@rdhabalia rdhabalia force-pushed the cs_strip branch 2 times, most recently from d1db08c to 299429f Compare October 27, 2016 20:44
@merlimat merlimat added this to the 1.15.1 milestone Oct 27, 2016
@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Oct 27, 2016
@@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

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

small typo: stripChecksum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed. thanks.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

@rdhabalia rdhabalia merged commit 155de38 into apache:branch-1.15 Oct 27, 2016
rdhabalia added a commit to rdhabalia/pulsar that referenced this pull request Oct 27, 2016
@rdhabalia rdhabalia deleted the cs_strip branch November 11, 2016 23:05
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
* Use internal.Buffer() for message metadata parsing

* Fixed test
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants