[fix] [txn] update txn status concurrently throw exception#20053
[fix] [txn] update txn status concurrently throw exception#20053TakaHiR07 wants to merge 1 commit intoapache:masterfrom
Conversation
|
The pr had no activity for 30 days, mark with Stale label. |
|
@congbobo184 can you help take a look of this problem? |
|
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. |
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
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: TakaHiR07#4