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

Ravi Kishore Valeti edited comment on PHOENIX-1212 at 9/4/14 6:43 AM:
----------------------------------------------------------------------

[~jamestaylor]

Please find my answers below.

Is it only when you open the first connection and the Phoenix client attempts 
an upgrade from 2.2.x to 3.x? Or is this in general?
 => This is coming on a fresh deployment in a general case when multiple nodes 
try to boot the app in parallel.  Not related to upgrading phoenix versions.

We do need to disable the HBase table initially as well to add the Phoenix 
coprocessors, so perhaps it's happening then?
  => Yes. Since the HTable already exists and we are trying to add Phoenix 
Coprocessors to the existing one - During this time, we had to disable the 
table and re-enable the table and hence other threads performing the same 
"create table if not exists" operation are getting a PhoenixIOException.

In the clients getting this error, does it cause problems afterwards, or can 
the exception be ignored and you can issue SQL queries against the new table?
=> Phoenix is wrapping the original TableNotFoundException with 
PhoenixIOException . Clients may not ignore this exception because it does not 
know whether the other client instances performing the same operation succeeds).

I believe that from a client's perspective, "create table if not exists" should 
not throw any exception. Phoenix needs to serialize these concurrent create 
operations so that clients do not fail on this operation.

Thoughts?


was (Author: rvaleti):
[~jamestaylor]

Please find my answers below.

Is it only when you open the first connection and the Phoenix client attempts 
an upgrade from 2.2.x to 3.x? Or is this in general?
 => This is coming on a fresh deployment in a general case.  Not related to 
upgrading phoenix versions.

We do need to disable the HBase table initially as well to add the Phoenix 
coprocessors, so perhaps it's happening then?
  => Yes. Since the HTable already exists and we are trying to add Phoenix 
Coprocessors to the existing one - During this time, we had to disable the 
table and re-enable the table and hence other threads performing the same 
"create table if not exists" operation are getting a PhoenixIOException.

In the clients getting this error, does it cause problems afterwards, or can 
the exception be ignored and you can issue SQL queries against the new table?
=> Phoenix is wrapping the original TableNotFoundException with 
PhoenixIOException . Clients may not ignore this exception because it does not 
know whether the other client instances performing the same operation succeeds).

I believe that from a client's perspective, "create table if not exists" should 
not throw any exception. Phoenix needs to serialize these concurrent create 
operations so that clients do not fail on this operation.

Thoughts?

> Create table if not exists throws TableNotEnaledException while promoting 
> Hbase Table to Phoenix
> ------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1212
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1212
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.1
>            Reporter: Ravi Kishore Valeti
>            Priority: Minor
>              Labels: Phoenix
>
> When multiple threads run "create table if not exists" concurrently on a 
> pre-existing HBase Table, only one succeedes and others fail with 
> org.apache.phoenix.exception.PhoenixIOException: 
> org.apache.hadoop.hbase.TableNotEnabledException: TEST_11
>       at 
> org.apache.hadoop.hbase.master.handler.DisableTableHandler.prepare(DisableTableHandler.java:100)
>       .
>       .
>       .
>       .
>       at 
> org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:101)
>       at 
> org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:846)
>       at 
> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1057)
>       at 
> org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1156)
>       at 
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:422)
>       at 
> org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:183)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:226)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:908)
>       at com.test.phoenix.PhoenixClient.executeUpdate(PhoenixClient.java:170)
>       at 
> PhoenixCreateTableTest$TableCreateThread.run(PhoenixCreateTableTest.java:50)
>       at java.lang.Thread.run(Thread.java:745)
> i) Create a Table from Hbase Shell
> > create "TEST_PHOENIX","cf"
> ii) Run a Test with multiple Threads trying to execute Phoenix Query "create 
> table if not exists" query
> create table if not exists "TEST_PHOENIX" ("role" VARCHAR primary key, 
> "cf"."hosts" VARCHAR)
> Only one thread will succeed and rest all would end up with the above 
> exception



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to