HDFS-10448. CacheManager#addInternal tracks bytesNeeded incorrectly when dealing with replication factors other than 1 (Yiqun Lin via cmccabe)
(cherry picked from commit46f1602e89
) (cherry picked from commit4e11f33ccc
)
This commit is contained in:
parent
29c3ee9744
commit
9b51420ea5
|
@ -396,8 +396,7 @@ public final class CacheManager {
|
|||
if (pool.getLimit() == CachePoolInfo.LIMIT_UNLIMITED) {
|
||||
return;
|
||||
}
|
||||
if (pool.getBytesNeeded() + (stats.getBytesNeeded() * replication) > pool
|
||||
.getLimit()) {
|
||||
if (pool.getBytesNeeded() + stats.getBytesNeeded() > pool.getLimit()) {
|
||||
throw new InvalidRequestException("Caching path " + path + " of size "
|
||||
+ stats.getBytesNeeded() / replication + " bytes at replication "
|
||||
+ replication + " would exceed pool " + pool.getPoolName()
|
||||
|
@ -441,7 +440,7 @@ public final class CacheManager {
|
|||
}
|
||||
}
|
||||
return new CacheDirectiveStats.Builder()
|
||||
.setBytesNeeded(requestedBytes)
|
||||
.setBytesNeeded(requestedBytes * replication)
|
||||
.setFilesCached(requestedFiles)
|
||||
.build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue