Skip to content

Commit 42dedc6

Browse files
committed
refresh tableEntry object when refreshing tablet location meeting schema_version mismatched
1 parent c92cb1c commit 42dedc6

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/main/java/com/alipay/oceanbase/rpc/location/model/TableLocations.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,14 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
334334
throw e;
335335
}
336336
long schemaVersion = tableEntry.getSchemaVersion();
337+
logger.warn("[latency monitor] old schema_version is: {}", schemaVersion);
338+
tableEntry = locations.get(tableName);
337339
// sleep over waiting interval of refreshing meta to refresh meta
338340
long interval = System.currentTimeMillis()
339341
- tableEntry.getRefreshMetaTimeMills();
340-
if (interval > 300) {
341-
Thread.sleep(interval - 300);
342+
logger.warn("[latency monitor] interval is: {}", interval);
343+
if (interval < 300) {
344+
Thread.sleep(300 - interval);
342345
}
343346
tableEntry = locations.get(tableName);
344347
// if schema_version has been updated, directly retry
@@ -461,11 +464,14 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
461464
throw e;
462465
}
463466
long schemaVersion = tableEntry.getSchemaVersion();
467+
logger.warn("[latency monitor] old schema_version is: {}", schemaVersion);
468+
tableEntry = locations.get(tableName);
464469
// sleep over waiting interval of refreshing meta to refresh meta
465470
long interval = System.currentTimeMillis()
466471
- tableEntry.getRefreshMetaTimeMills();
467-
if (interval > 300) {
468-
Thread.sleep(interval - 300);
472+
logger.warn("[latency monitor] interval is: {}", interval);
473+
if (interval < 300) {
474+
Thread.sleep(300 - interval);
469475
}
470476
tableEntry = locations.get(tableName);
471477
// if schema_version has been updated, directly retry

src/main/java/com/alipay/oceanbase/rpc/location/model/TableRoute.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ public ObTableParam getTableParam(String tableName, Row rowkey) throws Exception
656656

657657
public ObTableParam getTableParamWithRoute(String tableName, Row rowkey, ObServerRoute route)
658658
throws Exception {
659-
logger.info("[latency monitor] start to execute getTableParamWithRoute");
660659
TableEntry tableEntry = getTableEntry(tableName);
661660
if (tableEntry == null) {
662661
logger.error("tableEntry is null, tableName: {}", tableName);
@@ -815,7 +814,6 @@ private ObTableParam getTableInternal(String tableName, TableEntry tableEntry, l
815814
tableEntry = refreshPartitionLocation(tableName, tabletId, tableEntry);
816815
obPartitionLocationInfo = getOrRefreshPartitionInfo(tableEntry, tableName, tabletId);
817816
replica = getPartitionLocation(obPartitionLocationInfo, route);
818-
logger.warn("[latency monitor] new replica location, {}:{}", replica.getAddr().getIp(), replica.getAddr().getSvrPort());
819817

820818
if (replica == null) {
821819
RUNTIME.error("Cannot get replica by tabletId: " + tabletId);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ private LsOperationsMap prepareByFirstOperation(LsOperationsMap lsOperationsMap,
480480

481481
private LsOperationsMap prepareByEachOperation(LsOperationsMap lsOperationsMap,
482482
BatchIdxOperationPairList operationsWithIndex) throws Exception {
483-
logger.info("[latency monitor] start to execute prepareByEachOperation");
484483
for (int i = 0; i < operationsWithIndex.size(); i++) {
485484
ObPair<Integer, ObTableSingleOp> operation = operationsWithIndex.get(i);
486485
Row rowKey = calculateRowKey(operation);
@@ -731,7 +730,6 @@ public void partitionExecute(ObTableSingleOpResult[] results,
731730
} else {
732731
if (ex instanceof ObTableTransportException &&
733732
((ObTableTransportException) ex).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
734-
logger.warn("[latency monitor] meet BOLT_TIMEOUT, need to syncRefreshMetadata, tryTimes: {}", tryTimes);
735733
obTableClient.syncRefreshMetadata(true);
736734
}
737735
obTableClient.calculateContinuousFailure(realTableName, ex.getMessage());

0 commit comments

Comments
 (0)