@@ -1364,7 +1364,7 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
13641364 RUNTIME .error ("RefreshTableEntry encountered an exception" , e );
13651365 throw e ;
13661366 } catch (Exception e ) {
1367- String errorMsg = String .format ("Failed to get table entry. Key=%s, Original TableEntry=%s" , tableEntryKey , tableEntry );
1367+ String errorMsg = String .format ("Failed to get table entry. Key=%s, Original TableEntry=%s, TabletId=%d " , tableEntryKey , tableEntry , tabletId );
13681368 RUNTIME .error (LCD .convert ("01-00020" ), tableEntryKey , tableEntry , e );
13691369 throw new ObTableEntryRefreshException (errorMsg , e );
13701370 }
@@ -1939,7 +1939,7 @@ private List<Long> getPartitionTablePartitionIds(TableEntry tableEntry,
19391939 }
19401940 }
19411941
1942- private long getTabletIdByPartId (TableEntry tableEntry , Long partId ) {
1942+ public long getTabletIdByPartId (TableEntry tableEntry , Long partId ) {
19431943 if (ObGlobal .obVsnMajor () >= 4 && tableEntry .isPartitionTable ()) {
19441944 ObPartitionInfo partInfo = tableEntry .getPartitionInfo ();
19451945 Map <Long , Long > tabletIdMap = partInfo .getPartTabletIdMap ();
@@ -2032,17 +2032,17 @@ public List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuery
20322032 ObServerAddr addr = replica .getAddr ();
20332033 ObTable obTable = tableRoster .get (addr );
20342034 boolean addrExpired = addr .isExpired (serverAddressCachingTimeout );
2035- // if (addrExpired || obTable == null) {
2036- // logger
2037- // .warn(
2038- // "server address {} is expired={} or can not get ob table. So that will sync refresh metadata",
2039- // addr, addrExpired);
2040- // syncRefreshMetadata();
2041- // tableEntry = getOrRefreshTableEntry(tableName, true, waitForRefresh, false);
2042- // replica = getPartitionLocation(tableEntry, partId , route);
2043- // addr = replica.getAddr();
2044- // obTable = tableRoster.get(addr);
2045- // }
2035+ if (addrExpired || obTable == null ) {
2036+ logger
2037+ .warn (
2038+ "server address {} is expired={} or can not get ob table. So that will sync refresh metadata" ,
2039+ addr , addrExpired );
2040+ syncRefreshMetadata ();
2041+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2042+ replica = getPartitionLocation (tableEntry , tabletId , route );
2043+ addr = replica .getAddr ();
2044+ obTable = tableRoster .get (addr );
2045+ }
20462046
20472047 if (obTable == null ) {
20482048 RUNTIME .error ("cannot get table by addr: " + addr );
0 commit comments