Skip to content

Commit 2f4f23e

Browse files
committed
refresh tableGroup cache in LsBatch exception catching
1 parent 9c2b15c commit 2f4f23e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,14 +582,17 @@ public void partitionExecute(ObTableSingleOpResult[] results,
582582
} else if (ex instanceof ObTableException
583583
&& ((ObTableException) ex).isNeedRefreshTableEntry()) {
584584
needRefreshTableEntry = true;
585+
if (((ObTableException) ex).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode
586+
&& obTableClient.isTableGroupName(tableName)
587+
&& obTableClient.getTableGroupInverted().get(realTableName) != null) {
588+
// TABLE_NOT_EXIST + tableName is tableGroup + TableGroup cache is not empty
589+
// means tableGroupName cache need to refresh
590+
obTableClient.eraseTableGroupFromCache(tableName);
591+
realTableName = obTableClient.tryGetTableNameFromTableGroupCache(tableName, true);
592+
}
585593
if (obTableClient.isRetryOnChangeMasterTimes()
586594
&& (tryTimes - 1) < obTableClient.getRuntimeRetryTimes()) {
587595
if (ex instanceof ObTableNeedFetchAllException) {
588-
if (((ObTableException) ex).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode) {
589-
if (entityType == ObTableEntityType.HKV && obTableClient.isTableGroupName(tableName)) {
590-
realTableName = obTableClient.tryGetTableNameFromTableGroupCache(tableName, true);
591-
}
592-
}
593596
obTableClient.getOrRefreshTableEntry(realTableName, needRefreshTableEntry,
594597
obTableClient.isTableEntryRefreshIntervalWait(), true);
595598
throw ex;

0 commit comments

Comments
 (0)