@@ -2019,21 +2019,21 @@ public ObPair<Long, ObTableParam> getTableInternal(String tableName, TableEntry
20192019 }
20202020 ObServerAddr addr = replica .getAddr ();
20212021 ObTable obTable = tableRoster .get (addr );
2022-
2023- if (obTable == null || addr . isExpired ( serverAddressCachingTimeout ) ) {
2022+ boolean addrExpired = addr . isExpired ( serverAddressCachingTimeout );
2023+ if (obTable == null || addrExpired ) {
20242024 if (obTable == null ) {
20252025 logger .warn ("Cannot get ObTable by addr {}, refreshing metadata." , addr );
20262026 syncRefreshMetadata ();
20272027 }
20282028 if (addr .isExpired (serverAddressCachingTimeout )) {
20292029 logger .info ("Server addr {} is expired, refreshing tableEntry." , addr );
2030+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , true );
20302031 }
20312032
20322033 if (ObGlobal .obVsnMajor () >= 4 ) {
20332034 obPartitionLocationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
20342035 replica = getPartitionLocation (obPartitionLocationInfo , route );
20352036 } else {
2036- tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
20372037 replica = getPartitionReplica (tableEntry , partitionId , route ).getRight ();
20382038 }
20392039
@@ -2311,12 +2311,14 @@ private List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuer
23112311 ObTable obTable = tableRoster .get (addr );
23122312 boolean addrExpired = addr .isExpired (serverAddressCachingTimeout );
23132313 if (addrExpired || obTable == null ) {
2314- logger
2315- .warn (
2316- "server address {} is expired={} or can not get ob table. So that will sync refresh metadata" ,
2317- addr , addrExpired );
2318- syncRefreshMetadata ();
2319- tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
2314+ if (obTable == null ) {
2315+ logger .warn ("Cannot get ObTable by addr {}, refreshing metadata." , addr );
2316+ syncRefreshMetadata ();
2317+ }
2318+ if (addrExpired ) {
2319+ logger .info ("Server addr {} is expired, refreshing tableEntry." , addr );
2320+ tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , true );
2321+ }
23202322 if (ObGlobal .obVsnMajor () >= 4 ) {
23212323 long tabletId = getTabletIdByPartId (tableEntry , partId );
23222324 ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
0 commit comments