HDFS-2397. Undeprecate SecondaryNameNode. Contributed by Eli Collins

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1235135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-01-24 06:05:52 +00:00
parent 9a153334ac
commit 5dfe62d845
10 changed files with 21 additions and 62 deletions

View File

@ -753,11 +753,6 @@
<section> <section>
<title> secondarynamenode </title> <title> secondarynamenode </title>
<note>
The Secondary NameNode has been deprecated. Instead, consider using the
<a href="http://hadoop.apache.org/hdfs/docs/current/hdfs_user_guide.html#Checkpoint+Node">Checkpoint Node</a> or
<a href="http://hadoop.apache.org/hdfs/docs/current/hdfs_user_guide.html#Backup+Node">Backup Node</a>.
</note>
<p> <p>
Runs the HDFS secondary Runs the HDFS secondary
namenode. See <a href="http://hadoop.apache.org/hdfs/docs/current/hdfs_user_guide.html#Secondary+NameNode">Secondary NameNode</a> namenode. See <a href="http://hadoop.apache.org/hdfs/docs/current/hdfs_user_guide.html#Secondary+NameNode">Secondary NameNode</a>

View File

@ -276,6 +276,8 @@ Release 0.23.1 - UNRELEASED
HDFS-2818. Fix a missing space issue in HDFS webapps' title tags. (Devaraj K via harsh) HDFS-2818. Fix a missing space issue in HDFS webapps' title tags. (Devaraj K via harsh)
HDFS-2397. Undeprecate SecondaryNameNode (eli)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-2130. Switch default checksum to CRC32C. (todd) HDFS-2130. Switch default checksum to CRC32C. (todd)

View File

@ -112,17 +112,18 @@
problems. problems.
</li> </li>
<li> <li>
Secondary NameNode (deprecated): performs periodic checkpoints of the Secondary NameNode: performs periodic checkpoints of the
namespace and helps keep the size of file containing log of HDFS namespace and helps keep the size of file containing log of HDFS
modifications within certain limits at the NameNode. modifications within certain limits at the NameNode.
Replaced by Checkpoint node.
</li> </li>
<li> <li>
Checkpoint node: performs periodic checkpoints of the namespace and Checkpoint node: performs periodic checkpoints of the namespace and
helps minimize the size of the log stored at the NameNode helps minimize the size of the log stored at the NameNode
containing changes to the HDFS. containing changes to the HDFS.
Replaces the role previously filled by the Secondary NameNode. Replaces the role previously filled by the Secondary NameNode,
NameNode allows multiple Checkpoint nodes simultaneously, though is not yet battle hardened.
The NameNode allows multiple Checkpoint nodes simultaneously,
as long as there are no Backup nodes registered with the system. as long as there are no Backup nodes registered with the system.
</li> </li>
<li> <li>
@ -132,6 +133,7 @@
which is always in sync with the active NameNode namespace state. which is always in sync with the active NameNode namespace state.
Only one Backup node may be registered with the NameNode at once. Only one Backup node may be registered with the NameNode at once.
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -234,12 +236,6 @@
</section> </section>
<section> <title>Secondary NameNode</title> <section> <title>Secondary NameNode</title>
<note>
The Secondary NameNode has been deprecated.
Instead, consider using the
<a href="hdfs_user_guide.html#Checkpoint+node">Checkpoint Node</a> or
<a href="hdfs_user_guide.html#Backup+node">Backup Node</a>.
</note>
<p> <p>
The NameNode stores modifications to the file system as a log The NameNode stores modifications to the file system as a log
appended to a native file system file, <code>edits</code>. appended to a native file system file, <code>edits</code>.
@ -287,7 +283,9 @@
<a href="http://hadoop.apache.org/common/docs/current/commands_manual.html#secondarynamenode">secondarynamenode</a>. <a href="http://hadoop.apache.org/common/docs/current/commands_manual.html#secondarynamenode">secondarynamenode</a>.
</p> </p>
</section><section> <title> Checkpoint Node </title> </section>
<section> <title> Checkpoint Node </title>
<p>NameNode persists its namespace using two files: <code>fsimage</code>, <p>NameNode persists its namespace using two files: <code>fsimage</code>,
which is the latest checkpoint of the namespace and <code>edits</code>, which is the latest checkpoint of the namespace and <code>edits</code>,
a journal (log) of changes to the namespace since the checkpoint. a journal (log) of changes to the namespace since the checkpoint.

View File

