[ https://issues.apache.org/jira/browse/PHOENIX-4523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16321313#comment-16321313 ]
Flavio Pompermaier edited comment on PHOENIX-4523 at 1/11/18 5:26 PM: ---------------------------------------------------------------------- Sorry guys but I'm in Italy and we we have different time zones..tomorrow (10 hours) I'll give you detailed answers. What I can say right now is that, for what is the current usage of getSystemTableNames(), it should return an empty list when schemas are enabled. The only case when this is not true is within createSysMutexTable(), where it should be checked that the mutex table exists or not. I think that my patch (proposed some comments ago) could be enough for the moment. Btw, tomorrow I'll reply to all of your obsevations in detail PS: the upgrade was already performed. The problem is indeed that every time I connect there's an atrempt to create the mutex table and put a lock inside it (and this is a problem if multiple connections are created simultaneously) was (Author: f.pompermaier): Sorry guys but I'm in Italy and we we have different time zones..tomorrow (10 hours) I'll give you detailed answers. What I can say right now is that, for what is the current usage of getSystemTableNames(), it should return an empty list when schemas are enabled. The only case when this is not true is within createSysMutexTable(), where it should be checked that the mutex table exists or not. I think that my patch (proposed some comments ago) could be enough for the moment. Btw, tomorrow I'll reply to all of your obsevations in detail PS: the upgrade was already performed. The problem is indeed that every time I connect there's an atrempt to create the mutex table and put a lock inside it (and this is a problem if multiple connections are created simultaneously) On 10 Jan 2018 23:00, "James Taylor (JIRA)" <j...@apache.org> wrote: [ https://issues.apache.org/jira/browse/PHOENIX-4523?page= com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel&focusedCommentId=16321180#comment-16321180 ] James Taylor commented on PHOENIX-4523: --------------------------------------- Thanks for taking this up, [~karanmehta93]! bq. According to Flavio Pompermaier, the cluster is already migrated. So the ensureSystemTablesMigratedToSystemNamespace() method is almost short-circuited. There might be a corner case here, as Flavio is upgrading from 4.7 (which didn't have SYSTEM.MUTEX) to 4.13 (which requires/expects it). Not sure if that method is short-circuited in that case. bq. I checked out the tag v4.13.1-HBase-1.2-rc0 and the only place createSysMutexTable() method is called is inside createOtherSystemTables() method. Flavio is using the 4.13 CDH branch which would have a call to createSysMutexTable() from ensureSystemTablesMigratedToSystemNamespace(). I suspect that's the call that's failing. If you want to try to repro it, you can use master - I don't think this issue is specific the HBase version. It might be specific to upgrading from 4.7 to 4.13. bq. I will put up a patch once these things are confirmed. Thanks - is there anything else that needs to be confirmed? Feel free to drop a patch here and Flavio can let you know if it solves the issue he's seeing. code unusable. releases. exception: RemoteException(org.apache.hadoop.hbase.TableExistsException): SYSTEM:MUTEX ConnectionQueryServicesImpl.java:2492) ConnectionQueryServicesImpl.java:2384) PhoenixContextExecutor.java:76) ConnectionQueryServicesImpl.java:2384) PhoenixDriver.java:255) PhoenixEmbeddedDriver.java:150) PhoenixDriver.java:221) recreated, and this cannot be done simultaneously. the call to getSystemTableNames() always return an empty array and the SYSTEM:MUTEX table is always recreated. tables have namespace enabled. Right now that method tries to get all tables starting with *SYSTEM.\**, while it should try to get the list of *SYSTEM:\** tables.. -- This message was sent by Atlassian JIRA (v6.4.14#64029) > phoenix.schema.isNamespaceMappingEnabled problem > ------------------------------------------------ > > Key: PHOENIX-4523 > URL: https://issues.apache.org/jira/browse/PHOENIX-4523 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.13.1 > Reporter: Flavio Pompermaier > Assignee: Karan Mehta > Attachments: PHOENIX-4523.001.patch > > > I'm using Phoenix 4.13 for CDH 5.11.2 parcel and enabling schemas made my > code unusable. > I think that this is not a bug of the CDH release, but of all 4.13.x releases. > I have many parallel Phoenix connections and I always get the following > exception: > {code:java} > Caused by: java.sql.SQLException: > org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hbase.TableExistsException): > SYSTEM:MUTEX > at > org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2492) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2384) > at > org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2384) > at > org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255) > at > org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150) > at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:270) > {code} > This is caused by the fact that all the times the SYSTEM tables are > recreated, and this cannot be done simultaneously. > Trying to debug the issue I found that in > ConnectionQueryServicesImpl.createSysMutexTable() the call to > getSystemTableNames() always return an empty array and the SYSTEM:MUTEX > table is always recreated. > This because getSystemTableNames() doesn't consider the case when system > tables have namespace enabled. Right now that method tries to get all tables > starting with *SYSTEM.\**, while it should try to get the list of *SYSTEM:\** > tables.. > I hope this could get fixed very soon, > Flavio -- This message was sent by Atlassian JIRA (v6.4.14#64029)