[
https://issues.apache.org/jira/browse/HDFS-13898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16619418#comment-16619418
]
Erik Krogen commented on HDFS-13898:
------------------------------------
Hey [~csun], I realized a potential issue with this approach. The ORPP locks
itself to a single Observer at any time, scanning through NNs (to find another
observer) when it encounters an error. So if this exception is thrown, the ORPP
will end up losing its idea of which NN is the current observer, and have to
scan through all of them again on the next operation. I think we could solve
this in a less disruptive way by creating some new exception class which
indicates that _for this operation only_, use the active, but don't change
which observer is picked as the current.
I'm not sure if it's worth it, but I'm wondering if other such situations will
arise in the future, and if now would be a good time to support it.
> Throw retriable exception for getBlockLocations when ObserverNameNode is in
> safemode
> ------------------------------------------------------------------------------------
>
> Key: HDFS-13898
> URL: https://issues.apache.org/jira/browse/HDFS-13898
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Chao Sun
> Assignee: Chao Sun
> Priority: Major
> Attachments: HDFS-13898-HDFS-12943.000.patch,
> HDFS-13898-HDFS-12943.001.patch
>
>
> When ObserverNameNode is in safe mode, {{getBlockLocations}} may throw safe
> mode exception if the given file doesn't have any block yet.
> {code}
> try {
> checkOperation(OperationCategory.READ);
> res = FSDirStatAndListingOp.getBlockLocations(
> dir, pc, srcArg, offset, length, true);
> if (isInSafeMode()) {
> for (LocatedBlock b : res.blocks.getLocatedBlocks()) {
> // if safemode & no block locations yet then throw safemodeException
> if ((b.getLocations() == null) || (b.getLocations().length == 0)) {
> SafeModeException se = newSafemodeException(
> "Zero blocklocations for " + srcArg);
> if (haEnabled && haContext != null &&
> haContext.getState().getServiceState() ==
> HAServiceState.ACTIVE) {
> throw new RetriableException(se);
> } else {
> throw se;
> }
> }
> }
> }
> {code}
> It only throws {{RetriableException}} for active NN so requests on observer
> may just fail.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]