Skip to content

Commit e5762f4

Browse files
committed
add -4138
1 parent fb03d26 commit e5762f4

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/main/java/com/alipay/oceanbase/rpc/bolt/transport/ObTableRemoting.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import io.netty.buffer.ByteBuf;
3232
import org.slf4j.Logger;
3333

34-
import javax.xml.transform.Result;
35-
3634
import static com.alipay.oceanbase.rpc.protocol.packet.ObCompressType.INVALID_COMPRESSOR;
3735
import static com.alipay.oceanbase.rpc.protocol.packet.ObCompressType.NONE_COMPRESSOR;
3836

@@ -124,7 +122,7 @@ public ObPayload invokeSync(final ObTableConnection conn, final ObPayload reques
124122
ObRpcResultCode resultCode = new ObRpcResultCode();
125123
resultCode.decode(buf);
126124
// If response indicates the request is routed to wrong server, we should refresh the routing meta.
127-
if (!conn.getObTable().getReRouting() && response.getHeader().isRoutingWrong()) {
125+
if (!conn.getObTable().isEnableRerouting() && response.getHeader().isRoutingWrong()) {
128126
String errMessage = TraceUtil.formatTraceMessage(conn, request,
129127
"routed to the wrong server: " + response.getMessage());
130128
logger.warn(errMessage);
@@ -197,6 +195,7 @@ private boolean needFetchAll(int errorCode, int pcode) {
197195
|| errorCode == ResultCodes.OB_TABLET_NOT_EXIST.errorCode
198196
|| errorCode == ResultCodes.OB_LS_NOT_EXIST.errorCode
199197
|| errorCode == ResultCodes.OB_MAPPING_BETWEEN_TABLET_AND_LS_NOT_EXIST.errorCode
198+
|| errorCode == ResultCodes.OB_SNAPSHOT_DISCARDED.errorCode
200199
|| (pcode == Pcodes.OB_TABLE_API_LS_EXECUTE && errorCode == ResultCodes.OB_NOT_MASTER.errorCode);
201200
}
202201

src/main/java/com/alipay/oceanbase/rpc/property/Property.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public enum Property {
134134
NETTY_BLOCKING_WAIT_INTERVAL("bolt.netty.blocking.wait.interval", 1, "netty写缓存满后等待时间"),
135135

136136
// [ObTable][OTHERS]
137-
SERVER_ENABLE_REROUTING("server.enable.rerouting", true, "开启server端的重定向回复功能"),
137+
SERVER_ENABLE_REROUTING("server.enable.rerouting", false, "开启server端的重定向回复功能"),
138138

139139
/*
140140
* other config

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class ObTable extends AbstractObTable implements Lifecycle {
6666

6767
private volatile boolean initialized = false;
6868
private volatile boolean closed = false;
69-
private boolean reRouting = true; // only used for init packet factory
69+
private boolean enableRerouting = true; // only used for init packet factory
7070

7171
private ReentrantLock statusLock = new ReentrantLock();
7272

@@ -89,7 +89,7 @@ public void init() throws Exception {
8989
.configWriteBufferWaterMark(getNettyBufferLowWatermark(),
9090
getNettyBufferHighWatermark()).build();
9191
connectionFactory.init(new ConnectionEventHandler(new GlobalSwitch())); // Only for monitoring connection status
92-
realClient = new ObTableRemoting(new ObPacketFactory(reRouting));
92+
realClient = new ObTableRemoting(new ObPacketFactory(enableRerouting));
9393
connectionPool = new ObTableConnectionPool(this, obTableConnectionPoolSize);
9494
connectionPool.init();
9595
initialized = true;
@@ -164,7 +164,7 @@ private void initProperties() {
164164
nettyBufferHighWatermark);
165165
nettyBlockingWaitInterval = parseToInt(NETTY_BLOCKING_WAIT_INTERVAL.getKey(),
166166
nettyBlockingWaitInterval);
167-
reRouting = parseToBoolean(SERVER_ENABLE_REROUTING.getKey(), reRouting);
167+
enableRerouting = parseToBoolean(SERVER_ENABLE_REROUTING.getKey(), enableRerouting);
168168
maxConnExpiredTime = parseToLong(MAX_CONN_EXPIRED_TIME.getKey(), maxConnExpiredTime);
169169

170170
Object value = this.configs.get("runtime");
@@ -174,8 +174,8 @@ private void initProperties() {
174174
}
175175
}
176176

177-
public boolean getReRouting(){
178-
return reRouting;
177+
public boolean isEnableRerouting(){
178+
return enableRerouting;
179179
}
180180

181181
/*

0 commit comments

Comments
 (0)