Skip to content

Commit 72c56e7

Browse files
authored
txnkv: fix commit bug (#27)
Signed-off-by: disksing <[email protected]>
1 parent 27e9cc9 commit 72c56e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

txnkv/txn.go

+3
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ func (txn *Transaction) Commit(ctx context.Context) error {
204204
if c := txn.us.LookupConditionPair(k); c != nil && c.ShouldNotExist() {
205205
op = kvrpcpb.Op_Insert
206206
}
207+
if len(v) == 0 {
208+
op = kvrpcpb.Op_Del
209+
}
207210
mutations[string(k)] = &kvrpcpb.Mutation{
208211
Op: op,
209212
Key: k,

0 commit comments

Comments
 (0)