From owner-svn-src-vendor@freebsd.org Thu Nov 21 14:01:00 2019 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C3021BFBF9; Thu, 21 Nov 2019 14:01:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Jh6h0tXFz4RPV; Thu, 21 Nov 2019 14:01:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028F9C478; Thu, 21 Nov 2019 14:01:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xALE0xOg042020; Thu, 21 Nov 2019 14:00:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xALE0xl7042019; Thu, 21 Nov 2019 14:00:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911211400.xALE0xl7042019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 21 Nov 2019 14:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r354955 - in vendor/illumos/dist: cmd/zpool man/man1m X-SVN-Group: vendor X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in vendor/illumos/dist: cmd/zpool man/man1m X-SVN-Commit-Revision: 354955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2019 14:01:00 -0000 Author: avg Date: Thu Nov 21 14:00:59 2019 New Revision: 354955 URL: https://svnweb.freebsd.org/changeset/base/354955 Log: 10900 Fix estimated scrub completion time illumos/illumos-gate@3db6627c6730f7ec4426ac0be0e9338235aed2d8 https://github.com/illumos/illumos-gate/commit/3db6627c6730f7ec4426ac0be0e9338235aed2d8 https://www.illumos.org/issues/10900 ZoL update: Author: Tom Caputi Date: Wed May 1 20:34:24 2019 -0400 Fix estimated scrub completion time Currently, it is possible for the 'zpool scrub' command to progress slightly beyond 100% due to concurrent changes happening on the live pool. This behavior is expected, but the userspace code for 'zpool status' would subtract the expected amount of data from the amount of data already scrubbed, resulting in a negative integer being casted to a large positive one. This number was then used to calculate the estimated completion time, resulting in wildly wrong results. This code changes the behavior so that 'zpool status' does not attempt to report an estimate during this period. Reviewed by: Brian Behlendorf Reviewed-by: Igor Kozhukhov Reviewed-by: George Melikov Signed-off-by: Tom Caputi Closes #8611 Closes #8687 After this fix, the zpool status output does display more reasonable output. Author: Tom Caputi Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/man/man1m/zpool.1m Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Thu Nov 21 14:00:09 2019 (r354954) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Thu Nov 21 14:00:59 2019 (r354955) @@ -4804,7 +4804,7 @@ print_scan_status(pool_scan_stat_t *ps) scan_rate = pass_scanned / elapsed; issue_rate = pass_issued / elapsed; - total_secs_left = (issue_rate != 0) ? + total_secs_left = (issue_rate != 0 && total >= issued) ? ((total - issued) / issue_rate) : UINT64_MAX; days_left = total_secs_left / 60 / 60 / 24; @@ -4838,7 +4838,8 @@ print_scan_status(pool_scan_stat_t *ps) } if (pause == 0) { - if (issue_rate >= 10 * 1024 * 1024) { + if (total_secs_left != UINT64_MAX && + issue_rate >= 10 * 1024 * 1024) { (void) printf(gettext(", %llu days " "%02llu:%02llu:%02llu to go\n"), (u_longlong_t)days_left, (u_longlong_t)hours_left, Modified: vendor/illumos/dist/man/man1m/zpool.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zpool.1m Thu Nov 21 14:00:09 2019 (r354954) +++ vendor/illumos/dist/man/man1m/zpool.1m Thu Nov 21 14:00:59 2019 (r354955) @@ -1808,6 +1808,10 @@ If a scrub is paused, the resumes it. If a resilver is in progress, ZFS does not allow a scrub to be started until the resilver completes. +.Pp +Note that, due to changes in pool data on a live system, it is possible for +scrubs to progress slightly beyond 100% completion. +During this period, no completion time estimate will be provided. .Bl -tag -width Ds .It Fl s Stop scrubbing.