BewareMyPower opened a new pull request, #20055: URL: https://github.com/apache/pulsar/pull/20055
### Motivation In `TransactionImpl`, when `hasOpsFailed` is false, i.e. there is a send or ACK operation that failed, `commit()` will fail and `abort()` will be called. However, since the state is `COMMITTING`, the abort process will not be executed. ### Modifications - Add the `checkState` method to remove duplicated code in `checkIfOpenOrCommitting` and `checkIfOpenOrAborting`. - In the callback of `commit()`, check the state is `COMMITTING` instead of the same state check in `abort()`. - Add `TransactionProduceTest#testCommitFailure` to verify when a send operation failed, the `commit()` method will change the state of the `Transaction` to `ABORTED` and the `TxnMeta` in TC will be removed. ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: https://github.com/BewareMyPower/pulsar/pull/26 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
