Return-Path: Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: (qmail 8371 invoked from network); 18 Mar 2010 21:27:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Mar 2010 21:27:44 -0000 Received: (qmail 42617 invoked by uid 500); 18 Mar 2010 21:27:44 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 42592 invoked by uid 500); 18 Mar 2010 21:27:44 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 42584 invoked by uid 99); 18 Mar 2010 21:27:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Mar 2010 21:27:43 +0000 X-ASF-Spam-Status: No, hits=-1998.0 required=10.0 tests=ALL_TRUSTED,FB_GET_MEDS X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Mar 2010 21:27:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C717823888CE; Thu, 18 Mar 2010 21:27:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r925004 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java Date: Thu, 18 Mar 2010 21:27:19 -0000 To: hdfs-commits@hadoop.apache.org From: suresh@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100318212719.C717823888CE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: suresh Date: Thu Mar 18 21:27:19 2010 New Revision: 925004 URL: http://svn.apache.org/viewvc?rev=925004&view=rev Log: HDFS-1015. Fix intermittent failure in TestSecurityTokenEditLog. Contribute by Jitendra Nath Pandey. Modified: hadoop/hdfs/trunk/CHANGES.txt hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java Modified: hadoop/hdfs/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=925004&r1=925003&r2=925004&view=diff ============================================================================== --- hadoop/hdfs/trunk/CHANGES.txt (original) +++ hadoop/hdfs/trunk/CHANGES.txt Thu Mar 18 21:27:19 2010 @@ -163,8 +163,8 @@ Trunk (unreleased changes) Lipcon via hairong) HDFS-630. In DFSOutputStream.nextBlockOutputStream(), the client can - exclude specific datanodes when locating the next block. - (Cosmin Lehene via Stack) + exclude specific datanodes when locating the next block. + (Cosmin Lehene via Stack) HDFS-922. Remove unnecessary semicolon added by HDFS-877 that causes problems for Eclipse compilation. (jghoman) @@ -200,6 +200,9 @@ Trunk (unreleased changes) HDFS-961. dfs_readdir incorrectly parses paths. (Eli Collins via tomwhite) + HDFS-1015. Fix intermittent failure in TestSecurityTokenEditLog. + (Jitendra Nath Pandey via suresh) + Release 0.21.0 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java?rev=925004&r1=925003&r2=925004&view=diff ============================================================================== --- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java (original) +++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java Thu Mar 18 21:27:19 2010 @@ -204,6 +204,14 @@ public class DelegationTokenSecretManage } currentTokens.remove(identifier); } + + /** + * Returns the number of delegation keys currently stored. + * @return number of delegation keys + */ + public synchronized int getNumberOfKeys() { + return allKeys.size(); + } /** * Private helper methods to save delegation keys and tokens in fsimage Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java?rev=925004&r1=925003&r2=925004&view=diff ============================================================================== --- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java (original) +++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSecurityTokenEditLog.java Thu Mar 18 21:27:19 2010 @@ -96,7 +96,6 @@ public class TestSecurityTokenEditLog ex cluster.waitActive(); fileSys = cluster.getFileSystem(); final FSNamesystem namesystem = cluster.getNamesystem(); - namesystem.getDelegationTokenSecretManager().startThreads(); for (Iterator it = cluster.getNameDirs().iterator(); it.hasNext(); ) { File dir = new File(it.next().getPath()); @@ -110,6 +109,7 @@ public class TestSecurityTokenEditLog ex editLog.setBufferCapacity(2048); editLog.close(); editLog.open(); + namesystem.getDelegationTokenSecretManager().startThreads(); // Create threads and make them run transactions concurrently. Thread threadId[] = new Thread[NUM_THREADS]; @@ -129,13 +129,13 @@ public class TestSecurityTokenEditLog ex } editLog.close(); - editLog.open(); // Verify that we can read in all the transactions that we have written. // If there were any corruptions, it is likely that the reading in // of these transactions will throw an exception. // namesystem.getDelegationTokenSecretManager().stopThreads(); + int numKeys = namesystem.getDelegationTokenSecretManager().getNumberOfKeys(); for (Iterator it = fsimage.dirIterator(NameNodeDirType.EDITS); it.hasNext();) { File editFile = FSImage.getImageFile(it.next(), NameNodeFile.EDITS); @@ -143,9 +143,9 @@ public class TestSecurityTokenEditLog ex int numEdits = namesystem.getEditLog().loadFSEdits( new EditLogFileInputStream(editFile)); assertTrue("Verification for " + editFile + " failed. " + - "Expected " + (NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS + 2) + " transactions. "+ + "Expected " + (NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS + numKeys) + " transactions. "+ "Found " + numEdits + " transactions.", - numEdits == NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS +2); + numEdits == NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS +numKeys); } } finally {