@@ -2305,7 +2305,7 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23052305 // obTableParams -> List<Pair<logicId, obTableParams>>
23062306 List <ObPair <Long , ObTableParam >> obTableParams = new ArrayList <ObPair <Long , ObTableParam >>();
23072307 for (ObPair <Long , ReplicaLocation > partIdWithReplica : partIdWithReplicaList ) {
2308- long partId = partIdWithReplica .getLeft ();
2308+ Long partId = partIdWithReplica .getLeft ();
23092309 ReplicaLocation replica = partIdWithReplica .getRight ();
23102310 ObServerAddr addr = replica .getAddr ();
23112311 ObTable obTable = tableRoster .get (addr );
@@ -2317,7 +2317,13 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23172317 addr , addrExpired );
23182318 syncRefreshMetadata ();
23192319 tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2320- replica = getPartitionLocation (tableEntry , partId , route );
2320+ if (ObGlobal .obVsnMajor () >= 4 ) {
2321+ long tabletId = getTabletIdByPartId (tableEntry , partId );
2322+ ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
2323+ replica = getPartitionLocation (locationInfo , route );
2324+ } else {
2325+ replica = getPartitionLocation (tableEntry , partId , route );
2326+ }
23212327 addr = replica .getAddr ();
23222328 obTable = tableRoster .get (addr );
23232329 }
0 commit comments