-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add trim support to zpool wait #10071
Conversation
b166e6c
to
42ee0a7
Compare
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.
Thanks for tackling this last bit of zpool wait
functionality!
Manual trims fall into the category of long-running pool activities which people might want to wait synchronously for. This change adds support to 'zpool wait' for waiting for manual trim operations to complete. It also adds a '-w' flag to 'zpool trim' which can be used to turn 'zpool trim' into a synchronous operation. Signed-off-by: John Gallagher <john.gallagher@delphix.com>
42ee0a7
to
71e407b
Compare
Codecov Report
@@ Coverage Diff @@
## master #10071 +/- ##
========================================
- Coverage 79% 79% -<1%
========================================
Files 386 386
Lines 122316 122349 +33
========================================
- Hits 97059 97005 -54
- Misses 25257 25344 +87
Continue to review full report at Codecov.
|
Manual trims fall into the category of long-running pool activities which people might want to wait synchronously for. This change adds support to 'zpool wait' for waiting for manual trim operations to complete. It also adds a '-w' flag to 'zpool trim' which can be used to turn 'zpool trim' into a synchronous operation. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Signed-off-by: John Gallagher <john.gallagher@delphix.com> Closes openzfs#10071
Motivation and Context
#9162 added
zpool wait
, which provides a mechanism for waiting synchronously for the completion of long-running pool activities such as scrubs and device removals.zpool wait
doesn't support waiting for the completion of manualtrim
operations though, since it was written initially beforetrim
support was integrated. However, manual trims fall into the category of long-running pool activities which people might want to wait synchronously for, so this change adds the missing trim support tozpool wait
.Description
With this change, users can run
zpool wait -t trim <pool>
to wait for all of the vdevs in the pool with trims in progress to finish being trimmed. They can also add a-w
flag to the command that starts the trim (i.e.zpool trim -w <pool>
) to makezpool trim
synchronous.The logic to wait for trims to complete is implemented in a very similar manner to the logic to wait for device initialization to complete, since the interfaces for and implementations of trimming and initialization are very similar.
How Has This Been Tested?
Added tests to cover the new functionality.
Types of changes
Checklist:
Signed-off-by
.