Skip to content

Commit

Permalink
fix -5150 error and try to refresh route after relogin
Browse files Browse the repository at this point in the history
  • Loading branch information
GroundWu authored and maochongxin committed Nov 27, 2024
1 parent 4ce9751 commit 9803a36
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 9803a36

Please sign in to comment.