[ 
https://issues.apache.org/jira/browse/DRILL-8314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17609414#comment-17609414
 ] 

ASF GitHub Bot commented on DRILL-8314:
---------------------------------------

jnturton commented on code in PR #2655:
URL: https://github.com/apache/drill/pull/2655#discussion_r979810768


##########
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java:
##########
@@ -130,11 +132,18 @@ private static PhysicalPlan convertPlan(QueryContext 
context, String sql, Pointe
       logger.trace("There was an error during conversion into physical plan. " 
+
           "Will sync remote and local function registries if needed and retry 
" +
           "in case if issue was due to missing function implementation.", e);
-      // it is prohibited to retry query planning for ANALYZE statement since 
it changes
-      // query-level option values and will fail when rerunning with updated 
values
-      if (context.getFunctionRegistry().syncWithRemoteRegistry(
-              context.getDrillOperatorTable().getFunctionRegistryVersion())
-        && context.getSQLStatementType() != SqlStatementType.ANALYZE) {
+
+      int funcRegVer = 
context.getDrillOperatorTable().getFunctionRegistryVersion();
+      // We do not retry conversion if the error is a UserException of type 
RESOURCE
+      boolean isResourceErr = e instanceof UserException && ((UserException) 
e).getErrorType() == RESOURCE;

Review Comment:
   @vvysotskyi when plugin auto disabling is switched on then this second 
attempt to convert the query fails with an error of "schema not found" because 
the plugin has been disabled. This error isn't as informative to the user as 
the original error raised when attempting to access the plugin so I didn't want 
this to be the error that they get back...





> Add support for automatically retrying and disabling broken storage plugins
> ---------------------------------------------------------------------------
>
>                 Key: DRILL-8314
>                 URL: https://issues.apache.org/jira/browse/DRILL-8314
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Other
>    Affects Versions: 1.20.2
>            Reporter: James Turton
>            Assignee: James Turton
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> Enabled storage plugins may malfunction for different reasons, e.g. they have 
> been misconfigured or their remote data source has gone offline. Depending on 
> the plugin's implementation, this could cause it to fail to return optimizer 
> rules or register schemas. In some cases this can have a wider impact, e.g. 
> unconditioned queries against the info schema will fail if a single plugin is 
> failing in registerSchemas.
> Rather than us swallowing such errors and silently returning a subset of 
> results, this Jira proposes new features that allow firstly for the retrying 
> of attempts to get rules or schemas from a plugin and secondly for a plugin 
> to be automatically disabled after the configured maximum number of attempts 
> have failed. A broken plugin will still cause a query failure but the user 
> will be informed that the plugin has been disabled as a result. Knowing what 
> has just happened, the user can choose to reissue the query knowing that the 
> broken plugin is now disabled or they might choose to investigate the problem 
> affecting the broken plugin instead.
> These new features are optional and can be disabled using new SYSTEM options.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to