diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 2c18ba304d..6096ec3159 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -842,6 +842,9 @@ Release 0.23.0 - 2011-11-01 HDFS-2521. Remove custom checksum headers from data transfer protocol (todd) + HDFS-2308. NamenodeProtocol.endCheckpoint is vestigial and can be removed. + (eli) + OPTIMIZATIONS HDFS-1458. Improve checkpoint performance by avoiding unnecessary image diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java index a6af3eb8e8..4cfb014dd5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java @@ -998,18 +998,12 @@ else if(bnReg.getLayoutVersion() < storage.getLayoutVersion() /** * End checkpoint. *

- * Rename uploaded checkpoint to the new image; - * purge old edits file; - * rename edits.new to edits; - * redirect edit log streams to the new edits; - * update checkpoint time if the remote node is a checkpoint only node. + * Validate the current storage info with the given signature. * - * @param sig - * @param remoteNNRole - * @throws IOException + * @param sig to validate the current storage info against + * @throws IOException if the checkpoint fields are inconsistent */ - void endCheckpoint(CheckpointSignature sig, - NamenodeRole remoteNNRole) throws IOException { + void endCheckpoint(CheckpointSignature sig) throws IOException { sig.validateStorageInfo(this); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index dd7802f7d6..0a42d48039 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -3493,15 +3493,15 @@ NamenodeCommand startCheckpoint( void endCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) throws IOException { - writeLock(); + readLock(); try { if (isInSafeMode()) { throw new SafeModeException("Checkpoint not ended", safeMode); } LOG.info("End checkpoint for " + registration.getAddress()); - getFSImage().endCheckpoint(sig, registration.getRole()); + getFSImage().endCheckpoint(sig); } finally { - writeUnlock(); + readUnlock(); } }