Skip to content

Commit 61885fa

Browse files
authored
Fix table not exist retry too long in odp mode (#334)
* odp mode do not retry any other exceptions but the exceptions belongs to isNeedRetryError * do not refresh tablet location in batch in odp mode
1 parent 0f08bd8 commit 61885fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
191191
} else {
192192
logger.warn("meet exception when execute in odp mode." +
193193
"tablename: {}, errMsg: {}", indexTableName, e.getMessage());
194-
throw e;
194+
// odp mode do not retry any other exceptions
195+
throw new ObTableException(e);
195196
}
196197
} else {
197198
needRefreshPartitionLocation = true;

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ public void partitionExecute(ObTableOperationResult[] results,
389389
} catch (Exception ex) {
390390
needRefreshPartitionLocation = true;
391391
if (obTableClient.isOdpMode()) {
392+
needRefreshPartitionLocation = false;
392393
// if exceptions need to retry, retry to timeout
393394
if (ex instanceof ObTableException
394395
&& ((ObTableException) ex).isNeedRetryError()) {
@@ -398,7 +399,8 @@ public void partitionExecute(ObTableOperationResult[] results,
398399
} else {
399400
logger.warn("meet exception when execute normal batch in odp mode."
400401
+ "tablename: {}, errMsg: {}", tableName, ex.getMessage());
401-
throw ex;
402+
// odp mode do not retry any other exceptions
403+
throw new ObTableException(ex);
402404
}
403405
} else if (ex instanceof ObTableReplicaNotReadableException) {
404406
if (System.currentTimeMillis() - startExecute < obTableClient

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,16 @@ public void partitionExecute(ObTableSingleOpResult[] results,
651651
} catch (Exception ex) {
652652
needRefreshPartitionLocation = true;
653653
if (obTableClient.isOdpMode()) {
654+
needRefreshPartitionLocation = false;
654655
// if exceptions need to retry, retry to timeout
655656
if (ex instanceof ObTableException && ((ObTableException) ex).isNeedRetryError()) {
656657
logger.warn("meet need retry exception when execute ls batch in odp mode." +
657658
"tableName: {}, errMsg: {}", realTableName, ex.getMessage());
658659
} else {
659660
logger.warn("meet exception when execute ls batch in odp mode." +
660661
"tablename: {}, errMsg: {}", realTableName, ex.getMessage());
661-
throw ex;
662+
// odp mode do not retry any other exceptions
663+
throw new ObTableException(ex);
662664
}
663665
} else if (ex instanceof ObTableReplicaNotReadableException) {
664666
if (System.currentTimeMillis() - startExecute < obTableClient.getRuntimeMaxWait()) {

0 commit comments

Comments
 (0)