Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/295#discussion_r178933517 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java --- @@ -1039,10 +1065,20 @@ private HTableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType } } + if (isMetaTable && SchemaUtil.isNamespaceMappingEnabled(PTableType.SYSTEM, --- End diff -- The ensureSystemTablesMigratedToSystemNamespace has race conditions in the case of multiple clients executing it at the same time. We should treat this as an upgrade step and do it while we have the SYSTEM.MUTEX lock (which ensures only a single client will be executing upgrade code).
---