-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] update txn status concurrently throw exception #20053
base: master
Are you sure you want to change the base?
[fix] [txn] update txn status concurrently throw exception #20053
Conversation
The pr had no activity for 30 days, mark with Stale label. |
@congbobo184 can you help take a look of this problem? |
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.
Good catch!
Is this PR similar to #19630? |
TxnStats is written by a single thread, so the update stats thread should also be single-threaded. I don't understand where the concurrency problem occurs. Can you point it out?
|
TxnStatus is appended to txnLog by single thread, but the operation after thenAccept is executed in other thread. So it cause the concurrency problem. Lines 398 to 400 in ac46e2e
|
The |
The pr had no activity for 30 days, mark with Stale label. |
Motivation
When MLTransactionMetadataStore#updateTxnStatus concurrently, there is a case only one request succeed, other requests throw exception.
Modifications
If the newStatus == txnMeta.status(), it should not throw exception to client. Which is the same as
pulsar/pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
Lines 385 to 388 in 7ea8741
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: TakaHiR07#4