-
Notifications
You must be signed in to change notification settings - Fork 143
Improve pool usage reporting #1460
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
Conversation
Test procedure
Test results
Fixed. |
|
Found another issue when using an odd number of drives in a pool, because I had accidentally removed an important line at some point. Made a slightly more exotic test case for 3x 2 GiB and 2x 1 GiB disks. Test results
@schakrava By the way, the current code spams quite a lot of debug messages that I used to verify the algorithm. This is not really useful for users; is there a nice way of enabling debug logging just for developers or should I just remove the logging output? |
Hi @sfranzen , just remove once you've completed your testing |
|
Ok, found another slightly annoying issue: the usable size shown in the Add Pool view is still calculated wrongly because that is coded into the Backbone view. I don't like duplicate code, so I will:
|
Partial fix of rockstor#1454. This algorithm should give an accurate report of the maximum available space in a storage pool, regardless of raid configuration and disk sizes. It will replace the current figure reported by btrfs.pool_usage.
Fixes the other part of rockstor#1454. New behaviour is to return only the used space value, but this now also includes space reserved by btrfs and unavailable for data.
Required in case of, for example, a 5-disk RAID10 setup.
Some refactoring was required to be able to use the new usage bound function, but I took the liberty of reorganising the rest of the code and hopefully make it more readable.
|
Ok, this is now ready for review/merging and depends on rockstor/rockstor-jslibs#7. In the end I changed quite a few more things than I originally planned to, but even though they are not very noticeable, I'm quite proud of how the pool creation view looks and functions now. Please try it out and let me know what you think. |
| block = fields[0][:-1].lower() | ||
| raid = fields[1][:-1].lower() | ||
| if not block in raid_d and raid is not 'DUP': | ||
| if block not in raid_d and raid is not 'DUP': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't me 😉 my editor does automatic PEP8 checking, it complains about a lot of small things.
|
|
||
| new_bound = usage_bound(disk_sizes, bounding_q + 1, raid_level) | ||
|
|
||
| return bound * ((chunks / data_ratio) - parity) + new_bound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thank you!
|
@sfranzen to your question about logging, we CAN turn off debug messages by setting log level in settings.conf.in prior to building Rockstor in any environment. I think we should at some point not have debug level for production(rpm build) by default but can provide a simple script to turn it on to aid in troubleshooting. see #1478. and thanks for bringing this up. |
|
Thank you for improving code quality and detailed work log @sfranzen . Very nicely done. I am ok merging this pr, but I do like to ask a few questions and perhaps suggest some improvements. It's totally up to you to implement them in this pr or the next(my preference).
|
|
@sfranzen I'll wait for your reply on (1). If you like me to wait until you fix it, let me know. If not I'll merge this as is and you can submit another pr. |
|
@schakrava Thanks for the feedback.
|
|
Thanks @sfranzen. Nice work! |
Will fix #1454. Should now work for any pool configuration; test results to follow.