@@ -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 );
@@ -1895,9 +1897,7 @@ private ObPartitionLocationInfo getOrRefreshPartitionInfo(TableEntry tableEntry,
18951897 ObPartitionLocationInfo obPartitionLocationInfo = tableEntry .getPartitionEntry ()
18961898 .getPartitionInfo (tabletId );
18971899 if (!obPartitionLocationInfo .initialized .get ()) {
1898- if (ObGlobal .obVsnMajor () >= 4 ) {
1899- tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
1900- }
1900+ tableEntry = refreshTableLocationByTabletId (tableEntry , tableName , tabletId );
19011901 obPartitionLocationInfo = tableEntry .getPartitionEntry ().getPartitionInfo (tabletId );
19021902 obPartitionLocationInfo .initializationLatch .await ();
19031903 }
@@ -1938,9 +1938,14 @@ private List<ObPair<Long, ReplicaLocation>> getPartitionReplica(TableEntry table
19381938 List <ObPair <Long , ReplicaLocation >> replicas = new ArrayList <>();
19391939
19401940 if (!tableEntry .isPartitionTable () || tableEntry .getPartitionInfo ().getLevel () == ObPartitionLevel .LEVEL_ZERO ) {
1941- long tabletId = getTabletIdByPartId (tableEntry , 0L );
1942- ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
1943- replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
1941+ if (ObGlobal .obVsnMajor () >= 4 ) {
1942+ long tabletId = getTabletIdByPartId (tableEntry , 0L );
1943+ ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
1944+ replicas .add (new ObPair <>(tabletId , getPartitionLocation (locationInfo , route )));
1945+ } else {
1946+ replicas .add (new ObPair <Long , ReplicaLocation >(0L , getPartitionLocation (tableEntry , 0L ,
1947+ route )));
1948+ }
19441949 return replicas ;
19451950 }
19461951
0 commit comments