support multi transaction

This commit is contained in:
hdt3213
2021-05-31 21:20:33 +08:00
parent 9d03314359
commit 67c385ee4a
50 changed files with 1919 additions and 1122 deletions

View File

@@ -14,10 +14,10 @@ func TestRollback(t *testing.T) {
txIDStr := strconv.FormatInt(txID, 10)
keys := []string{"a", "b"}
groupMap := testCluster.groupBy(keys)
args := []string{txIDStr}
args := []string{txIDStr, "DEL"}
args = append(args, keys...)
testCluster.Exec(nil, toArgs("SET", "a", "a"))
ret := prepareDel(testCluster, nil, makeArgs("PrepareDel", args...))
ret := execPrepare(testCluster, nil, makeArgs("Prepare", args...))
asserts.AssertNotError(t, ret)
requestRollback(testCluster, nil, txID, groupMap)
ret = testCluster.Exec(nil, toArgs("GET", "a"))
@@ -27,10 +27,10 @@ func TestRollback(t *testing.T) {
FlushAll(testCluster, nil, toArgs("FLUSHALL"))
txID = rand.Int63()
txIDStr = strconv.FormatInt(txID, 10)
args = []string{txIDStr}
args = []string{txIDStr, "DEL"}
args = append(args, keys...)
testCluster.Exec(nil, toArgs("SET", "a", "a"))
ret = prepareDel(testCluster, nil, makeArgs("PrepareDel", args...))
ret = execPrepare(testCluster, nil, makeArgs("Prepare", args...))
asserts.AssertNotError(t, ret)
_, err := requestCommit(testCluster, nil, txID, groupMap)
if err != nil {