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][test] fix testEndTxnWhenCommittingOrAborting flaky test #18318

Merged

Conversation

congbobo184
Copy link
Contributor

@congbobo184 congbobo184 commented Nov 3, 2022

Fixes: #18318

issue: https://github.com/apache/pulsar/actions/runs/3383985489/jobs/5620564078

Motivation

Transaction op count update after the write response, so we need to wait for the change to succeed
https://github.com/congbobo184/pulsar/blob/2b441bd2ab4b71d5bc182f85c62fbea633c4ce4b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarCommandSenderImpl.java#L314-L317

https://github.com/congbobo184/pulsar/blob/2b441bd2ab4b71d5bc182f85c62fbea633c4ce4b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarCommandSenderImpl.java#L334-L337

Modifications

wait count changed

Verifying this change

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:
congbobo184#7

Comment on lines -346 to -360
if (this.interceptor != null) {
this.interceptor.txnEnded(txnID.toString(), TxnAction.ABORT_VALUE);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to delete this part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If end transaction throws an exception, it doesn't mean the transaction has been ended, so we don't need to record it as aborted

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the title should no longer be “fix test“?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @poorbarcode. Is this change related to this flaky test? If not, a new PR to delete it may be better.

Copy link
Contributor

@liangyepianzhou liangyepianzhou left a comment

Choose a reason for hiding this comment

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

Good work!

Apache Pulsar / Flaky Tests automation moved this from In progress to Reviewer approved Nov 3, 2022
Apache Pulsar / Flaky Tests automation moved this from Reviewer approved to Done Nov 3, 2022
Apache Pulsar / Flaky Tests automation moved this from Done to In progress Nov 3, 2022
@Technoboy- Technoboy- changed the title [fix][flaky] fix testEndTxnWhenCommittingOrAborting flaky test [fix][test] fix testEndTxnWhenCommittingOrAborting flaky test Nov 4, 2022
Comment on lines -346 to -360
if (this.interceptor != null) {
this.interceptor.txnEnded(txnID.toString(), TxnAction.ABORT_VALUE);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the title should no longer be “fix test“?

Apache Pulsar / Flaky Tests automation moved this from In progress to Reviewer approved Nov 4, 2022
@congbobo184
Copy link
Contributor Author

@poorbarcode mainly to fix the flaky test, this is just to remove the wrong logic

@github-actions
Copy link

github-actions bot commented Dec 5, 2022

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Dec 5, 2022
@poorbarcode
Copy link
Contributor

@poorbarcode
Copy link
Contributor

poorbarcode commented Jan 17, 2023

@lhotari could you review this PR? link issue: #18605

@github-actions github-actions bot removed the Stale label Jan 18, 2023
…nCommittingOrAborting

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarCommandSenderImpl.java
@Technoboy- Technoboy- closed this Jan 28, 2023
Apache Pulsar / Flaky Tests automation moved this from Reviewer approved to Done Jan 28, 2023
@Technoboy- Technoboy- reopened this Jan 28, 2023
Apache Pulsar / Flaky Tests automation moved this from Done to In progress Jan 28, 2023
@Technoboy- Technoboy- merged commit fcecca4 into apache:master Jan 28, 2023
Apache Pulsar / Flaky Tests automation moved this from In progress to Done Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants