Caideyipi commented on code in PR #19098:
URL: https://github.com/apache/iotdb/pull/19098#discussion_r4452204665


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java:
##########
@@ -898,6 +899,16 @@ private void executeTabletConversionOnException(
 
   private boolean setTemporaryUnavailableStatusIfNecessary(
       final IAnalysis analysis, final Throwable throwable) {
+    if (throwable instanceof IoTDBRuntimeException
+        && ((IoTDBRuntimeException) throwable).getErrorCode()
+            == TSStatusCode.NO_AVAILABLE_REGION_GROUP.getStatusCode()) {
+      analysis.setFinishQueryAfterAnalyze(true);
+      analysis.setFailStatus(
+          RpcUtils.getStatus(
+              TSStatusCode.LOAD_TEMPORARY_UNAVAILABLE_EXCEPTION, 
throwable.getMessage()));
+      setRealStatement(analysis);
+      return true;
+    }

Review Comment:
   It cannot be distinguished from status 906 alone. `RegionWriteExecutor` also 
returns `NO_AVAILABLE_REGION_GROUP` when the local region lock is missing or 
the consensus group does not exist, so the status does not prove that recovery 
is in progress.
   
   The contract here is to retain the TsFile and retry region-unavailable 
errors. A genuinely missing region can therefore continue to produce retries 
and needs operator intervention; this change does not diagnose or repair 
permanent region loss. Other schema-error statuses keep their existing failure 
behavior.
   
   I corrected the comments in the schema verifier and LOAD analyzer in 
6ac971c08673bc50c382e64d6b67b790cf9d96ca to make that boundary explicit. This 
is a comment-only clarification, and Spotless passed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to