Bug 217622

Summary: 1-line patch for daily/800.scrub_zfs to fix interval calculation
Product: Base System Reporter: wbe
Component: miscAssignee: Michael Reifenberger <mr>
Status: Closed FIXED    
Severity: Affects Many People CC: mr
Priority: --- Keywords: patch
Version: 11.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
1-line patch to line 73 of 800.scrub-zfs to add " -v -70M" none

Description wbe 2017-03-08 00:22:11 UTC
Created attachment 180615 [details]
1-line patch to line 73 of 800.scrub-zfs to add " -v -70M"

The enclosed patch improves the time-since-last-scrub calculation.
In general, for, say, the default interval of 35 days, the old code treats
34d 23h 59m 59s as 34 days and defers scrubbing to the next day, making the
actual interval 36 days.  In addition, there are two typical causes of being
a few seconds (or minutes) shy of a full day:
1) a few seconds pass between the date test and the actual starting of a scrub;
and 2) when 410.pkg-audit is run before 800.scrub-zfs, a random interval of up
to 1 hour is introduced.

Adding " -v 70M" to the date command effectively rounds up anything within 70 minutes of a full day to the next full day.

This affects everyone using periodic daily/800.scrub-zfs.
 -WBE
Comment 1 wbe 2017-03-20 14:49:10 UTC
Typo in the description.  The subject line and the patch were correct, but
"Adding " -v 70M" to the date command..." should have said
"Adding " -v -70M" to the date command...".
 -WBE
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-05-20 16:47:39 UTC
A commit references this bug:

Author: mr
Date: Sat May 20 16:47:00 UTC 2017
New revision: 318577
URL: https://svnweb.freebsd.org/changeset/base/318577

Log:
  Improve time-since-last-scrub calculation.
  This can be needed to compensate anticongestion delays in 410.pkg-audit or 480.leapfile-ntpd.

  PR:		217622
  Submitted by:	wbe@psr.com
  MFC after:	2 weeks

Changes:
  head/etc/periodic/daily/800.scrub-zfs
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-23 10:28:01 UTC
batch change of PRs untouched in 2018 marked "in progress" back to open.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-12-31 11:06:30 UTC
A commit references this bug:

Author: mr
Date: Mon Dec 31 11:05:39 UTC 2018
New revision: 342647
URL: https://svnweb.freebsd.org/changeset/base/342647

Log:
  Merge forgotten r318577 to close PR.

  PR:		217622

Changes:
  stable/11/etc/periodic/daily/800.scrub-zfs