From owner-freebsd-fs@freebsd.org Wed Sep 27 11:25:39 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B480FE317E3 for ; Wed, 27 Sep 2017 11:25:39 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from cu1176c.smtpx.saremail.com (cu1176c.smtpx.saremail.com [195.16.148.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0876E37E for ; Wed, 27 Sep 2017 11:25:38 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from [172.16.8.41] (unknown [192.148.167.11]) by proxypop02.sare.net (Postfix) with ESMTPA id 3C1229DD0DD for ; Wed, 27 Sep 2017 13:17:25 +0200 (CEST) From: Borja Marcos Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.0 \(3445.1.6\)) Subject: Problem with the periodic scrub of ZFS pools Message-Id: Date: Wed, 27 Sep 2017 13:17:24 +0200 To: FreeBSD FS X-Mailer: Apple Mail (2.3445.1.6) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2017 11:25:39 -0000 Hi, There=E2=80=99s a problem with the periodic script for ZFS pool = scrubbing (/etc/periodic/daily/800.scrub-zfs). It can be configured with an interval between scrubs = (daily_scrub_zfs_default_threshold=3D=E2=80=9C17=E2=80=9D) but the feature depends on making searches in the pool history. In a very = active ZFS pool (Mine has a lot of zfs dataset replications and there is a lot of zfs snapshot = creation/deletion/replication the scrub entries will disappear (the history has a finite length). In my case, for example, I configured 17 days between scrubs, I actually = get a weekly one. A better mechanism should be used to store the timestamp of the last = automated scrub. Custom attributes are a good candidate, but zpool doesn=E2=80=99t have that option. What = about adding it as a custom attribute to the root dataset of the pool? Ie, for a pool called =E2=80=9Ctank=E2=80=9D we could use =E2=80=9Czfs = set freebsd_period:last_scrub=3Dtimestamp=E2=80=9D or something slmilar. Ideas? Thanks! Borja.