Skip to content
Snippets Groups Projects
Unverified Commit 45399d8f authored by fagongzi's avatar fagongzi Committed by GitHub
Browse files

txn: fix txn status in rolback response (#4794)

Use Active status in rollback response, and txn client panic after check the txn status in response

Approved by: @lni, @reusee
parent bb72f32a
No related branches found
No related tags found
No related merge requests found
......@@ -331,8 +331,9 @@ func (s *service) Rollback(ctx context.Context, request *txn.TxnRequest, respons
response.Txn = &newTxn
newTxn.DNShards = request.Txn.DNShards
s.startAsyncRollbackTask(newTxn)
response.Txn.Status = txn.TxnStatus_Aborted
return nil
}
......
......@@ -561,7 +561,11 @@ func TestRollback(t *testing.T) {
w2 := addTestWaiter(t, s2, wTxn, txn.TxnStatus_Aborted)
defer w2.close()
checkResponses(t, rollbackWriteData(t, sender, wTxn))
responses := rollbackWriteData(t, sender, wTxn)
checkResponses(t, responses)
for _, resp := range responses {
assert.Equal(t, txn.TxnStatus_Aborted, resp.Txn.Status)
}
checkWaiter(t, w1, txn.TxnStatus_Aborted)
checkWaiter(t, w2, txn.TxnStatus_Aborted)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment