On Fri, 2009-09-11 at 13:51 -0400, Will Murnane wrote:
> On Thu, Sep 10, 2009 at 13:06, Will Murnane <will.murn...@gmail.com> wrote:
> > On Wed, Sep 9, 2009 at 21:29, Bill Sommerfeld <sommerf...@sun.com> wrote:
> >>> Any suggestions?
> >>
> >> Let it run for another day.
> > I'll let it keep running as long as it wants this time.
>  scrub: scrub completed after 42h32m with 0 errors on Thu Sep 10 17:20:19 2009
> 
> And the people rejoiced.  So I guess the issue is more "scrubs may
> report ETA very inaccurately" than "scrubs never finish".  Thanks for
> the suggestions and support.

One of my pools routinely does this -- the scrub gets to 100% after
about 50 hours but keeps going for another day or more after that.

It turns out that zpool reports "number of blocks visited" vs "number of
blocks allocated", but clamps the ratio at 100%.

If there is substantial turnover in the pool, it appears you may end up
needing to visit more blocks than are actually allocated at any one
point in time.

I made a modified version of the zpool command and this is what it
prints for me:

...
 scrub: scrub in progress for 74h25m, 119.90% done, 0h0m to go
         5428197411840 blocks examined, 4527262118912 blocks allocated
...

This is the (trivial) source change I made to see what's going on under
the covers:

diff -r 12fb4fb507d6 usr/src/cmd/zpool/zpool_main.c
--- a/usr/src/cmd/zpool/zpool_main.c    Mon Oct 26 22:25:39 2009 -0700
+++ b/usr/src/cmd/zpool/zpool_main.c    Tue Nov 10 17:07:59 2009 -0500
@@ -2941,12 +2941,15 @@
 
        if (examined == 0)
                examined = 1;
-       if (examined > total)
-               total = examined;
 
        fraction_done = (double)examined / total;
-       minutes_left = (uint64_t)((now - start) *
-           (1 - fraction_done) / fraction_done / 60);
+       if (fraction_done < 1) {
+               minutes_left = (uint64_t)((now - start) *
+                   (1 - fraction_done) / fraction_done / 60);
+       } else {
+               minutes_left = 0;
+       }
+
        minutes_taken = (uint64_t)((now - start) / 60);
 
        (void) printf(gettext("%s in progress for %lluh%um, %.2f%% done,
"
@@ -2954,6 +2957,9 @@
            scrub_type, (u_longlong_t)(minutes_taken / 60),
            (uint_t)(minutes_taken % 60), 100 * fraction_done,
            (u_longlong_t)(minutes_left / 60), (uint_t)(minutes_left %
60));
+       (void) printf(gettext("\t %lld blocks examined, %lld blocks
allocated\n"),
+           examined,
+           total);
 }
 
 static void

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to