hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r738328 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Date Wed, 28 Jan 2009 01:14:35 GMT
Author: rangadi
Date: Wed Jan 28 01:14:35 2009
New Revision: 738328

URL: http://svn.apache.org/viewvc?rev=738328&view=rev
Log:
HADOOP-4999. A failure to write to FsEditsLog results in
IndexOutOfBounds exception. (Boris Shkolnik via rangadi)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=738328&r1=738327&r2=738328&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Jan 28 01:14:35 2009
@@ -646,6 +646,9 @@
     HADOOP-4671. Mark loop control variables shared between threads as
     volatile. (cdouglas)
 
+    HADOOP-4999. A failure to write to FsEditsLog esults in 
+    IndexOutOfBounds exception. (Boris Shkolnik via rangadi)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=738328&r1=738327&r2=738328&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java Wed Jan
28 01:14:35 2009
@@ -843,13 +843,15 @@
   synchronized void logEdit(byte op, Writable ... writables) {
     assert this.getNumEditStreams() > 0 : "no editlog streams";
     long start = FSNamesystem.now();
-    int numEditStreams = editStreams.size();
-    for (int idx = 0; idx < numEditStreams; idx++) {
+    for (int idx = 0; idx < editStreams.size(); idx++) {
       EditLogOutputStream eStream = editStreams.get(idx);
       try {
         eStream.write(op, writables);
       } catch (IOException ie) {
         processIOError(idx);         
+        // processIOError will remove the idx's stream 
+        // from the editStreams collection, so we need to update idx
+        idx--; 
       }
     }
     // get a new transactionId



Mime
View raw message