Merging 2.1.8 fix to master : Bug 8801 - reserve some space for snapshots

StoragePoolAllocators need to respect storage.capacity.threshold in allocations - this was broken after StatsCollector started maintaining the primary storage Stats separately
Fixed allocator to refer the correct in-memory stats map.
This commit is contained in:
prachi 2011-03-09 13:46:07 -08:00
parent a0d79bda91
commit 34836aaaa5
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
// capacity check "storage.capacity.threshold"
if (sc != null) {
long totalSize = pool.getCapacityBytes();
StorageStats stats = sc.getStorageStats(pool.getId());
StorageStats stats = sc.getStoragePoolStats(pool.getId());
if(stats == null){
stats = sc.getStorageStats(pool.getId());
}
if (stats != null) {
double usedPercentage = ((double)stats.getByteUsed() / (double)totalSize);
if (s_logger.isDebugEnabled()) {