implicit trx first stmt retry does not abort tx
This commit is contained in:
@ -223,6 +223,36 @@ TEST_F(ObTestTx, rollback_savepoint_with_uncertain_participants)
|
||||
ASSERT_EQ(0, tx.parts_.count());
|
||||
}
|
||||
|
||||
TEST_F(ObTestTx, rollback_savepoint_with_need_retry_error)
|
||||
{
|
||||
START_ONE_TX_NODE(n1);
|
||||
PREPARE_TX(n1, tx);
|
||||
PREPARE_TX_PARAM(tx_param);
|
||||
GET_READ_SNAPSHOT(n1, tx, tx_param, snapshot);
|
||||
|
||||
{
|
||||
CREATE_IMPLICIT_SAVEPOINT(n1, tx, tx_param, sp);
|
||||
ASSERT_TRUE(sp.is_valid());
|
||||
ASSERT_EQ(OB_SUCCESS, n1->write(tx, snapshot, 100, 200));
|
||||
ASSERT_EQ(OB_SUCCESS, n1->rollback_to_implicit_savepoint(tx, sp, n1->ts_after_ms(5), nullptr, OB_TRANSACTION_SET_VIOLATION));
|
||||
ASSERT_EQ(ObTxDesc::State::IDLE, tx.state_);
|
||||
ASSERT_EQ(0, tx.parts_.count());
|
||||
ASSERT_EQ(ObTxSEQ::INVL(), tx.active_scn_);
|
||||
ASSERT_EQ(OB_SUCCESS, n1->rollback_to_implicit_savepoint(tx, sp, n1->ts_after_ms(5), nullptr));
|
||||
}
|
||||
|
||||
{
|
||||
CREATE_IMPLICIT_SAVEPOINT(n1, tx, tx_param, sp);
|
||||
ASSERT_TRUE(sp.is_valid());
|
||||
ASSERT_EQ(OB_SUCCESS, n1->write(tx, snapshot, 100, 200));
|
||||
ASSERT_EQ(OB_SUCCESS, n1->rollback_to_implicit_savepoint(tx, sp, n1->ts_after_ms(5), nullptr, OB_TRY_LOCK_ROW_CONFLICT));
|
||||
ASSERT_EQ(ObTxDesc::State::IDLE, tx.state_);
|
||||
ASSERT_EQ(0, tx.parts_.count());
|
||||
ASSERT_EQ(ObTxSEQ::INVL(), tx.active_scn_);
|
||||
ASSERT_EQ(OB_SUCCESS, n1->rollback_to_implicit_savepoint(tx, sp, n1->ts_after_ms(5), nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ObTestTx, switch_to_follower_gracefully)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user