You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2026/10/05 19:14:51 UTC

(asterixdb) branch master updated: [ASTERIXDB-3929][API] Code a failure to reach the CC

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d57ee72a5 [ASTERIXDB-3929][API] Code a failure to reach the CC
2d57ee72a5 is described below

commit 2d57ee72a5a616a3eb1cdc11dd351728ab9d65a9
Author: Michael Blow <mi...@couchbase.com>
AuthorDate: Mon Oct 5 12:23:14 2026 -0400

    [ASTERIXDB-3929][API] Code a failure to reach the CC
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details: A query received by an NC while the CC is down or restarting
    fails as soon as the NC tries to hand it to the CC, with a bare
    IPCException. That carries no error code, so it is reported as an
    internal error, even though the request was never run and is safe to
    retry.
    
    Report it as REJECT_CC_UNREACHABLE instead. The HTTP status is
    unchanged: the servlet already answers 503 for an IPCException cause.
    
    Ext-ref: MB-74318
    Generated-by: Claude Opus 5.5 <no...@anthropic.com>
    Change-Id: I86f55f0b3f3df0533ef1710a997017c1e3c345c3
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21995
    Reviewed-by: Michael Blow <mb...@apache.org>
    Reviewed-by: Ali Alsuliman <al...@gmail.com>
    Tested-by: Michael Blow <mb...@apache.org>
---
 .../org/apache/asterix/api/http/server/NCQueryServiceServlet.java  | 7 ++++++-
 .../main/java/org/apache/asterix/common/exceptions/ErrorCode.java  | 1 +
 .../asterix-common/src/main/resources/asx_errormsg/en.properties   | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java
index e43da3fb16..edba5962d3 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java
@@ -112,7 +112,12 @@ public class NCQueryServiceServlet extends QueryServiceServlet {
                     sessionOutput, resultProperties, param, optionalParameters, statementParameters, ncCtx,
                     responseFuture, queryLanguage, handleUrl, stmtCategoryRestrictionMask, false);
             executionState.start();
-            ncMb.sendMessageToPrimaryCC(requestMsg);
+            try {
+                ncMb.sendMessageToPrimaryCC(requestMsg);
+            } catch (IPCException e) {
+                // the request never reached the CC, e.g. because it is down or restarting
+                throw new RuntimeDataException(ErrorCode.REJECT_CC_UNREACHABLE, e);
+            }
             try {
                 responseMsg = (ExecuteStatementResponseMessage) responseFuture.get(timeout, TimeUnit.MILLISECONDS);
             } catch (InterruptedException e) {
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 45a3a0cecc..b66ad7ca7d 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -106,6 +106,7 @@ public enum ErrorCode implements IError {
     ICEBERG_VARIANT_BOUNDS_NOT_EVALUATED(75),
     TIME_ZONE_ID_IGNORED(76),
     REJECT_NODE_RESTARTING(77),
+    REJECT_CC_UNREACHABLE(78),
     UNSUPPORTED_JRE(100),
 
     EXTERNAL_UDF_RESULT_TYPE_ERROR(200),
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index ad93ca443f..ff3eebc9b1 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -112,6 +112,7 @@
 75 = Iceberg variant bounds for '%1$s' could not be evaluated; the query is correct but reads more data files than necessary
 76 = Timezone '%1$s' could not be resolved and was ignored; temporal values adjusted to UTC are read without an offset. Recreate the external collection with a valid '%2$s'
 77 = Cannot execute request, node is restarting
+78 = Cannot execute request, cluster controller is unreachable
 
 100 = Unsupported JRE: %1$s