@@ -686,17 +686,8 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
686686 } else if (ex instanceof ObTableException
687687 && ((ObTableException ) ex ).isNeedRefreshTableEntry ()) {
688688 needRefreshTableEntry = true ;
689-
690- logger
691- .warn (
692- "refresh table while meet Exception needing refresh, errorCode: {}, errorMsg: {}" ,
693- ((ObTableException ) ex ).getErrorCode (), ex .getMessage ());
689+
694690 if (retryOnChangeMasterTimes && (tryTimes - 1 ) < runtimeRetryTimes ) {
695- logger
696- .warn (
697- "retry while meet Exception needing refresh, errorCode: {} , errorMsg: {},retry times {}" ,
698- ((ObTableException ) ex ).getErrorCode (), ex .getMessage (),
699- tryTimes );
700691 if (ex instanceof ObTableNeedFetchAllException ) {
701692 needFetchAllRouteInfo = true ;
702693 getOrRefreshTableEntry (tableName , true , true , true );
@@ -708,8 +699,14 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
708699 throw ex ;
709700 }
710701 } else {
702+ String logMessage = String .format (
703+ "exhaust retry while meet NeedRefresh Exception, table name: %s, batch ops refresh table, errorCode: %d" ,
704+ tableName ,
705+ ((ObTableException ) ex ).getErrorCode ()
706+ );
707+ logger .warn (logMessage , ex );
711708 calculateContinuousFailure (tableName , ex .getMessage ());
712- throw ex ;
709+ throw new ObTableRetryExhaustedException ( logMessage , ex ) ;
713710 }
714711 }
715712 }
@@ -880,24 +877,21 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
880877 throw ex ;
881878 }
882879 needRefreshTableEntry = true ;
883-
884- logger .warn (
885- "refresh table while meet Exception needing refresh, errorCode: {}, errorMsg: {}" ,
886- ((ObTableException ) ex ).getErrorCode (), ex .getMessage ());
887880 if (retryOnChangeMasterTimes && (tryTimes - 1 ) < runtimeRetryTimes ) {
888- logger .warn (
889- "retry while meet Exception needing refresh, errorCode: {} , errorMsg: {}, retry times {}" ,
890- ((ObTableException ) ex ).getErrorCode (), ex .getMessage (),
891- tryTimes );
892881 if (ex instanceof ObTableNeedFetchAllException ) {
893882 getOrRefreshTableEntry (tableName , true , true , true );
894883 // reset failure count while fetch all route info
895884 this .resetExecuteContinuousFailureCount (tableName );
896885 }
897886 } else {
887+ String logMessage = String .format (
888+ "exhaust retry while meet NeedRefresh Exception, table name: %s, batch ops refresh table, errorCode: %d" ,
889+ tableName ,
890+ ((ObTableException ) ex ).getErrorCode ()
891+ );
892+ logger .warn (logMessage , ex );
898893 calculateContinuousFailure (tableName , ex .getMessage ());
899- RUNTIME .error ("execute while meet exception" , ex );
900- throw ex ;
894+ throw new ObTableRetryExhaustedException (logMessage , ex );
901895 }
902896 } else {
903897 calculateContinuousFailure (tableName , ex .getMessage ());
0 commit comments