@@ -814,7 +814,9 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
814814 if (tryTimes > 1 ) {
815815 TableEntry entry = getOrRefreshTableEntry (tableName , false , false , false );
816816 Long partId = getPartition (entry , callback .getRowKey ());
817- refreshTableLocationByTabletId (entry , tableName , getTabletIdByPartId (entry , partId ));
817+ if (ObGlobal .obVsnMajor () >= 4 ) {
818+ refreshTableLocationByTabletId (entry , tableName , getTabletIdByPartId (entry , partId ));
819+ }
818820 }
819821 // using row key
820822 obPair = getTable (tableName , callback .getRowKey (), needRefreshTableEntry , tableEntryRefreshIntervalWait , false , route );
@@ -1692,7 +1694,7 @@ private ObPair<Long, ObTableParam> getTable(String tableName, Object[] rowKey,
16921694 }
16931695
16941696 long partId = getPartition (tableEntry , row ); // partition id in 3.x, origin partId in 4.x, logicId
1695- if (refresh ) {
1697+ if (refresh && ObGlobal . obVsnMajor () >= 4 ) {
16961698 refreshTableLocationByTabletId (tableEntry , tableName , getTabletIdByPartId (tableEntry , partId ));
16971699 }
16981700 return getTableInternal (tableName , tableEntry , partId , waitForRefresh , route );
@@ -2003,9 +2005,7 @@ private ObPartitionLocationInfo getOrRefreshPartitionInfo(TableEntry tableEntry,
20032005 ObPartitionLocationInfo obPartitionLocationInfo = tableEntry .getPartitionEntry ()
20042006 .getPartitionInfo (tabletId );
20052007 if (!obPartitionLocationInfo .initialized .get ()) {
2006- if (ObGlobal .obVsnMajor () >= 4 ) {
2007- tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
2008- }
2008+ tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
20092009 obPartitionLocationInfo = tableEntry .getPartitionEntry ().getPartitionInfo (tabletId );
20102010 obPartitionLocationInfo .initializationLatch .await ();
20112011 }
@@ -2063,9 +2063,14 @@ private List<ObPair<Long, ReplicaLocation>> getPartitionReplica(TableEntry table
20632063 List <ObPair <Long , ReplicaLocation >> replicas = new ArrayList <>();
20642064
20652065 if (!tableEntry .isPartitionTable () || tableEntry .getPartitionInfo ().getLevel () == ObPartitionLevel .LEVEL_ZERO ) {
2066- long tabletId = getTabletIdByPartId (tableEntry , 0L );
2067- ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
2068- replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
2066+ if (ObGlobal .obVsnMajor () >= 4 ) {
2067+ long tabletId = getTabletIdByPartId (tableEntry , 0L );
2068+ ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
2069+ replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
2070+ } else {
2071+ replicas .add (new ObPair <Long , ReplicaLocation >(0L , getPartitionLocation (tableEntry , 0L ,
2072+ route )));
2073+ }
20692074 return replicas ;
20702075 }
20712076
0 commit comments