HDFS-6800. Support Datanode layout changes with rolling upgrade. (Contributed by James Thomas)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
This commit is contained in:
arp 2014-08-29 00:26:13 -07:00
parent da118bb113
commit 3259e8954f
5 changed files with 15 additions and 5 deletions

View File

@ -371,6 +371,9 @@ Release 2.6.0 - UNRELEASED
HDFS-6951. Correctly persist raw namespace xattrs to edit log and fsimage. HDFS-6951. Correctly persist raw namespace xattrs to edit log and fsimage.
(clamb via wang) (clamb via wang)
HDFS-6800. Support Datanode layout changes with rolling upgrade.
(James Thomas via Arpit Agarwal)
BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS
HDFS-6387. HDFS CLI admin tool for creating & deleting an HDFS-6387. HDFS CLI admin tool for creating & deleting an

View File

@ -269,7 +269,14 @@ public class BlockPoolSliceStorage extends Storage {
*/ */
private void doTransition(DataNode datanode, StorageDirectory sd, private void doTransition(DataNode datanode, StorageDirectory sd,
NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { NamespaceInfo nsInfo, StartupOption startOpt) throws IOException {
if (startOpt == StartupOption.ROLLBACK) { if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) {
// we will already restore everything in the trash by rolling back to
// the previous directory, so we must delete the trash to ensure
// that it's not restored by BPOfferService.signalRollingUpgrade()
if (!FileUtil.fullyDelete(getTrashRootDir(sd))) {
throw new IOException("Unable to delete trash directory prior to " +
"restoration of previous directory: " + getTrashRootDir(sd));
}
doRollback(sd, nsInfo); // rollback if applicable doRollback(sd, nsInfo); // rollback if applicable
} else { } else {
// Restore all the files in the trash. The restored files are retained // Restore all the files in the trash. The restored files are retained

View File

@ -247,10 +247,9 @@ public class DataNode extends Configured
LogFactory.getLog(DataNode.class.getName() + ".clienttrace"); LogFactory.getLog(DataNode.class.getName() + ".clienttrace");
private static final String USAGE = private static final String USAGE =
"Usage: java DataNode [-regular | -rollback | -rollingupgrade rollback]\n" + "Usage: java DataNode [-regular | -rollback]\n" +
" -regular : Normal DataNode startup (default).\n" + " -regular : Normal DataNode startup (default).\n" +
" -rollback : Rollback a standard upgrade.\n" + " -rollback : Rollback a standard or rolling upgrade.\n" +
" -rollingupgrade rollback : Rollback a rolling upgrade operation.\n" +
" Refer to HDFS documentation for the difference between standard\n" + " Refer to HDFS documentation for the difference between standard\n" +
" and rolling upgrades."; " and rolling upgrades.";

View File

@ -1071,6 +1071,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
} }
if (nn.getFSImage().isUpgradeFinalized() && if (nn.getFSImage().isUpgradeFinalized() &&
!namesystem.isRollingUpgrade() &&
!nn.isStandbyState() && !nn.isStandbyState() &&
noStaleStorages) { noStaleStorages) {
return new FinalizeCommand(poolId); return new FinalizeCommand(poolId);

View File

@ -206,7 +206,7 @@
<li>Restore the pre-upgrade release in all machines.</li> <li>Restore the pre-upgrade release in all machines.</li>
<li>Start <em>NNs</em> with the <li>Start <em>NNs</em> with the
"<a href="#namenode_-rollingUpgrade"><code>-rollingUpgrade rollback</code></a>" option.</li> "<a href="#namenode_-rollingUpgrade"><code>-rollingUpgrade rollback</code></a>" option.</li>
<li>Start <em>DNs</em> normally.</li> <li>Start <em>DNs</em> with the "<code>-rollback</code>" option.</li>
</ol></li> </ol></li>
</ul> </ul>