@@ -792,7 +792,9 @@ private <T> T executeMutation(String tableName, MutationExecuteCallback<T> callb
792792 if (tryTimes > 1 ) {
793793 TableEntry entry = getOrRefreshTableEntry (tableName , false , false , false );
794794 Long partId = getPartition (entry , callback .getRowKey ());
795- refreshTableLocationByTabletId (entry , tableName , getTabletIdByPartId (entry , partId ));
795+ if (ObGlobal .obVsnMajor () >= 4 ) {
796+ refreshTableLocationByTabletId (entry , tableName , getTabletIdByPartId (entry , partId ));
797+ }
796798 }
797799 // using row key
798800 obPair = getTable (tableName , callback .getRowKey (), needRefreshTableEntry , tableEntryRefreshIntervalWait , false , route );
@@ -1661,7 +1663,7 @@ private ObPair<Long, ObTableParam> getTable(String tableName, Object[] rowKey,
16611663 }
16621664
16631665 long partId = getPartition (tableEntry , row ); // partition id in 3.x, origin partId in 4.x, logicId
1664- if (refresh ) {
1666+ if (refresh && ObGlobal . obVsnMajor () >= 4 ) {
16651667 refreshTableLocationByTabletId (tableEntry , tableName , getTabletIdByPartId (tableEntry , partId ));
16661668 }
16671669 return getTableInternal (tableName , tableEntry , partId , waitForRefresh , route );
@@ -1905,9 +1907,7 @@ private ObPartitionLocationInfo getOrRefreshPartitionInfo(TableEntry tableEntry,
19051907 ObPartitionLocationInfo obPartitionLocationInfo = tableEntry .getPartitionEntry ()
19061908 .getPartitionInfo (tabletId );
19071909 if (!obPartitionLocationInfo .initialized .get ()) {
1908- if (ObGlobal .obVsnMajor () >= 4 ) {
1909- tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
1910- }
1910+ tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
19111911 obPartitionLocationInfo = tableEntry .getPartitionEntry ().getPartitionInfo (tabletId );
19121912 obPartitionLocationInfo .initializationLatch .await ();
19131913 }
@@ -1948,9 +1948,14 @@ private List<ObPair<Long, ReplicaLocation>> getPartitionReplica(TableEntry table
19481948 List <ObPair <Long , ReplicaLocation >> replicas = new ArrayList <>();
19491949
19501950 if (!tableEntry .isPartitionTable () || tableEntry .getPartitionInfo ().getLevel () == ObPartitionLevel .LEVEL_ZERO ) {
1951- long tabletId = getTabletIdByPartId (tableEntry , 0L );
1952- ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
1953- replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
1951+ if (ObGlobal .obVsnMajor () >= 4 ) {
1952+ long tabletId = getTabletIdByPartId (tableEntry , 0L );
1953+ ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
1954+ replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
1955+ } else {
1956+ replicas .add (new ObPair <Long , ReplicaLocation >(0L , getPartitionLocation (tableEntry , 0L ,
1957+ route )));
1958+ }
19541959 return replicas ;
19551960 }
19561961
0 commit comments