-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Stat collector solidfire capacity fix #4918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e2e9380
a8b03d4
589d5e5
deb57ed
2166d27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1020,14 +1020,22 @@ protected void runInContext() { | |
| if (answer != null && answer.getResult()) { | ||
| storagePoolStats.put(pool.getId(), (StorageStats)answer); | ||
|
|
||
| boolean poolNeedsUpdating = false; | ||
| // Seems like we have dynamically updated the pool size since the prev. size and the current do not match | ||
| if (pool.getCapacityBytes() != ((StorageStats)answer).getCapacityBytes() || | ||
| pool.getUsedBytes() != ((StorageStats)answer).getByteUsed()) { | ||
| pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes()); | ||
| if (pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) { | ||
| pool.setUsedBytes(((StorageStats) answer).getByteUsed()); | ||
| pool.setUpdateTime(new Date()); | ||
| if (_storagePoolStats.get(poolId) != null && _storagePoolStats.get(poolId).getCapacityBytes() != ((StorageStats)answer).getCapacityBytes()) { | ||
| if (((StorageStats)answer).getCapacityBytes() > 0) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sureshanaparti cc @DaanHoogland added check to log warning when capacity is reported 0; it's updated only when the value is > 0. |
||
| pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes()); | ||
| poolNeedsUpdating = true; | ||
| } else { | ||
| s_logger.warn("Not setting capacity bytes, received " + ((StorageStats)answer).getCapacityBytes() + " capacity for pool ID " + poolId); | ||
| } | ||
| } | ||
| if (pool.getUsedBytes() != ((StorageStats)answer).getByteUsed() && pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @sureshanaparti @mike-tutkowski - I've addressed the comment, removed the check for managed storage. |
||
| pool.setUsedBytes(((StorageStats) answer).getByteUsed()); | ||
| poolNeedsUpdating = true; | ||
| } | ||
| if (poolNeedsUpdating) { | ||
| pool.setUpdateTime(new Date()); | ||
| _storagePoolDao.update(pool.getId(), pool); | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.