From 74f29e01b788eed864f6e9fb3c06b3c4b557e1be Mon Sep 17 00:00:00 2001 From: JackShi148 Date: Tue, 29 Apr 2025 18:20:45 +0800 Subject: [PATCH 1/2] odp mode do not retry any other exceptions but the exceptions belongs to isNeedRetryError --- .../payload/impl/execute/query/AbstractQueryStreamResult.java | 3 ++- .../alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java | 3 ++- .../oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java b/src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java index 5da905a9..0066024e 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java +++ b/src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java @@ -191,7 +191,8 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger, } else { logger.warn("meet exception when execute in odp mode." + "tablename: {}, errMsg: {}", indexTableName, e.getMessage()); - throw e; + // odp mode do not retry any other exceptions + throw new ObTableException(e); } } else { needRefreshPartitionLocation = true; diff --git a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java index 96906ef2..2df491e3 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java +++ b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java @@ -398,7 +398,8 @@ public void partitionExecute(ObTableOperationResult[] results, } else { logger.warn("meet exception when execute normal batch in odp mode." + "tablename: {}, errMsg: {}", tableName, ex.getMessage()); - throw ex; + // odp mode do not retry any other exceptions + throw new ObTableException(ex); } } else if (ex instanceof ObTableReplicaNotReadableException) { if (System.currentTimeMillis() - startExecute < obTableClient diff --git a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java index 53ac97eb..6b1774db 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java +++ b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java @@ -658,7 +658,8 @@ public void partitionExecute(ObTableSingleOpResult[] results, } else { logger.warn("meet exception when execute ls batch in odp mode." + "tablename: {}, errMsg: {}", realTableName, ex.getMessage()); - throw ex; + // odp mode do not retry any other exceptions + throw new ObTableException(ex); } } else if (ex instanceof ObTableReplicaNotReadableException) { if (System.currentTimeMillis() - startExecute < obTableClient.getRuntimeMaxWait()) { From cb37df7db6e21b4762598ee57f785daf4b0c39d7 Mon Sep 17 00:00:00 2001 From: JackShi148 Date: Thu, 8 May 2025 17:57:44 +0800 Subject: [PATCH 2/2] do not refresh tablet location in batch in odp mode --- .../alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java | 1 + .../alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java index 2df491e3..b11f5655 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java +++ b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java @@ -389,6 +389,7 @@ public void partitionExecute(ObTableOperationResult[] results, } catch (Exception ex) { needRefreshPartitionLocation = true; if (obTableClient.isOdpMode()) { + needRefreshPartitionLocation = false; // if exceptions need to retry, retry to timeout if (ex instanceof ObTableException && ((ObTableException) ex).isNeedRetryError()) { diff --git a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java index 6b1774db..b061ccad 100644 --- a/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java +++ b/src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java @@ -651,6 +651,7 @@ public void partitionExecute(ObTableSingleOpResult[] results, } catch (Exception ex) { needRefreshPartitionLocation = true; if (obTableClient.isOdpMode()) { + needRefreshPartitionLocation = false; // if exceptions need to retry, retry to timeout if (ex instanceof ObTableException && ((ObTableException) ex).isNeedRetryError()) { logger.warn("meet need retry exception when execute ls batch in odp mode." +