phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Kishore Valeti (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-1212) Create table if not exists throws TableNotEnaledException while promoting Hbase Table to Phoenix
Date Thu, 04 Sep 2014 06:42:51 GMT


Ravi Kishore Valeti commented on PHOENIX-1212:


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

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.


> Create table if not exists throws TableNotEnaledException while promoting Hbase Table
to Phoenix
> ------------------------------------------------------------------------------------------------
>                 Key: PHOENIX-1212
>                 URL:
>             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:
> 	at org.apache.hadoop.hbase.master.handler.DisableTableHandler.prepare(
>       .
>       .
>       .
>       .
> 	at org.apache.phoenix.util.ServerUtil.parseServerException(
> 	at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(
> 	at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(
> 	at org.apache.phoenix.schema.MetaDataClient.createTableInternal(
> 	at org.apache.phoenix.schema.MetaDataClient.createTable(
> 	at org.apache.phoenix.compile.CreateTableCompiler$2.execute(
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(
> 	at com.test.phoenix.PhoenixClient.executeUpdate(
> 	at PhoenixCreateTableTest$
> 	at
> 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

View raw message