phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [3/3] phoenix git commit: PHOENIX-2731 Ensure upgrade from 4.7.0 RCx to 4.7.0 RC5 works
Date Wed, 02 Mar 2016 18:53:40 GMT
PHOENIX-2731 Ensure upgrade from 4.7.0 RCx to 4.7.0 RC5 works


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/e564d50b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e564d50b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e564d50b

Branch: refs/heads/4.x-HBase-1.0
Commit: e564d50b25c41fc2fc7f0c49acd8e32f29324fa9
Parents: 586d303
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Mar 2 10:28:34 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Mar 2 10:45:47 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/phoenix/coprocessor/MetaDataProtocol.java | 2 +-
 .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e564d50b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
index fb9d228..7a7cf31 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
@@ -73,7 +73,7 @@ public abstract class MetaDataProtocol extends MetaDataService {
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0 = MIN_TABLE_TIMESTAMP + 7;
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_5_0 = MIN_TABLE_TIMESTAMP + 8;
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_6_0 = MIN_TABLE_TIMESTAMP + 9;
-    public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0 = MIN_TABLE_TIMESTAMP + 14;
+    public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0 = MIN_TABLE_TIMESTAMP + 15;
     // MIN_SYSTEM_TABLE_TIMESTAMP needs to be set to the max of all the MIN_SYSTEM_TABLE_TIMESTAMP_*
constants
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP = MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0;
     // TODO: pare this down to minimum, as we don't need duplicates for both table and column
errors, nor should we need

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e564d50b/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 488926d..df3bc13 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
@@ -2432,13 +2432,16 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices
implement
                                 metaConnection.createStatement().executeUpdate(
                                         QueryConstants.CREATE_STATS_TABLE_METADATA);
                             } catch (NewerTableAlreadyExistsException ignore) {
-                            } catch(TableAlreadyExistsException ignore) {
-                                metaConnection = addColumnsIfNotExists(
+                            } catch(TableAlreadyExistsException e) {
+                                long currentServerSideTableTimeStamp = e.getTable().getTimeStamp();
+                                if (currentServerSideTableTimeStamp < MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0)
{
+                                    metaConnection = addColumnsIfNotExists(
                                         metaConnection,
                                         PhoenixDatabaseMetaData.SYSTEM_STATS_NAME,
                                         MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP,
                                         PhoenixDatabaseMetaData.GUIDE_POSTS_ROW_COUNT + "
"
                                                 + PLong.INSTANCE.getSqlTypeName());
+                                }
                             }
                             try {
                                 metaConnection.createStatement().executeUpdate(


Mime
View raw message