@ -87,7 +87,6 @@ import com.google.common.collect.ImmutableList;
* primary NameNode. * primary NameNode.
* *
**********************************************************/ **********************************************************/
@Deprecated // use BackupNode with -checkpoint argument instead.
@InterfaceAudience.Private @InterfaceAudience.Private
public class SecondaryNameNode implements Runnable { public class SecondaryNameNode implements Runnable {

View File

@ -204,7 +204,6 @@ public class TestCheckpoint extends TestCase {
/* /*
* Simulate namenode crashing after rolling edit log. * Simulate namenode crashing after rolling edit log.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryNamenodeError1() public void testSecondaryNamenodeError1()
throws IOException { throws IOException {
LOG.info("Starting testSecondaryNamenodeError1"); LOG.info("Starting testSecondaryNamenodeError1");
@ -266,7 +265,6 @@ public class TestCheckpoint extends TestCase {
/* /*
* Simulate a namenode crash after uploading new image * Simulate a namenode crash after uploading new image
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryNamenodeError2() throws IOException { public void testSecondaryNamenodeError2() throws IOException {
LOG.info("Starting testSecondaryNamenodeError2"); LOG.info("Starting testSecondaryNamenodeError2");
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -325,7 +323,6 @@ public class TestCheckpoint extends TestCase {
/* /*
* Simulate a secondary namenode crash after rolling the edit log. * Simulate a secondary namenode crash after rolling the edit log.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryNamenodeError3() throws IOException { public void testSecondaryNamenodeError3() throws IOException {
LOG.info("Starting testSecondaryNamenodeError3"); LOG.info("Starting testSecondaryNamenodeError3");
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -395,7 +392,6 @@ public class TestCheckpoint extends TestCase {
* back to the name-node. * back to the name-node.
* Used to truncate primary fsimage file. * Used to truncate primary fsimage file.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryFailsToReturnImage() throws IOException { public void testSecondaryFailsToReturnImage() throws IOException {
LOG.info("Starting testSecondaryFailsToReturnImage"); LOG.info("Starting testSecondaryFailsToReturnImage");
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -472,7 +468,6 @@ public class TestCheckpoint extends TestCase {
* @param errorType the ErrorSimulator type to trigger * @param errorType the ErrorSimulator type to trigger
* @param exceptionSubstring an expected substring of the triggered exception * @param exceptionSubstring an expected substring of the triggered exception
*/ */
@SuppressWarnings("deprecation")
private void doSendFailTest(int errorType, String exceptionSubstring) private void doSendFailTest(int errorType, String exceptionSubstring)
throws IOException { throws IOException {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -587,7 +582,6 @@ public class TestCheckpoint extends TestCase {
/** /**
* Test that the SecondaryNameNode properly locks its storage directories. * Test that the SecondaryNameNode properly locks its storage directories.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryNameNodeLocking() throws Exception { public void testSecondaryNameNodeLocking() throws Exception {
// Start a primary NN so that the secondary will start successfully // Start a primary NN so that the secondary will start successfully
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -680,7 +674,6 @@ public class TestCheckpoint extends TestCase {
* 2. if the NN does not contain an image, importing a checkpoint * 2. if the NN does not contain an image, importing a checkpoint
* succeeds and re-saves the image * succeeds and re-saves the image
*/ */
@SuppressWarnings("deprecation")
public void testImportCheckpoint() throws Exception { public void testImportCheckpoint() throws Exception {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
Path testPath = new Path("/testfile"); Path testPath = new Path("/testfile");
@ -761,16 +754,12 @@ public class TestCheckpoint extends TestCase {
throw new IOException("Cannot create directory " + dir); throw new IOException("Cannot create directory " + dir);
} }
// This deprecation suppress warning does not work due to known Java bug:
// http://bugs.sun.com/view_bug.do?bug_id=6460147
@SuppressWarnings("deprecation")
SecondaryNameNode startSecondaryNameNode(Configuration conf SecondaryNameNode startSecondaryNameNode(Configuration conf
) throws IOException { ) throws IOException {
conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0");
return new SecondaryNameNode(conf); return new SecondaryNameNode(conf);
} }
@SuppressWarnings("deprecation")
SecondaryNameNode startSecondaryNameNode(Configuration conf, int index) SecondaryNameNode startSecondaryNameNode(Configuration conf, int index)
throws IOException { throws IOException {
Configuration snnConf = new Configuration(conf); Configuration snnConf = new Configuration(conf);
@ -783,7 +772,6 @@ public class TestCheckpoint extends TestCase {
/** /**
* Tests checkpoint in HDFS. * Tests checkpoint in HDFS.
*/ */
@SuppressWarnings("deprecation")
public void testCheckpoint() throws IOException { public void testCheckpoint() throws IOException {
Path file1 = new Path("checkpoint.dat"); Path file1 = new Path("checkpoint.dat");
Path file2 = new Path("checkpoint2.dat"); Path file2 = new Path("checkpoint2.dat");
@ -1010,7 +998,6 @@ public class TestCheckpoint extends TestCase {
* - it then fails again for the same reason * - it then fails again for the same reason
* - it then tries to checkpoint a third time * - it then tries to checkpoint a third time
*/ */
@SuppressWarnings("deprecation")
public void testCheckpointAfterTwoFailedUploads() throws IOException { public void testCheckpointAfterTwoFailedUploads() throws IOException {
MiniDFSCluster cluster = null; MiniDFSCluster cluster = null;
SecondaryNameNode secondary = null; SecondaryNameNode secondary = null;
@ -1065,7 +1052,6 @@ public class TestCheckpoint extends TestCase {
* *
* @throws IOException * @throws IOException
*/ */
@SuppressWarnings("deprecation")
public void testMultipleSecondaryNamenodes() throws IOException { public void testMultipleSecondaryNamenodes() throws IOException {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
String nameserviceId1 = "ns1"; String nameserviceId1 = "ns1";
@ -1115,7 +1101,6 @@ public class TestCheckpoint extends TestCase {
* Test that the secondary doesn't have to re-download image * Test that the secondary doesn't have to re-download image
* if it hasn't changed. * if it hasn't changed.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryImageDownload() throws IOException { public void testSecondaryImageDownload() throws IOException {
LOG.info("Starting testSecondaryImageDownload"); LOG.info("Starting testSecondaryImageDownload");
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -1198,7 +1183,6 @@ public class TestCheckpoint extends TestCase {
* It verifies that this works even though the earlier-txid checkpoint gets * It verifies that this works even though the earlier-txid checkpoint gets
* uploaded after the later-txid checkpoint. * uploaded after the later-txid checkpoint.
*/ */
@SuppressWarnings("deprecation")
public void testMultipleSecondaryNNsAgainstSameNN() throws Exception { public void testMultipleSecondaryNNsAgainstSameNN() throws Exception {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -1284,7 +1268,6 @@ public class TestCheckpoint extends TestCase {
* It verifies that one of the two gets an error that it's uploading a * It verifies that one of the two gets an error that it's uploading a
* duplicate checkpoint, and the other one succeeds. * duplicate checkpoint, and the other one succeeds.
*/ */
@SuppressWarnings("deprecation")
public void testMultipleSecondaryNNsAgainstSameNN2() throws Exception { public void testMultipleSecondaryNNsAgainstSameNN2() throws Exception {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -1383,7 +1366,6 @@ public class TestCheckpoint extends TestCase {
* is running. The secondary should shut itself down if if talks to a NN * is running. The secondary should shut itself down if if talks to a NN
* with the wrong namespace. * with the wrong namespace.
*/ */
@SuppressWarnings("deprecation")
public void testReformatNNBetweenCheckpoints() throws IOException { public void testReformatNNBetweenCheckpoints() throws IOException {
MiniDFSCluster cluster = null; MiniDFSCluster cluster = null;
SecondaryNameNode secondary = null; SecondaryNameNode secondary = null;
@ -1638,7 +1620,6 @@ public class TestCheckpoint extends TestCase {
/** /**
* Test that the 2NN triggers a checkpoint after the configurable interval * Test that the 2NN triggers a checkpoint after the configurable interval
*/ */
@SuppressWarnings("deprecation")
public void testCheckpointTriggerOnTxnCount() throws Exception { public void testCheckpointTriggerOnTxnCount() throws Exception {
MiniDFSCluster cluster = null; MiniDFSCluster cluster = null;
SecondaryNameNode secondary = null; SecondaryNameNode secondary = null;
@ -1692,7 +1673,6 @@ public class TestCheckpoint extends TestCase {
* logs that connect the 2NN's old checkpoint to the current txid * logs that connect the 2NN's old checkpoint to the current txid
* get archived. Then, the 2NN tries to checkpoint again. * get archived. Then, the 2NN tries to checkpoint again.
*/ */
@SuppressWarnings("deprecation")
public void testSecondaryHasVeryOutOfDateImage() throws IOException { public void testSecondaryHasVeryOutOfDateImage() throws IOException {
MiniDFSCluster cluster = null; MiniDFSCluster cluster = null;
SecondaryNameNode secondary = null; SecondaryNameNode secondary = null;
@ -1730,7 +1710,6 @@ public class TestCheckpoint extends TestCase {
} }
} }
@SuppressWarnings("deprecation")
public void testCommandLineParsing() throws ParseException { public void testCommandLineParsing() throws ParseException {
SecondaryNameNode.CommandLineOpts opts = SecondaryNameNode.CommandLineOpts opts =
new SecondaryNameNode.CommandLineOpts(); new SecondaryNameNode.CommandLineOpts();
@ -1765,7 +1744,6 @@ public class TestCheckpoint extends TestCase {
} catch (ParseException e) {} } catch (ParseException e) {}
} }
@SuppressWarnings("deprecation")
private void cleanup(SecondaryNameNode snn) { private void cleanup(SecondaryNameNode snn) {
if (snn != null) { if (snn != null) {
try { try {
@ -1781,7 +1759,6 @@ public class TestCheckpoint extends TestCase {
* Assert that if any two files have the same name across the 2NNs * Assert that if any two files have the same name across the 2NNs
* and NN, they should have the same content too. * and NN, they should have the same content too.
*/ */
@SuppressWarnings("deprecation")
private void assertParallelFilesInvariant(MiniDFSCluster cluster, private void assertParallelFilesInvariant(MiniDFSCluster cluster,
ImmutableList<SecondaryNameNode> secondaries) throws Exception { ImmutableList<SecondaryNameNode> secondaries) throws Exception {
List<File> allCurrentDirs = Lists.newArrayList(); List<File> allCurrentDirs = Lists.newArrayList();
@ -1793,7 +1770,6 @@ public class TestCheckpoint extends TestCase {
ImmutableSet.of("VERSION")); ImmutableSet.of("VERSION"));
} }
@SuppressWarnings("deprecation")
private List<File> getCheckpointCurrentDirs(SecondaryNameNode secondary) { private List<File> getCheckpointCurrentDirs(SecondaryNameNode secondary) {
List<File> ret = Lists.newArrayList(); List<File> ret = Lists.newArrayList();
for (URI u : secondary.getCheckpointDirs()) { for (URI u : secondary.getCheckpointDirs()) {
@ -1803,7 +1779,6 @@ public class TestCheckpoint extends TestCase {
return ret; return ret;
} }
@SuppressWarnings("deprecation")
private CheckpointStorage spyOnSecondaryImage(SecondaryNameNode secondary1) { private CheckpointStorage spyOnSecondaryImage(SecondaryNameNode secondary1) {
CheckpointStorage spy = Mockito.spy((CheckpointStorage)secondary1.getFSImage());; CheckpointStorage spy = Mockito.spy((CheckpointStorage)secondary1.getFSImage());;
secondary1.setFSImage(spy); secondary1.setFSImage(spy);
@ -1813,7 +1788,6 @@ public class TestCheckpoint extends TestCase {
/** /**
* A utility class to perform a checkpoint in a different thread. * A utility class to perform a checkpoint in a different thread.
*/ */
@SuppressWarnings("deprecation")
private static class DoCheckpointThread extends Thread { private static class DoCheckpointThread extends Thread {
private final SecondaryNameNode snn; private final SecondaryNameNode snn;
private volatile Throwable thrown = null; private volatile Throwable thrown = null;

View File

@ -120,9 +120,6 @@ public class TestNameEditsConfigs {
assertTrue(!fileSys.exists(name)); assertTrue(!fileSys.exists(name));
} }
// This deprecation suppress warning does not work due to known Java bug:
// http://bugs.sun.com/view_bug.do?bug_id=6460147
@SuppressWarnings("deprecation")
SecondaryNameNode startSecondaryNameNode(Configuration conf SecondaryNameNode startSecondaryNameNode(Configuration conf
) throws IOException { ) throws IOException {
conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0");
@ -142,7 +139,6 @@ public class TestNameEditsConfigs {
* sure we are reading proper edits and image. * sure we are reading proper edits and image.
* @throws Exception * @throws Exception
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testNameEditsConfigs() throws Exception { public void testNameEditsConfigs() throws Exception {
Path file1 = new Path("TestNameEditsConfigs1"); Path file1 = new Path("TestNameEditsConfigs1");

View File

@ -30,7 +30,6 @@ import org.junit.Test;
public class TestSecondaryWebUi { public class TestSecondaryWebUi {
@SuppressWarnings("deprecation")
@Test @Test
public void testSecondaryWebUi() throws IOException { public void testSecondaryWebUi() throws IOException {
Configuration conf = new Configuration(); Configuration conf = new Configuration();

View File

@ -121,7 +121,6 @@ public class TestStartup extends TestCase {
* start MiniDFScluster, create a file (to create edits) and do a checkpoint * start MiniDFScluster, create a file (to create edits) and do a checkpoint
* @throws IOException * @throws IOException
*/ */
@SuppressWarnings("deprecation")
public void createCheckPoint() throws IOException { public void createCheckPoint() throws IOException {
LOG.info("--starting mini cluster"); LOG.info("--starting mini cluster");
// manage dirs parameter set to false // manage dirs parameter set to false
@ -303,7 +302,6 @@ public class TestStartup extends TestCase {
* secondary node copies fsimage and edits into correct separate directories. * secondary node copies fsimage and edits into correct separate directories.
* @throws IOException * @throws IOException
*/ */
@SuppressWarnings("deprecation")
public void testSNNStartup() throws IOException{ public void testSNNStartup() throws IOException{
//setUpConfig(); //setUpConfig();
LOG.info("--starting SecondNN startup test"); LOG.info("--starting SecondNN startup test");

View File

@ -155,7 +155,6 @@ public class TestStorageRestore {
* 7. run doCheckpoint * 7. run doCheckpoint
* 8. verify that all the image and edits files are the same. * 8. verify that all the image and edits files are the same.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testStorageRestore() throws Exception { public void testStorageRestore() throws Exception {
int numDatanodes = 0; int numDatanodes = 0;
@ -312,7 +311,6 @@ public class TestStorageRestore {
* then try to perform a checkpoint. The NN should not serve up the image or * then try to perform a checkpoint. The NN should not serve up the image or
* edits from the restored (empty) dir. * edits from the restored (empty) dir.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testMultipleSecondaryCheckpoint() throws IOException { public void testMultipleSecondaryCheckpoint() throws IOException {

View File

@ -95,7 +95,7 @@ Hadoop MapReduce Next Generation - Cluster Setup
*--------------------------------------+--------------------------------------+ *--------------------------------------+--------------------------------------+
| DataNode | HADOOP_DATANODE_OPTS | | DataNode | HADOOP_DATANODE_OPTS |
*--------------------------------------+--------------------------------------+ *--------------------------------------+--------------------------------------+
| Backup NameNode | HADOOP_SECONDARYNAMENODE_OPTS | | Secondary NameNode | HADOOP_SECONDARYNAMENODE_OPTS |
*--------------------------------------+--------------------------------------+ *--------------------------------------+--------------------------------------+
| ResourceManager | YARN_RESOURCEMANAGER_OPTS | | ResourceManager | YARN_RESOURCEMANAGER_OPTS |
*--------------------------------------+--------------------------------------+ *--------------------------------------+--------------------------------------+
@ -537,15 +537,15 @@ Hadoop MapReduce Next Generation - Cluster Setup
It's recommended to have them share a Unix group, for e.g. <<<hadoop>>>. It's recommended to have them share a Unix group, for e.g. <<<hadoop>>>.
*--------------------------------------+--------------------------------------+ *--------------------------------------+----------------------------------------------------------------------+
|| User:Group || Daemons | || User:Group || Daemons |
*--------------------------------------+--------------------------------------+ *--------------------------------------+----------------------------------------------------------------------+
| hdfs:hadoop | NameNode, Backup NameNode, DataNode | | hdfs:hadoop | NameNode, Secondary NameNode, Checkpoint Node, Backup Node, DataNode |
*--------------------------------------+--------------------------------------+ *--------------------------------------+----------------------------------------------------------------------+
| yarn:hadoop | ResourceManager, NodeManager | | yarn:hadoop | ResourceManager, NodeManager |
*--------------------------------------+--------------------------------------+ *--------------------------------------+----------------------------------------------------------------------+
| mapred:hadoop | MapReduce JobHistory Server | | mapred:hadoop | MapReduce JobHistory Server |
*--------------------------------------+--------------------------------------+ *--------------------------------------+----------------------------------------------------------------------+
* <<<Permissions for both HDFS and local fileSystem paths>>> * <<<Permissions for both HDFS and local fileSystem paths>>>