HDFS-8321. CacheDirectives and CachePool operations should throw RetriableException in safemode. Contributed by Haohui Mai.
This commit is contained in:
parent
976a3c1f9d
commit
f6b908ab07
|
@ -321,6 +321,9 @@ Release 2.8.0 - UNRELEASED
|
|||
HDFS-8325. Misspelling of threshold in log4j.properties for tests.
|
||||
(Brahma Reddy Battula via aajisaka)
|
||||
|
||||
HDFS-8321. CacheDirectives and CachePool operations should throw
|
||||
RetriableException in safemode. (wheat9)
|
||||
|
||||
Release 2.7.1 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -7673,10 +7673,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot add cache directive", safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot add cache directive");
|
||||
effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager,
|
||||
directive, flags, logRetryCache);
|
||||
} finally {
|
||||
|
@ -7704,10 +7701,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot add cache directive", safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot add cache directive");
|
||||
FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags,
|
||||
logRetryCache);
|
||||
success = true;
|
||||
|
@ -7728,10 +7722,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot remove cache directives", safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot remove cache directives");
|
||||
FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache);
|
||||
success = true;
|
||||
} finally {
|
||||
|
@ -7771,10 +7762,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
String poolInfoStr = null;
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot add cache pool " + req.getPoolName(), safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot add cache pool"
|
||||
+ (req == null ? null : req.getPoolName()));
|
||||
CachePoolInfo info = FSNDNCacheOp.addCachePool(this, cacheManager, req,
|
||||
logRetryCache);
|
||||
poolInfoStr = info.toString();
|
||||
|
@ -7794,10 +7783,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
boolean success = false;
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot modify cache pool " + req.getPoolName(), safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot modify cache pool"
|
||||
+ (req == null ? null : req.getPoolName()));
|
||||
FSNDNCacheOp.modifyCachePool(this, cacheManager, req, logRetryCache);
|
||||
success = true;
|
||||
} finally {
|
||||
|
@ -7818,10 +7805,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
boolean success = false;
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
if (isInSafeMode()) {
|
||||
throw new SafeModeException(
|
||||
"Cannot remove cache pool " + cachePoolName, safeMode);
|
||||
}
|
||||
checkNameNodeSafeMode("Cannot modify cache pool" + cachePoolName);
|
||||
FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName,
|
||||
logRetryCache);
|
||||
success = true;
|
||||
|
|
Loading…
Reference in New Issue