@@ -618,7 +618,6 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
618618 throw new IllegalArgumentException ("table name is null" );
619619 }
620620 boolean needRefreshTableEntry = false ;
621- boolean needRenew = false ;
622621 boolean needFetchAllRouteInfo = false ;
623622 int tryTimes = 0 ;
624623 long startExecute = System .currentTimeMillis ();
@@ -636,7 +635,7 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
636635 ObPair <Long , ObTableParam > obPair = null ;
637636 try {
638637 if (odpMode ) {
639- obPair = getODPTableWithRowKeyValue ( tableName , callback . getRowKey (), needRenew );
638+ obPair = new ObPair < Long , ObTableParam >( 0L , new ObTableParam ( odpTable ) );
640639 } else {
641640 obPair = getTable (tableName , callback .getRowKey (),
642641 needRefreshTableEntry , tableEntryRefreshIntervalWait ,
@@ -654,17 +653,9 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
654653 "execute while meet Exception, errorCode: {} , errorMsg: {}, try times {}" ,
655654 ((ObTableException ) ex ).getErrorCode (), ex .getMessage (),
656655 tryTimes );
657- // if the cause is that ODP partition meta have expired, try to fetch new one
658- if (ex instanceof ObTablePartitionChangeException
659- && ((ObTablePartitionChangeException ) ex ).getErrorCode () == OB_ERR_KV_ROUTE_ENTRY_EXPIRE .errorCode ) {
660- needRenew = true ;
661- } else {
662- throw ex ;
663- }
664656 } else {
665657 logger .warn ("execute while meet Exception, errorMsg: {}, try times {}" ,
666658 ex .getMessage (), tryTimes );
667- throw ex ;
668659 }
669660 } else {
670661 RUNTIME .error ("retry failed with exception" , ex );
@@ -686,7 +677,7 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
686677 } else if (ex instanceof ObTableException
687678 && ((ObTableException ) ex ).isNeedRefreshTableEntry ()) {
688679 needRefreshTableEntry = true ;
689-
680+
690681 if (retryOnChangeMasterTimes && (tryTimes - 1 ) < runtimeRetryTimes ) {
691682 if (ex instanceof ObTableNeedFetchAllException ) {
692683 needFetchAllRouteInfo = true ;
@@ -787,7 +778,7 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
787778 throw new IllegalArgumentException ("table name is null" );
788779 }
789780 boolean needRefreshTableEntry = false ;
790- boolean needRenew = false ;
781+ boolean needFetchAllRouteInfo = false ;
791782 int tryTimes = 0 ;
792783 long startExecute = System .currentTimeMillis ();
793784 while (true ) {
@@ -804,7 +795,7 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
804795 ObPair <Long , ObTableParam > obPair = null ;
805796 try {
806797 if (odpMode ) {
807- obPair = getODPTableWithRowKey ( tableName , callback . getRowKey (), needRenew );
798+ obPair = new ObPair < Long , ObTableParam >( 0L , new ObTableParam ( odpTable ) );
808799 } else {
809800 if (null != callback .getRowKey ()) {
810801 // in the case of retry, the location always needs to be refreshed here
@@ -837,20 +828,10 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
837828 "execute while meet Exception, errorCode: {} , errorMsg: {}, try times {}" ,
838829 ((ObTableException ) ex ).getErrorCode (), ex .getMessage (),
839830 tryTimes );
840- // if the cause is that ODP partition meta have expired, try to fetch new one
841- if (ex instanceof ObTablePartitionChangeException
842- && ((ObTablePartitionChangeException ) ex ).getErrorCode () == OB_ERR_KV_ROUTE_ENTRY_EXPIRE .errorCode ) {
843- needRenew = true ;
844- } else {
845- RUNTIME .error ("execute while meet exception" , ex );
846- throw ex ;
847- }
848831 } else {
849832 logger .warn (
850- "execute while meet Exception, exception: {}, try times {}" , ex ,
851- tryTimes );
852- RUNTIME .error ("execute while meet exception" , ex );
853- throw ex ;
833+ "execute while meet Exception, exception: {}, try times {}" , ex ,
834+ tryTimes );
854835 }
855836 } else {
856837 RUNTIME .error ("retry failed with exception" , ex );
@@ -870,7 +851,7 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
870851 }
871852 } else if (ex instanceof ObTableException
872853 && ((ObTableException ) ex ).isNeedRefreshTableEntry ()) {
873- // if the problem is the lack of row key name, throw directly
854+ // if the problem is the lack of row key name, throw directly
874855 if (tableRowKeyElement .get (tableName ) == null ) {
875856 logger .warn ("tableRowKeyElement not found table name: {}" , ex .getMessage ());
876857 RUNTIME .error ("tableRowKeyElement not found table name" , ex );
@@ -880,7 +861,7 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
880861 if (retryOnChangeMasterTimes && (tryTimes - 1 ) < runtimeRetryTimes ) {
881862 if (ex instanceof ObTableNeedFetchAllException ) {
882863 getOrRefreshTableEntry (tableName , true , true , true );
883- // reset failure count while fetch all route info
864+ // reset failure count while fetch all route info
884865 this .resetExecuteContinuousFailureCount (tableName );
885866 }
886867 } else {
@@ -1374,13 +1355,13 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
13741355 if (info == null ) {
13751356 throw new ObTableEntryRefreshException ("Partition info is null for tabletId=" + tabletId );
13761357 }
1377-
1358+
13781359 long lastRefreshTime = info .getLastUpdateTime ();
13791360 long currentTime = System .currentTimeMillis ();
13801361 if (currentTime - lastRefreshTime < tableEntryRefreshIntervalCeiling ) {
13811362 return tableEntry ;
13821363 }
1383-
1364+
13841365 Lock lock = info .refreshLock ;
13851366 boolean acquired = false ;
13861367 try {
@@ -1400,7 +1381,7 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
14001381 if (currentTime - lastRefreshTime < tableEntryRefreshIntervalCeiling ) {
14011382 return tableEntry ;
14021383 }
1403-
1384+
14041385 tableEntry = loadTableEntryLocationWithPriority (
14051386 serverRoster ,
14061387 tableEntryKey ,
@@ -1412,7 +1393,7 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
14121393 serverAddressCachingTimeout ,
14131394 sysUA
14141395 );
1415-
1396+
14161397 tableEntry .prepareForWeakRead (serverRoster .getServerLdcLocation ());
14171398
14181399 } finally {
@@ -1430,7 +1411,7 @@ public TableEntry refreshTableLocationByTabletId(TableEntry tableEntry, String t
14301411 RUNTIME .error (LCD .convert ("01-00020" ), tableEntryKey , tableEntry , e );
14311412 throw new ObTableEntryRefreshException (errorMsg , e );
14321413 }
1433-
1414+
14341415 tableLocations .put (tableName , tableEntry );
14351416 tableEntryRefreshContinuousFailureCount .set (0 );
14361417 return tableEntry ;
@@ -1655,7 +1636,7 @@ private ObPair<Long, ReplicaLocation> getPartitionReplica(TableEntry tableEntry,
16551636 private ReplicaLocation getPartitionLocation (TableEntry tableEntry , long partId ,
16561637 ObServerRoute route ) {
16571638 // In all cases for 3.x and for non-partitioned tables in 4.x, partId will not change.
1658- // If it is 4.x, it will be converted to tablet id.
1639+ // If it is 4.x, it will be converted to tablet id.
16591640 partId = getTabletIdByPartId (tableEntry , partId );
16601641 return tableEntry .getPartitionEntry ().getPartitionLocationWithTabletId (partId )
16611642 .getReplica (route );
@@ -1980,9 +1961,9 @@ public ObPair<Long, ObTableParam> getTableInternal(String tableName, TableEntry
19801961 obPartitionLocationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
19811962 replica = getPartitionLocation (obPartitionLocationInfo , route );
19821963 /**
1983- * Normally, getOrRefreshPartitionInfo makes sure that a thread only continues if it finds the leader
1984- * during a route refresh. But sometimes, there might not be a leader yet. In this case, the thread
1985- * is released, and since it can't get the replica, it throws an no master exception.
1964+ * Normally, getOrRefreshPartitionInfo makes sure that a thread only continues if it finds the leader
1965+ * during a route refresh. But sometimes, there might not be a leader yet. In this case, the thread
1966+ * is released, and since it can't get the replica, it throws an no master exception.
19861967 */
19871968 if (replica == null && obPartitionLocationInfo .getPartitionLocation ().getLeader () == null ) {
19881969 RUNTIME .error (LCD .convert ("01-00028" ), partitionId , tableEntry .getPartitionEntry (), tableEntry );
@@ -2023,14 +2004,14 @@ public ObPair<Long, ObTableParam> getTableInternal(String tableName, TableEntry
20232004 tableEntry = getOrRefreshTableEntry (tableName , true , waitForRefresh , false );
20242005 }
20252006 }
2026-
2007+
20272008 if (ObGlobal .obVsnMajor () >= 4 ) {
20282009 obPartitionLocationInfo = getOrRefreshPartitionInfo (tableEntry , tableName , tabletId );
20292010 replica = getPartitionLocation (obPartitionLocationInfo , route );
20302011 } else {
20312012 replica = getPartitionReplica (tableEntry , partitionId , route ).getRight ();
20322013 }
2033-
2014+
20342015 addr = replica .getAddr ();
20352016 obTable = tableRoster .get (addr );
20362017
0 commit comments