Bug 217622 - 1-line patch for daily/800.scrub_zfs to fix interval calculation
Summary: 1-line patch for daily/800.scrub_zfs to fix interval calculation
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Michael Reifenberger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-08 00:22 UTC by wbe
Modified: 2018-12-31 11:07 UTC (History)
1 user (show)

See Also:


Attachments
1-line patch to line 73 of 800.scrub-zfs to add " -v -70M" (608 bytes, patch)
2017-03-08 00:22 UTC, wbe
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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