Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
When ObserverNameNode is in safe mode, getBlockLocations may throw safe mode exception if the given file doesn't have any block yet.
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; } } } }
It only throws RetriableException for active NN so requests on observer may just fail.
Attachments
Attachments
Issue Links
- relates to
-
HDFS-14723 Add helper method FSNamesystem#setBlockManagerForTesting() in branch-2
- Resolved