@@ -2027,7 +2027,11 @@ public ObPair<Long, ObTableParam> getTableInternal(String tableName, TableEntry
20272027 }
20282028 if (addr .isExpired (serverAddressCachingTimeout )) {
20292029 logger .info ("Server addr {} is expired, refreshing tableEntry." , addr );
2030- tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , true );
2030+ if (ObGlobal .obVsnMajor () >= 4 ) {
2031+ refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
2032+ } else {
2033+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2034+ }
20312035 }
20322036
20332037 if (ObGlobal .obVsnMajor () >= 4 ) {
@@ -2306,6 +2310,7 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23062310 List <ObPair <Long , ObTableParam >> obTableParams = new ArrayList <ObPair <Long , ObTableParam >>();
23072311 for (ObPair <Long , ReplicaLocation > partIdWithReplica : partIdWithReplicaList ) {
23082312 Long partId = partIdWithReplica .getLeft ();
2313+ long tabletId = getTabletIdByPartId (tableEntry , partId );
23092314 ReplicaLocation replica = partIdWithReplica .getRight ();
23102315 ObServerAddr addr = replica .getAddr ();
23112316 ObTable obTable = tableRoster .get (addr );
@@ -2317,10 +2322,13 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23172322 }
23182323 if (addrExpired ) {
23192324 logger .info ("Server addr {} is expired, refreshing tableEntry." , addr );
2320- tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , true );
2325+ if (ObGlobal .obVsnMajor () >= 4 ) {
2326+ refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
2327+ } else {
2328+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2329+ }
23212330 }
23222331 if (ObGlobal .obVsnMajor () >= 4 ) {
2323- long tabletId = getTabletIdByPartId (tableEntry , partId );
23242332 ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
23252333 replica = getPartitionLocation (locationInfo , route );
23262334 } else {
0 commit comments