ACCUMULO-2988 Upgrade from 1.4 -> 1.6. * add a README section * add log messages around upgrade actions * change 1.4 -> 1.5 upgrade action around compaction cancellation to use 1.6 method of enumerating table ids.
Author: Sean Busbey <bus...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/81e3d277 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/81e3d277 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/81e3d277 Branch: refs/heads/1.6.1-SNAPSHOT Commit: 81e3d277e2cc09e6aef4d8f7d07f8f22fccd23f4 Parents: 53fcb52 Author: Sean Busbey <bus...@cloudera.com> Authored: Wed May 14 15:57:27 2014 -0400 Committer: Sean Busbey <bus...@cloudera.com> Committed: Thu Jul 31 11:30:58 2014 -0500 ---------------------------------------------------------------------- README | 41 +++++++++++++++++++- .../accumulo/server/util/MetadataTableUtil.java | 1 + .../java/org/apache/accumulo/master/Master.java | 9 ++++- 3 files changed, 49 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/81e3d277/README ---------------------------------------------------------------------- diff --git a/README b/README index c2c2446..ec13201 100644 --- a/README +++ b/README @@ -125,7 +125,9 @@ a profile to maven's settings.xml file. Below is an example of $HOME/.m2/setting </settings> ****************************************************************************** -3. Upgrading from 1.5 to 1.6 +3. Upgrading + +3.1. From 1.5 to 1.6 This happens automatically the first time Accumulo 1.6 is started. @@ -157,6 +159,43 @@ a profile to maven's settings.xml file. Below is an example of $HOME/.m2/setting These messages are safe to ignore. If you need detail on the upgrade's progress you should view the local logs on the Tablet Servers and active Master. +3.2. From 1.4 to 1.6 + + To upgrade from 1.4 to 1.6 you must perform a manual initial step. + + Prior to upgrading you must: + * Verify that there are no outstanding FATE operations + - Under 1.4 you can list what's in FATE by running + $ACCUMULO_HOME/bin/accumulo org.apache.accumulo.server.fate.Admin print + - Note that operations in any state will prevent an upgrade. It is safe + to delete operations with status SUCCESSFUL. For others, you should restart + your 1.4 cluster and allow them to finish. + * Stop the 1.4 instance. + * Configure 1.6 to use the hdfs directory, walog directories, and zookeepers + that 1.4 was using. + * Copy other 1.4 configuration options as needed. + + Prior to starting the 1.6 instance you will need to run the LocalWALRecovery tool + on each node that previously ran an instance of the Logger role. + + $ACCUMULO_HOME/bin/accumulo org.apache.accumulo.tserver.log.LocalWALRecovery + + The recovery tool will rewrite the 1.4 write ahead logs into a format that 1.6 can read. + After this step has completed on all nodes, start the 1.6 cluster to continue the upgrade. + + The upgrade process must make changes to Accumulo's internal state in both ZooKeeper and + the table metadata. This process may take some time if Tablet Servers have to go through + recovery. During this time, the Monitor will claim that the Master is down and some + services may send the Monitor log messages about failure to communicate with each other. + While the upgrade is in progress, the Garbage Collector may complain about invalid paths. + The Master may also complain about failure to create the trace table because it already + exists. These messages are safe to ignore. If other error messages occur, you should seek + out support before continuing to use Accumulo. If you need detail on the upgrade's progress + you should view the local logs on the Tablet Servers and active Master. + + Note that the LocalWALRecovery tool does not delete the local files. Once you confirm that + 1.6 is successfully running, you should delete these files on the local filesystem. + ****************************************************************************** 4. Configuring http://git-wip-us.apache.org/repos/asf/accumulo/blob/81e3d277/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java index 827eaa9..e702af4 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java @@ -18,6 +18,7 @@ package org.apache.accumulo.server.util; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; http://git-wip-us.apache.org/repos/asf/accumulo/blob/81e3d277/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 c1644fa..63acd62 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 @@ -289,13 +289,18 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt final String zooRoot = ZooUtil.getRoot(instance); if (accumuloPersistentVersion == ServerConstants.TWO_VERSIONS_AGO) { + log.debug("Handling updates for version " + ServerConstants.TWO_VERSIONS_AGO); + + log.debug("Cleaning out remnants of logger role."); zoo.recursiveDelete(zooRoot + "/loggers", NodeMissingPolicy.SKIP); zoo.recursiveDelete(zooRoot + "/dead/loggers", NodeMissingPolicy.SKIP); final byte[] zero = new byte[] {'0'}; + log.debug("Initializing recovery area."); zoo.putPersistentData(zooRoot + Constants.ZRECOVERY, zero, NodeExistsPolicy.SKIP); - for (String id : Tables.getIdToNameMap(instance).keySet()) { + for (String id : zoo.getChildren(zooRoot + Constants.ZTABLES)) { + log.debug("Prepping table " + id + " for compaction cancellations."); zoo.putPersistentData(zooRoot + Constants.ZTABLES + "/" + id + Constants.ZTABLE_COMPACT_CANCEL_ID, zero, NodeExistsPolicy.SKIP); } } @@ -379,8 +384,10 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt try { log.info("Starting to upgrade !METADATA table."); if (accumuloPersistentVersion == ServerConstants.TWO_VERSIONS_AGO) { + log.info("Updating Delete Markers in !METADATA table for version 1.4"); MetadataTableUtil.moveMetaDeleteMarkersFrom14(instance, SystemCredentials.get()); } else { + log.info("Updating Delete Markers in !METADATA table."); MetadataTableUtil.moveMetaDeleteMarkers(instance, SystemCredentials.get()); } log.info("Updating persistent data version.");