You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Eli Collins (Created) (JIRA)" <ji...@apache.org> on 2011/12/17 21:01:30 UTC
[jira] [Created] (HDFS-2702) A single failed name dir can cause the
NN to exit
A single failed name dir can cause the NN to exit
--------------------------------------------------
Key: HDFS-2702
URL: https://issues.apache.org/jira/browse/HDFS-2702
Project: Hadoop HDFS
Issue Type: Bug
Affects Versions: 0.20.205.0
Reporter: Eli Collins
Assignee: Eli Collins
Priority: Critical
Fix For: 1.1.0
There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
{code}
close() // So editStreams.size() is 0
foreach edits dir {
..
eStream = new ... // Might get an IOE here
editStreams.add(eStream);
} catch (IOException ioe) {
removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
}
{code}
If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Attachment: hdfs-2702.txt
#1-2 Good suggestions. Done.
#3 Yea, no guava in branch-1.
#4 That's what causes the bug (on log roll when we close all and add streams we'll exit the NN when we don't mean to). I considered folding the check into the removeEdits and making it conditional (so we don't trigger it in log roll) but there are a number of places where we want to trigger this check where we are not removing edits so it seemed cleaner to always call it explicitly.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172025#comment-13172025 ]
Todd Lipcon commented on HDFS-2702:
-----------------------------------
- in {{fatalExit}}, can you change it to:
{code}
FSNamesystem.LOG.faral(msg, new Exception(msg));
{code}
so that we get a stacktrace in the logs?
- in {{exitIfNoStreams}} use {{isEmpty}} instead of comparing {{size() == 0}}
- rather than an {{if...throw AssertionError}} maybe just use the {{Preconditions.checkState}} function from guava? Or is guava not in branch-1 yet? (can't remember)
- instead of calling {{exitIfNoStreams}} everywhere, maybe {{removeEditsForStorageDir}} can just call it whenever it removes one?
Otherwise looks good.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172513#comment-13172513 ]
Todd Lipcon commented on HDFS-2702:
-----------------------------------
Oh, right. duh :) Thanks, +1.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Matt Foley (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Foley updated HDFS-2702:
-----------------------------
Fix Version/s: (was: 1.1.0)
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Fix For: 1.0.2
>
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Attachment: hdfs-2702.txt
Patch attached. Depends on HDFS-2701 and HDFS-2703. I verified the NN no longer exits after checkpointing when a single dir failed. I'm working on a unit test for this jira and 2703 but thought I'd put up a fix for review in the meantime.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Suresh Srinivas (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Suresh Srinivas updated HDFS-2702:
----------------------------------
Target Version/s: 1.0.2
Fix Version/s: 1.0.2
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Fix For: 1.1.0, 1.0.2
>
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Target Version/s: (was: 1.1.0)
Fix Version/s: 1.1.0
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Fix For: 1.1.0
>
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Component/s: name-node
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Fix For: 1.1.0
>
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171678#comment-13171678 ]
Eli Collins commented on HDFS-2702:
-----------------------------------
This bug exists in FSEditLog#close as well.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171685#comment-13171685 ]
Eli Collins commented on HDFS-2702:
-----------------------------------
And verified the NN still exits after all storage directories have failed.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Target Version/s: 1.1.0
Affects Version/s: (was: 0.20.205.0)
1.1.0
Fix Version/s: (was: 1.1.0)
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172612#comment-13172612 ]
Todd Lipcon commented on HDFS-2702:
-----------------------------------
I think the addendum is correct. I wish we had a fault injection point for each of these cases, but that's a larger amount of work... something like how we use ErrorSimulator for errors in checkpoints would be great.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Attachment: hdfs-2702.txt
Slightly updated patch. I made FSEditLog#logEdit throw an AssertionError (rather than just assert) so we stop the NN if there's a bug where we forget to remove an edit stream after we notice a failed directory. This should never fire, but could if we introduced a bug where eg we missed a call to removeEdits. Updated the test to check that we can't log an edit if there are no streams.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Eli Collins (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins resolved HDFS-2702.
-------------------------------
Resolution: Fixed
Hadoop Flags: Reviewed
Tests and test-patch are clean. I've committed this.
Thanks for the review Todd!
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Attachment: hdfs-2702.txt
Thanks Todd. Minor update to previous patch. It's not technically part of this change but good to fix at the same time. The question in the current comment in purgeEditLog is valid, let's fix that. Note that we won't and don't want to bail out since we've just closed all the logs.
{code}
- // Should we also remove from edits
+ sd.unlock();
+ removeEditsForStorageDir(sd);
fsimage.updateRemovedDirs(sd, null);
it.remove();
{code}
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-2702) A single failed name dir can cause
the NN to exit
Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172694#comment-13172694 ]
Eli Collins commented on HDFS-2702:
-----------------------------------
Agree, we'd need something like ErrorSimulator to cover this case, given that this is all re-written and tested well in trunk I don't I think for branch-1 it's not worth the energy.
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Attachment: hdfs-2702.txt
Updated patch with new test class that covers:
#1 The NN doesn't exit as long as it has a valid storage dir
#2 The NN exits when it no longer has a valid storage dir
#3 Removed storage dirs is updated (fails w/o HDFS-2703)
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
> Attachments: hdfs-2702.txt, hdfs-2702.txt
>
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-2702) A single failed name dir can cause the
NN to exit
Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eli Collins updated HDFS-2702:
------------------------------
Affects Version/s: (was: 1.1.0)
1.0.0
> A single failed name dir can cause the NN to exit
> --------------------------------------------------
>
> Key: HDFS-2702
> URL: https://issues.apache.org/jira/browse/HDFS-2702
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Eli Collins
> Assignee: Eli Collins
> Priority: Critical
>
> There's a bug in FSEditLog#rollEditLog which results in the NN process exiting if a single name dir has failed. Here's the relevant code:
> {code}
> close() // So editStreams.size() is 0
> foreach edits dir {
> ..
> eStream = new ... // Might get an IOE here
> editStreams.add(eStream);
> } catch (IOException ioe) {
> removeEditsForStorageDir(sd); // exits if editStreams.size() <= 1
> }
> {code}
> If we get an IOException before we've added two edits streams to the list we'll exit, eg if there's an error processing the 1st name dir we'll exit even if there are 4 valid name dirs. The fix is to move the checking out of removeEditsForStorageDir (nee processIOError) or modify it so it can be disabled in some cases, eg here where we don't yet know how many streams are valid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira