[fix](commit) Fix does not skip commit if txn state is committed or visible#39786
[fix](commit) Fix does not skip commit if txn state is committed or visible#39786dataroaring merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
yujun777
left a comment
There was a problem hiding this comment.
void XXXTransaction() {
readlock()
txn = getTransaction()
checkTransactionStateBeforeXXX()
readunlock()
do something no need lock()
writeLock()
checkTransactionStateBeforeXXX()
...
writeUnlock()
}
maybe in write lock scope, check transaction status again is better ?
here XXXTransaction XXX should include PreCommit/Commit/Abort
TPC-H: Total hot run time: 38382 ms |
TPC-DS: Total hot run time: 186931 ms |
ClickBench: Total hot run time: 30.71 s |
|
run fe_ut |
|
run feut |
|
PR approved by at least one committer and no changes requested. |
|
Please add a description of what scenario triggers the issue. |
dataroaring
left a comment
There was a problem hiding this comment.
There should be a lock hold when check and commit. Otherwise, two parallel thread may check ok and commit together. It seems that lock on trasaction state is enough.
|
PR approved by at least one committer and no changes requested. |
introduced in #32980
if a txn is committed twice, the check txn state is committed or visible and skip commit logic does not work