You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "cryptoe (via GitHub)" <gi...@apache.org> on 2023/03/13 12:11:50 UTC

[GitHub] [druid] cryptoe opened a new pull request, #13926: Adding query stack fault to MSQ to capture native query errors.

cryptoe opened a new pull request, #13926:
URL: https://github.com/apache/druid/pull/13926

   <!-- Thanks for trying to help us make Apache Druid be the best it can be! Please fill out as much of the following information as is possible (where relevant, and remove it when irrelevant) to help make the intention and scope of this PR clear in order to ease review. -->
   
   <!-- Please read the doc for contribution (https://github.com/apache/druid/blob/master/CONTRIBUTING.md) before making this PR. Also, once you open a PR, please _avoid using force pushes and rebasing_ since these make it difficult for reviewers to see what you've changed in response to their reviews. See [the 'If your pull request shows conflicts with master' section](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#if-your-pull-request-shows-conflicts-with-master) for more details. -->
   
   #### Description
   
   * Add a new fault "QueryStackFault" to MSQ engine to capture native query errors. 
   * Fixed bug in MSQ fault tolerance where worker were being retried if `UnexpectedMultiValueDimensionException` was thrown.
   
   
   
   
   
   #### Release note
   Add a new fault "QueryStackFault" to MSQ engine to capture native query errors. 
   Fixed bug in MSQ fault tolerance where worker were being retried if `UnexpectedMultiValueDimensionException` was thrown.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `MSQErrorReport`
    * `QueryStackFault`
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] cryptoe commented on pull request #13926: Adding query stack fault to MSQ to capture native query errors.

Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on PR #13926:
URL: https://github.com/apache/druid/pull/13926#issuecomment-1467507516

   I earlier made changes in BaseLeafFrameProcessor#runIncrementally method but since that would also throw FrameSpecific exceptions I dropped that idea. 
   
   
   > There is a new error code QueryStackError that is only used in one case: when the query stack throws UnexpectedMultiValueDimensionException. Did you mean to associate this error code with more kinds of problems?
   
   I was thinking we would eventually add more errors and `UnexpectedMultiValueDimensionException` is just the start. 
   
   Another approach was to get the exception and check if the exception class name starts with `org.apache.druid.query` . It might be a hack but it may work for about 10 exceptions. WDYT ?
   
   <img width="611" alt="Screenshot 2023-03-14 at 12 42 18 PM" src="https://user-images.githubusercontent.com/2260045/224923303-d70356e4-bf8f-40b9-810e-804efc0baa99.png">
   
   > If we keep this design, also, to me QueryRuntimeError makes more sense than QueryStackError
   
   Sure I can rename `QueryStackError` to `QueryRuntimeError`. 
   
   
    


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] LakshSingla commented on a diff in pull request #13926: Adding query stack fault to MSQ to capture native query errors.

Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #13926:
URL: https://github.com/apache/druid/pull/13926#discussion_r1155819906


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/QueryStackFault.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.msq.indexing.error;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import java.util.Objects;
+
+/**
+ * Fault to throw when the error cames from the druid native query stack while running in the MSQ engine .

Review Comment:
   ```suggestion
    * Encapsulates the native query stack errors
   ```



##########
docs/multi-stage-query/reference.md:
##########
@@ -679,6 +679,7 @@ The following table describes error codes you may encounter in the `multiStageQu
 | <a name="error_InsertTimeOutOfBounds">`InsertTimeOutOfBounds`</a> | A REPLACE query generated a timestamp outside the bounds of the TIMESTAMP parameter for your OVERWRITE WHERE clause.<br /> <br />To avoid this error, verify that the you specified is valid. | `interval`: time chunk interval corresponding to the out-of-bounds timestamp |
 | <a name="error_InvalidNullByte">`InvalidNullByte`</a> | A string column included a null byte. Null bytes in strings are not permitted. | `column`: The column that included the null byte |
 | <a name="error_QueryNotSupported">`QueryNotSupported`</a> | QueryKit could not translate the provided native query to a multi-stage query.<br /> <br />This can happen if the query uses features that aren't supported, like GROUPING SETS. | |
+| <a name="error_QueryStackError">`QueryStackError`</a> | MSQ uses the native query engine to run the leaf stages. This error tells MSQ that error is in native query engine.<br /> <br /> Since this is a generic error, the user needs to look at the error message and stack trace to figure out the course of action. If the user is stuck, consider raising a github issue for assistance. |  `baseErrorMessage` error message from the native stack. |

Review Comment:
   We should rename either the description here to mention `QueryStack` (which seems incomplete, or rename the fault to `QueryStackErrorFault` because all of the faults in the docs are derived from their class names by removing the `-Fault` suffix.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] cryptoe merged pull request #13926: Adding query stack fault to MSQ to capture native query errors.

Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe merged PR #13926:
URL: https://github.com/apache/druid/pull/13926


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] abhishekrb19 commented on a diff in pull request #13926: Adding query stack fault to MSQ to capture native query errors.

Posted by "abhishekrb19 (via GitHub)" <gi...@apache.org>.
abhishekrb19 commented on code in PR #13926:
URL: https://github.com/apache/druid/pull/13926#discussion_r1140710470


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/QueryStackFault.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.msq.indexing.error;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import java.util.Objects;
+
+/**
+ * Fault to throw when the error cames from the druid native query stack while running in the MSQ engine .

Review Comment:
   ```suggestion
    * Fault to throw when the error comes from the druid native query stack while running in the MSQ engine.
   ```



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org