Skip to content

Commit

Permalink
Merge pull request #243 from GroundWu/fix_5150_unit_transfer
Browse files Browse the repository at this point in the history
fix: error OB_TENANT_NOT_IN_SERVER and try to refresh route after relogin
  • Loading branch information
GroundWu authored Nov 27, 2024
2 parents 3171e0d + c77ac53 commit 70ca8e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/alipay/oceanbase/rpc/table/ObTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.*;
import com.alipay.oceanbase.rpc.table.api.TableBatchOps;
import com.alipay.oceanbase.rpc.table.api.TableQuery;
import com.alipay.oceanbase.rpc.util.TraceUtil;
import com.alipay.remoting.ConnectionEventHandler;
import com.alipay.remoting.config.switches.GlobalSwitch;
import com.alipay.remoting.connection.ConnectionFactory;
Expand Down Expand Up @@ -417,6 +418,10 @@ private ObPayload executeWithReconnect(ObTableConnection connection, final ObPay
} catch (ObTableException ex) {
if (ex instanceof ObTableTenantNotInServerException && retryTimes < 2) {
needReconnect = true;
} else if (ex instanceof ObTableTenantNotInServerException) {
String errMessage = TraceUtil.formatTraceMessage(connection, request,
"meet ObTableTenantNotInServerException and has relogined, need to refresh route");
throw new ObTableNeedFetchAllException(errMessage, ex.getErrorCode());
} else {
throw ex;
}
Expand Down

0 comments on commit 70ca8e1

Please sign in to comment.