From 8dbc36cd2aa26782a1c87f7bae79fef56d045be0 Mon Sep 17 00:00:00 2001 From: Fiisio Date: Wed, 6 Sep 2017 12:22:44 +0800 Subject: [PATCH] should use bytes.Equal(batch.keys[0], c.primary()) instead (#4443) --- store/tikv/2pc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/tikv/2pc.go b/store/tikv/2pc.go index 865cc8071e..c821a8fd76 100644 --- a/store/tikv/2pc.go +++ b/store/tikv/2pc.go @@ -430,7 +430,7 @@ func (c *twoPhaseCommitter) commitSingleBatch(bo *Backoffer, batch batchKeys) er // Under this circumstance, we can not declare the commit is complete (may lead to data lost), nor can we throw // an error (may lead to the duplicated key error when upper level restarts the transaction). Currently the best // solution is to populate this error and let upper layer drop the connection to the corresponding mysql client. - isPrimary := bytes.Compare(batch.keys[0], c.primary()) == 0 + isPrimary := bytes.Equal(batch.keys[0], c.primary()) resp, err := c.store.SendReq(bo, req, batch.region, readTimeoutShort) if err != nil {