Github user ChinmaySKulkarni commented on a diff in the pull request: https://github.com/apache/phoenix/pull/295#discussion_r178959364 --- 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 -- @JamesRTaylor We already try to acquire a lock in the SYSMUTEX table inside _ensureSystemTablesMigratedToSystemNamespace_ before we start migrating SYSTEM tables to the SYSTEM namespace, so race conditions shouldn't be a problem here, right? In case multiple clients execute this simultaneously, still only 1 would be able to migrate the tables. On a side-note, I still think it logically makes sense to move this to inside _upgradeSystemTables_ for consistency with the method definition.
---