[ 
https://issues.apache.org/jira/browse/IMPALA-8117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sahil Takiar updated IMPALA-8117:
---------------------------------
    Description: 
If you run {{alter table simple set tblproperties ('kudu.master_addresses' = 
'[...]')}}, Impala will not validate that the underlying Kudu table for 
{{simple}} exists on the new Kudu master.

The bug is due to an issue in the code for 
{{KuduCatalogOpExecutor.validateKuduTblExists}}:

{code:java}
    KuduClient kudu = KuduUtil.getKuduClient(masterHosts);
    try {
      kudu.tableExists(kuduTableName);
    } catch (Exception e) {
      // TODO: This is misleading when there are other errors, e.g. timeouts.
      throw new ImpalaRuntimeException(String.format("Kudu table '%s' does not 
exist " +
          "on master '%s'", kuduTableName, masterHosts), e);
    }
{code}

The issue is that {{kudu.tableExists}} returns {{true}} if the table exists, 
{{false}} if it does not. So this method does not actually check if the table 
exists.

I went through the rest of the code in {{KuduCatalogOpExecutor}} and it looks 
like all other uses of {{kudu.tableExists}} properly check the return value of 
the method.

  was:
The code for {{KuduCatalogOpExecutor.validateKuduTblExists}} is:

{code:java}
    KuduClient kudu = KuduUtil.getKuduClient(masterHosts);
    try {
      kudu.tableExists(kuduTableName);
    } catch (Exception e) {
      // TODO: This is misleading when there are other errors, e.g. timeouts.
      throw new ImpalaRuntimeException(String.format("Kudu table '%s' does not 
exist " +
          "on master '%s'", kuduTableName, masterHosts), e);
    }
{code}

The issue is that {{kudu.tableExists}} returns {{true}} if the table exists, 
{{false}} if it does not. So this method does not actually check if the table 
exists.

I went through the rest of the code in {{KuduCatalogOpExecutor}} and it looks 
like all other uses of {{kudu.tableExists}} properly check the return value of 
the method.

Currently, the only codepath that uses this method is {{alter table ... set 
tblproperties}}. It validates that the Kudu table is accessible after setting 
the new properties (which could include changing the value of the Kudu table or 
master address.


> alter table set properties on Kudu table does not validate existence of table 
> on new master
> -------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-8117
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8117
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Catalog
>            Reporter: Sahil Takiar
>            Assignee: Sahil Takiar
>            Priority: Major
>
> If you run {{alter table simple set tblproperties ('kudu.master_addresses' = 
> '[...]')}}, Impala will not validate that the underlying Kudu table for 
> {{simple}} exists on the new Kudu master.
> The bug is due to an issue in the code for 
> {{KuduCatalogOpExecutor.validateKuduTblExists}}:
> {code:java}
>     KuduClient kudu = KuduUtil.getKuduClient(masterHosts);
>     try {
>       kudu.tableExists(kuduTableName);
>     } catch (Exception e) {
>       // TODO: This is misleading when there are other errors, e.g. timeouts.
>       throw new ImpalaRuntimeException(String.format("Kudu table '%s' does 
> not exist " +
>           "on master '%s'", kuduTableName, masterHosts), e);
>     }
> {code}
> The issue is that {{kudu.tableExists}} returns {{true}} if the table exists, 
> {{false}} if it does not. So this method does not actually check if the table 
> exists.
> I went through the rest of the code in {{KuduCatalogOpExecutor}} and it looks 
> like all other uses of {{kudu.tableExists}} properly check the return value 
> of the method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to