From 185b6b136fe42f85e0e7f66b0a853212ed6e2151 Mon Sep 17 00:00:00 2001 From: guoxu <13910754971@163.com> Date: Thu, 26 Sep 2024 16:43:32 +0800 Subject: [PATCH] [fix][dingo-executor] fix issue pessimistic txn hanging when updating table. --- .../exec/transaction/impl/PessimisticTransaction.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dingo-exec/src/main/java/io/dingodb/exec/transaction/impl/PessimisticTransaction.java b/dingo-exec/src/main/java/io/dingodb/exec/transaction/impl/PessimisticTransaction.java index 19e381f9c4..02c08853cd 100644 --- a/dingo-exec/src/main/java/io/dingodb/exec/transaction/impl/PessimisticTransaction.java +++ b/dingo-exec/src/main/java/io/dingodb/exec/transaction/impl/PessimisticTransaction.java @@ -390,6 +390,7 @@ public boolean onePcStage() { //get primary key. cacheToObject = primaryLockTo(); primaryKey = cacheToObject.getMutation().getKey(); + mutations.add(cacheToObject.getMutation()); partIdSet.add(cacheToObject.getPartId()); while (transform.hasNext()) { @@ -403,7 +404,9 @@ public boolean onePcStage() { break; } else { //build Mutaions. - mutations.add(TransactionCacheToMutation.localDatatoMutation(txnLocalData, TransactionType.PESSIMISTIC)); + if(!Arrays.equals(txnLocalData.getKey(), primaryKey)) { + mutations.add(TransactionCacheToMutation.localDatatoMutation(txnLocalData, TransactionType.PESSIMISTIC)); + } } }