-
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
zpool import progress indicator #8646
Conversation
af1fff3
to
dbb23c2
Compare
The idea is good. But I’m not sure about stderr. It seems more consistent to have a zpool import —verbose option and print to stdout. Perhaps some of the other automation and appliance builders can comment on how this might affect the automation and reporting? |
@richardelling thanks for the feedback. |
Codecov Report
@@ Coverage Diff @@
## master #8646 +/- ##
==========================================
+ Coverage 75.17% 79.67% +4.49%
==========================================
Files 402 394 -8
Lines 128071 124719 -3352
==========================================
+ Hits 96283 99372 +3089
+ Misses 31788 25347 -6441
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
d47cd40
to
6555737
Compare
@ofaaland This seems like a nice enhancement to |
I think I might just need to rebase it. It's been a while as you see. The original version implemented both the kstat and the utility changes, but then IIRC I broke that into two parts, and Brian approved the kstat.
…-Olaf
________________________________________
From: Matthew Ahrens ***@***.***>
Sent: Friday, June 4, 2021 4:46 PM
To: openzfs/zfs
Cc: Faaland, Olaf P.; Mention
Subject: Re: [openzfs/zfs] zpool import progress indicator [WIP] (#8646)
@ofaaland<https://urldefense.us/v3/__https://github.com/ofaaland__;!!G2kpM7uM-TzIFchu!kp599p1GtNr5Xd_iAWTXvS5dQnR3XZMRlEYcRuvg0aP7F5cbjggKmDelpt1TyVaF7w$> This seems like a nice enhancement to zpool import. I see that it's marked "work in progress". What additional work needs to be done to get it ready to review and integrate?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https://github.com/openzfs/zfs/pull/8646*issuecomment-855129636__;Iw!!G2kpM7uM-TzIFchu!kp599p1GtNr5Xd_iAWTXvS5dQnR3XZMRlEYcRuvg0aP7F5cbjggKmDelpt2cMTH5EQ$>, or unsubscribe<https://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AB73C4ZSUK2B2ETWSBDR3NLTRFQTXANCNFSM4HHI7AWA__;!!G2kpM7uM-TzIFchu!kp599p1GtNr5Xd_iAWTXvS5dQnR3XZMRlEYcRuvg0aP7F5cbjggKmDelpt3LMB_q8Q$>.
|
I confirmed this PR is just for the utility changes. The rebase was fairly clean so it might still work fine (haven't tested yet). I haven't written tests for the utility changes yet. I'll work on that - it would be nice to get this done. |
a6584d0
to
986d678
Compare
290864e
to
ddcc1c1
Compare
Hi, before reviewing this for detail stuff, I have a question. I've altered the existing MMP tests to use the output of Options I've come up with are:
I don't really think options 2 or 3 really add much, although the 3 would allow the test to check which TXG numbers reported are reasonable. Do you have any thoughts? Thanks |
e44440b
to
e930c99
Compare
@freqlabs @nabijaczleweli @asomers I have a linux/freebsd compat question and see you've contributed several freebsd-related patches. My patch needs to read a kstat. On linux that's done with something like Googling around it looks like kstats are accessible on freebsd systems under |
There is no |
Awesome, thank you |
b1a689e
to
1df3d3a
Compare
On linux, kstats are fetched with open(),read(),close() or similar. On freebsd, they are fetched with sysctl. Create compat functions that do the right thing for the platform. Currently handles only kstats which are directly below "zfs". Signed-off-by: Olaf Faaland <[email protected]>
When an import requires a long MMP activity check, or when the user requests pool recovery, the import make take a long time. The user may not know why, or be able to tell whether the import is progressing or is hung. Add a new option to "zpool import", "-v" (for verbose). When the -v option is used, create an additional thread which periodically checks the contents of kstat/zfs/import_progress. If the import does not finish quickly, it reports the following on stdout: * Name and guid of pool being imported * User-friendly version of spa_load_state * Expected time import will complete * the max txg if recovering the pool If one or more of these values change, the thread prints a new record. A new record will be printed to stdout with a maximum frequency of one per second so as not to spam the user. As a result the printed output may reflect only some of the import states transitioned through. Use import kstat to check for Multihost activity check in relevant tests, instead of using import duration, which works poorly when testing on a slow machine. Sample output: Pool tank1 (guid 4591991398949870326): Checking for a remote import. Check will complete by Tue Apr 16 08:43:58 2019 Pool tank1 (guid 4591991398949870326): Checking for a remote import. Check will complete by Tue Apr 16 08:44:43 2019 Recovering Pool max txg 745 Signed-off-by: Olaf Faaland <[email protected]>
1df3d3a
to
c7b9aa8
Compare
The sysctls on FreeBSD are typed, they're not all text like the kstat files on Linux. That throws a bit of a monkey wrench into the kstat_read interface. It will work for the import_progress kstat because we happened to reuse most of what Linux was doing for that instead of having separate properly typed fields, but more generally we don't expose kstats as text. Briefly looking over kstat_read(3) and kstat(3kstat) manuals for illumos, it seems to be a similar situation there. Linux is the oddball in exposing kstats as strings of text. |
Thanks, @freqlabs |
To move this forward I think it makes sense to abandon the idea of a general |
@freqlabs,
I agree, I'll do that. Thanks for the information. |
This is mostly replaced by more detailed #15539 & Co. |
Motivation and Context
When an import requires a long MMP activity check, or when the user
requests pool recovery, the import make take a long time. The user may
not know why, or be able to tell whether the import is progressing or is
hung.
Description
A previous commit added a kstat which lists all imports currently
being processed by the
kernel (currently only one at a time is possible, but the kstat allows
for more than one). The kstat is at
/proc/spl/kstat/zfs/import_progress.
In the zpool utility, create an additional thread which periodically
checks the contents of this kstat. If the import does not finish
quickly, it reports the following on stderr:
If one or more of these values change, the thread prints a new record.
A new record will be printed to stderr with a maximum frequency of one
per second so as not to spam the user. As a result the printed output
may reflect only some of the import states transitioned through.
Sample output:
How Has This Been Tested?
Hand testing with and without multihost check triggered, and with and without zpool -FX -T arguments.
Types of changes
Checklist:
Signed-off-by
.