accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [03/11] git commit: ACCUMULO-1010 Support upgrades from 1.4 to 1.5
Date Thu, 31 Jul 2014 16:33:17 GMT
ACCUMULO-1010 Support upgrades from 1.4 to 1.5

Description: Add steps necessary to move a zk from 1.4 state to 1.5.
  This leaves it in a good state to be picked up by the rest of the
  1.6 upgrade path.
Author: kturner
Ref: ACCUMULO-2988

Cherry picking caused a huge mess and it was simpler to manually select
the parts of the upgrade code that we needed based on the 1.5.1 tag.

Gathered from commits 317c669, aa6b4309, and 8811859.


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

Branch: refs/heads/master
Commit: 3beaa5a2bab83e4ff2e189db03b038c32e78a85c
Parents: 35b524d
Author: Mike Drob <mdrob@cloudera.com>
Authored: Fri May 2 12:01:38 2014 -0400
Committer: Sean Busbey <busbey@cloudera.com>
Committed: Thu Jul 31 11:30:57 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/accumulo/master/Master.java     | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/3beaa5a2/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index b7d7784..a2048b5 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -274,7 +274,8 @@ public class Master implements LiveTServerSet.Listener, TableObserver,
CurrentSt
     // introduce unnecessary complexity to try to make the master do it), but be aware
     // that the master is not the only thing that may alter zookeeper before starting.
 
-    if (Accumulo.getAccumuloPersistentVersion(fs) == ServerConstants.PREV_DATA_VERSION) {
+    final int accumuloPersistentVersion = Accumulo.getAccumuloPersistentVersion(fs);
+    if (accumuloPersistentVersion == ServerConstants.TWO_VERSIONS_AGO || accumuloPersistentVersion
== ServerConstants.PREV_DATA_VERSION) {
       // This Master hasn't started Fate yet, so any outstanding transactions must be from
before the upgrade.
       // Change to Guava's Verify once we use Guava 17.
       if (null != fate) {
@@ -285,6 +286,19 @@ public class Master implements LiveTServerSet.Listener, TableObserver,
CurrentSt
         log.info("Upgrading zookeeper");
 
         IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+        final String zooRoot = ZooUtil.getRoot(instance);
+
+        if (accumuloPersistentVersion == ServerConstants.TWO_VERSIONS_AGO) {
+          zoo.recursiveDelete(zooRoot + "/loggers", NodeMissingPolicy.SKIP);
+          zoo.recursiveDelete(zooRoot + "/dead/loggers", NodeMissingPolicy.SKIP);
+
+          final byte[] zero = new byte[] {'0'};
+          zoo.putPersistentData(zooRoot + Constants.ZRECOVERY, zero, NodeExistsPolicy.SKIP);
+
+          for (String id : Tables.getIdToNameMap(instance).keySet()) {
+            zoo.putPersistentData(zooRoot + Constants.ZTABLES + "/" + id + Constants.ZTABLE_COMPACT_CANCEL_ID,
zero, NodeExistsPolicy.SKIP);
+          }
+        }
 
         // create initial namespaces
         String namespaces = ZooUtil.getRoot(instance) + Constants.ZNAMESPACES;


Mime
View raw message