EscaperLL opened a new issue, #67048:
URL: https://github.com/apache/doris/issues/67048

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   Apache Doris master
   
   Affected commit: 4a11d0b74b74d6b1b2ec92b9706fbf16618b75ce
   
   ### What's Wrong?
   
   A BE can crash when a transaction commit succeeds locally but its response
   times out and the caller retries the same commit.
   
   The first commit transfers the `PendingRowsetGuard` into `TabletTxnInfo`.
   The retry may therefore carry the same moved-from, uninitialized guard.
   
   The duplicate-commit path previously unconditionally move-assigned the
   incoming guard over the initialized guard stored in `TabletTxnInfo`. This
   violates the move-assignment invariant of `PendingRowsetGuard` and triggers
   a `CHECK`.
   
   ### What You Expected?
   
   A duplicate transaction commit caused by an RPC timeout should return 
success without crashing the BE. The pending rowset state created by the 
original successful commit should remain valid.
   
   ### How to Reproduce?
   
   Add the following BE unit test:
   
   ```cpp
   TEST_F(TxnManagerTest, 
ReproduceDuplicateCommitWithMovedFromPendingRowsetGuard) {
       auto guard = k_engine->pending_local_rowsets().add(_rowset->rowset_id());
   
       auto st = k_engine->txn_manager()->commit_txn(
               _meta.get(), partition_id, transaction_id, tablet_id, 
_tablet_uid, load_id, _rowset,
               std::move(guard), false);
       ASSERT_TRUE(st.ok()) << st;
   
       st = k_engine->txn_manager()->commit_txn(
               _meta.get(), partition_id, transaction_id, tablet_id, 
_tablet_uid, load_id,
               _rowset_same_id, std::move(guard), false);
   
       ASSERT_TRUE(st.ok()) << st;
   }
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to