[ https://issues.apache.org/jira/browse/PHOENIX-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16302529#comment-16302529 ]
Karan Mehta commented on PHOENIX-4487: -------------------------------------- bq. Please don't remove upgrade code without raising a discussion thread on the dev list. Vendor distros often need upgrade code to remain longer than two minor releases back due to the infrequency of their upgrade. For example, CDH will go from 4.7 to 4.11. The HDP distro may be even further behind. Thank you for the information. I was not aware of this fully. I will take care for all the future JIRA's that I take up. bq. How is it better to go from an unlikely, possible race condition to always throwing an exception and blocking the upgrade when the mutex table doesn't exist? Please file a separate issue for handling the race condition properly. This patch improves things at least. Sure, will do that. bq. That check is because if namespaces are enabled, the earlier branch in the upgrade code path is executed and ensures that the mutex table is created. I'll add a comment. We can modify the code in {{createSysMutexTable()}} method as follows {code} - if (systemTables.contains(mutexTableName) || admin.tableExists( TableName.valueOf( PhoenixDatabaseMetaData.SYSTEM_SCHEMA_NAME,PhoenixDatabaseMetaData.SYSTEM_MUTEX_TABLE_NAME))) { + if (systemTables.contains(PhoenixDatabaseMetaData.SYSTEM_MUTEX_HBASE_TABLE_NAME) || admin.tableExists( TableName.valueOf( PhoenixDatabaseMetaData.SYSTEM_SCHEMA_NAME,PhoenixDatabaseMetaData.SYSTEM_MUTEX_TABLE_NAME))) { {code} This will ensure that the function checks for SYSTEM.MUTEX and SYSTEM:MUTEX and if either of them exist, then it will not proceed to create the table As of now, if namespace mapping is enabled, it checks for SYSTEM:MUTEX in both the conditions. With this change, I believe, you can simply call this method on the migrate tables path and you can call this method with the Phoenix version condition check of 4.10 in the upgrade path. > Missing SYSTEM.MUTEX table upgrading from 4.7 to 4.13 > ----------------------------------------------------- > > Key: PHOENIX-4487 > URL: https://issues.apache.org/jira/browse/PHOENIX-4487 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.14.0, 4.13.1, 4.13.2-cdh5.11.2 > Reporter: Flavio Pompermaier > Assignee: James Taylor > Attachments: PHOENIX-4487.patch > > > Upgrading from the official Cloudera Parcel equipped with Phoenix 4.7 to the > last unofficial parcel (4.13 on CDH 5.11.2) I had the same error of > https://issues.apache.org/jira/browse/PHOENIX-4293 (apart from the fact that > the from version was 4.7...). > The creation of system.mutex table fixed the problem. -- This message was sent by Atlassian JIRA (v6.4.14#64029)