|
32 | 32 | import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableEntityType; |
33 | 33 | import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableStreamRequest; |
34 | 34 | import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.QueryStreamResult; |
| 35 | +import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.syncquery.ObTableQueryAsyncRequest; |
35 | 36 | import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.syncquery.ObTableQueryAsyncResult; |
36 | 37 | import com.alipay.oceanbase.rpc.table.ObTable; |
37 | 38 | import com.alipay.oceanbase.rpc.table.ObTableParam; |
@@ -156,8 +157,12 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger, |
156 | 157 | result = subObTable.execute(request); |
157 | 158 | if (result instanceof ObTableApiMove) { |
158 | 159 | ObTableApiMove move = (ObTableApiMove) result; |
159 | | - logger.warn("The server has not yet completed the master switch, and returned an incorrect leader with an IP address of {}. " + |
160 | | - "Rerouting return IP is {}", moveResponse.getReplica().getServer().ipToString(), move .getReplica().getServer().ipToString()); |
| 160 | + logger |
| 161 | + .warn( |
| 162 | + "The server has not yet completed the master switch, and returned an incorrect leader with an IP address of {}. " |
| 163 | + + "Rerouting return IP is {}", moveResponse |
| 164 | + .getReplica().getServer().ipToString(), move.getReplica() |
| 165 | + .getServer().ipToString()); |
161 | 166 | throw new ObTableRoutingWrongException(); |
162 | 167 | } |
163 | 168 | } |
@@ -222,12 +227,22 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger, |
222 | 227 | throw e; |
223 | 228 | } |
224 | 229 | } else if (e instanceof ObTableException) { |
225 | | - if ((((ObTableException) e).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode || ((ObTableException) e) |
226 | | - .getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode) |
227 | | - && ((ObTableQueryRequest) request).getTableQuery().isHbaseQuery() |
228 | | - && client.getTableGroupInverted().get(indexTableName) != null) { |
229 | | - // table not exists && hbase mode && table group exists , three condition both |
230 | | - client.eraseTableGroupFromCache(tableName); |
| 230 | + if (((ObTableException) e).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode |
| 231 | + || ((ObTableException) e).getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode) { |
| 232 | + if (request instanceof ObTableQueryRequest) { |
| 233 | + if (((ObTableQueryRequest) request).getTableQuery().isHbaseQuery() |
| 234 | + && client.getTableGroupInverted().get(indexTableName) != null) { |
| 235 | + // table not exists && hbase mode && table group exists , three condition both |
| 236 | + client.eraseTableGroupFromCache(tableName); |
| 237 | + } |
| 238 | + } else if (request instanceof ObTableQueryAsyncRequest) { |
| 239 | + if (((ObTableQueryAsyncRequest) request).getObTableQueryRequest() |
| 240 | + .getTableQuery().isHbaseQuery() |
| 241 | + && client.getTableGroupInverted().get(indexTableName) != null) { |
| 242 | + // table not exists && hbase mode && table group exists , three condition both |
| 243 | + client.eraseTableGroupFromCache(tableName); |
| 244 | + } |
| 245 | + } |
231 | 246 | } |
232 | 247 | if (((ObTableException) e).isNeedRefreshTableEntry()) { |
233 | 248 | needRefreshTableEntry = true; |
|
0 commit comments