-
Type:
Sub-task
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: HDFS-12943, 3.3.0
-
Component/s: None
-
Labels:None
-
Hadoop Flags:Reviewed
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.
- relates to
-
HDFS-14723 Add helper method FSNamesystem#setBlockManagerForTesting() in branch-2
-
- Resolved
-