@@ -1365,7 +1365,7 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
13651365 RUNTIME .error ("RefreshTableEntry encountered an exception" , e );
13661366 throw e ;
13671367 } catch (Exception e ) {
1368- String errorMsg = String .format ("Failed to get table entry. Key=%s, Original TableEntry=%s" , tableEntryKey , tableEntry );
1368+ String errorMsg = String .format ("Failed to get table entry. Key=%s, Original TableEntry=%s, TabletId=%d " , tableEntryKey , tableEntry , tabletId );
13691369 RUNTIME .error (LCD .convert ("01-00020" ), tableEntryKey , tableEntry , e );
13701370 throw new ObTableEntryRefreshException (errorMsg , e );
13711371 }
@@ -1949,7 +1949,7 @@ private List<Long> getPartitionTablePartitionIds(TableEntry tableEntry,
19491949 }
19501950 }
19511951
1952- private long getTabletIdByPartId (TableEntry tableEntry , Long partId ) {
1952+ public long getTabletIdByPartId (TableEntry tableEntry , Long partId ) {
19531953 if (ObGlobal .obVsnMajor () >= 4 && tableEntry .isPartitionTable ()) {
19541954 ObPartitionInfo partInfo = tableEntry .getPartitionInfo ();
19551955 Map <Long , Long > tabletIdMap = partInfo .getPartTabletIdMap ();
@@ -2041,17 +2041,17 @@ public List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuery
20412041 ObServerAddr addr = replica .getAddr ();
20422042 ObTable obTable = tableRoster .get (addr );
20432043 boolean addrExpired = addr .isExpired (serverAddressCachingTimeout );
2044- // if (addrExpired || obTable == null) {
2045- // logger
2046- // .warn(
2047- // "server address {} is expired={} or can not get ob table. So that will sync refresh metadata",
2048- // addr, addrExpired);
2049- // syncRefreshMetadata();
2050- // tableEntry = getOrRefreshTableEntry(tableName, true, waitForRefresh, false);
2051- // replica = getPartitionLocation(tableEntry, partId , route);
2052- // addr = replica.getAddr();
2053- // obTable = tableRoster.get(addr);
2054- // }
2044+ if (addrExpired || obTable == null ) {
2045+ logger
2046+ .warn (
2047+ "server address {} is expired={} or can not get ob table. So that will sync refresh metadata" ,
2048+ addr , addrExpired );
2049+ syncRefreshMetadata ();
2050+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2051+ replica = getPartitionLocation (tableEntry , tabletId , route );
2052+ addr = replica .getAddr ();
2053+ obTable = tableRoster .get (addr );
2054+ }
20552055
20562056 if (obTable == null ) {
20572057 RUNTIME .error ("cannot get table by addr: " + addr );
0 commit comments