PHOENIX-3726 Error while upgrading system tables
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/730d8505 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/730d8505 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/730d8505 Branch: refs/heads/calcite Commit: 730d85053a63dbde0019e6a354f1573ee279bab2 Parents: 2c66e3c Author: Samarth <samarth.j...@salesforce.com> Authored: Thu Mar 9 10:31:35 2017 -0800 Committer: Samarth <samarth.j...@salesforce.com> Committed: Thu Mar 9 10:31:54 2017 -0800 ---------------------------------------------------------------------- .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/730d8505/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index 8ba2c81..751f2f2 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -3088,8 +3088,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement List<TableName> tableNames = Arrays .asList(admin.listTableNames(QueryConstants.SYSTEM_SCHEMA_NAME + "\\..*")); if (tableNames.size() == 0) { return; } - if (tableNames.size() > 4) { throw new IllegalArgumentException( - "Expected 4 system table only but found " + tableNames.size() + ":" + tableNames); } + if (tableNames.size() > 5) { + logger.warn("Expected 5 system tables but found " + tableNames.size() + ":" + tableNames); + } byte[] mappedSystemTable = SchemaUtil .getPhysicalName(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES, props).getName(); metatable = getTable(mappedSystemTable); @@ -3104,6 +3105,7 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement } tableNames.remove(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME); } + tableNames.remove(PhoenixDatabaseMetaData.SYSTEM_MUTEX_NAME); for (TableName table : tableNames) { UpgradeUtil.mapTableToNamespace(admin, metatable, table.getNameAsString(), props, null, PTableType.SYSTEM, null);