From eb58fd3580bdb8b6c68df7b85cc0b70423ce5288 Mon Sep 17 00:00:00 2001 From: ylxiao5 Date: Fri, 15 Dec 2023 14:42:46 +0800 Subject: [PATCH] fix transaction list error --- .../wecross/routine/xa/XATransactionManager.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/webank/wecross/routine/xa/XATransactionManager.java b/src/main/java/com/webank/wecross/routine/xa/XATransactionManager.java index 98801077..30db1376 100644 --- a/src/main/java/com/webank/wecross/routine/xa/XATransactionManager.java +++ b/src/main/java/com/webank/wecross/routine/xa/XATransactionManager.java @@ -781,16 +781,11 @@ public void asyncListXATransactions( XATransactionListResponse response = new XATransactionListResponse(); - ListXAReduceCallback reduceCallback = null; List chainPaths = new ArrayList<>(); if (Objects.isNull(chainPath) || chainPath.isEmpty()) { chainPaths = setToList(zoneManager.getAllChainsInfo(false).keySet()); - // has sort operation callback - reduceCallback = getListXAReduceCallback(offsets.size(), offsets, size, callback); } else { chainPaths.add(Path.decode(chainPath)); - // Remove sort operation callback - reduceCallback = getListXACallback(offsets.size(), offsets, size, callback); } int chainNum = chainPaths.size(); @@ -810,6 +805,15 @@ public void asyncListXATransactions( } } + ListXAReduceCallback reduceCallback = null; + if (Objects.isNull(chainPath) || chainPath.isEmpty()) { + // has sort operation callback + reduceCallback = getListXAReduceCallback(offsets.size(), offsets, size, callback); + } else { + // Remove sort operation callback + reduceCallback = getListXACallback(offsets.size(), offsets, size, callback); + } + for (String chain : offsets.keySet()) { if (!requireIgnore || offsets.get(chain) != -1L) { asyncListXATransactions(