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][txn] Fix the transaction acknowledgement and send logic for chunk message #1069

Merged
merged 7 commits into from
Jul 26, 2023

Conversation

liangyepianzhou
Copy link
Contributor

@liangyepianzhou liangyepianzhou commented Jul 22, 2023

Master #1060

Motivation

  1. For the chunk message, we only register the send operation once but end the send operation multiple times when receiving the send response. It will make the transaction can be committed before all the operations are completed.
  2. When we use transaction ack for chunk messages, the provided transaction is ignored, resulting in the chunk message actually being acknowledged using the non-transactional ack method.

Modifications

  1. Only end the send operation when receive the last chunk message.
  2. Add the check for the transaction when the massage is a chunk message.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@liangyepianzhou liangyepianzhou changed the title [fix][txn] Only do end send operations for the last chunk message. [fix][txn] Fix the transaction acknowledgement and send logic for chunk message Jul 22, 2023
pulsar/producer_partition.go Outdated Show resolved Hide resolved
pulsar/producer_partition.go Outdated Show resolved Hide resolved
@gunli
Copy link
Contributor

gunli commented Jul 25, 2023

@liangyepianzhou The bug of producer I have fixed in #1071

@liangyepianzhou
Copy link
Contributor Author

@liangyepianzhou The bug of producer I have fixed in #1071

Maybe you can merge the master after this PR is merged?

@gunli
Copy link
Contributor

gunli commented Jul 25, 2023

Or you can just fix the consumer, I have refactored the producer, that modified a lot of code.

@liangyepianzhou
Copy link
Contributor Author

liangyepianzhou commented Jul 25, 2023

Or you can just fix the consumer, I have refactored the producer, that modified a lot of code.

Sure, I can only fix the consumer. Thanks for your contribution.

@gunli
Copy link
Contributor

gunli commented Jul 25, 2023

You are welcome. So, if you are free, would you please help to review my PR #1071.

@RobertIndie RobertIndie added this to the v0.12.0 milestone Jul 26, 2023
@RobertIndie RobertIndie merged commit 59ef32b into master Jul 26, 2023
6 checks passed
@liangyepianzhou liangyepianzhou deleted the handle_txn_of_chunk_message_reponse branch August 7, 2023 16:03
RobertIndie pushed a commit that referenced this pull request Sep 7, 2023
…nk message (#1069)

Master #1060
### Motivation
1. For the chunk message, we only register the send operation once but end the send operation multiple times when receiving the send response. It will make the transaction can be committed before all the operations are completed.
2. When we use transaction ack for chunk messages, the provided transaction is ignored, resulting in the chunk message actually being acknowledged using the non-transactional ack method.
### Modifications
1. Only end the send operation when receive the last chunk message.
2. Add the check for the transaction when the massage is a chunk message.

(cherry picked from commit 59ef32b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants