SOLVED Where does Scrub task get its info from for threshold?

NASbox

Guru
Joined
May 8, 2012
Messages
650
TLDR; For the benefit of others - A runs according to schedule shown by the GUI, but the actual scrub only runs if at time, the number of days since the last scrub exceeds the threshold.
Credit to @sretalla for the above info.
--------------------------------------------------------------------------------

I have two pools, and I don't want them to scrub at the same time. I currently have my scrub threshold set to 35 days (5 Weeks).

I had my TrueNAS down for a couple of weeks, and when I brought it back it up the GUI showed 7 days before running scrub on both days. So I turned off, one pool, let the other one run, and then the second one back on, but the days till next run are still synchronized.

These lines come from zpool status on both pools:

scan: scrub repaired 0B in 14:52:29 with 0 errors on Sat Aug 19 17:54:16 2023
scan: scrub repaired 0B in 11:55:15 with 0 errors on Sat Aug 12 13:55:17 2023

The threshold is set for 35 days, and the next run shows 2 days!

What do I need to do to get them out of step? Have I found a bug?
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The run of the task isn't what you think.

It's just checking if the threshold is met and does nothing if it isn't.

If you want them out of sequence, you need to set the threshold on one of the tasks higher by the desired number of days until it runs once (the scrub, not the task, which will run many times in between scrubs), then set it back, that will give you the out of step combination you want.

Not 100% on this one, but it may also be possible just to run a manual scrub offset by the desired gap on one pool, if the threshold is just checking zpool history | grep scrub to calculate the days since last scrub to compare to the threshold.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
@sretalla thanks for the reply.

So IIUC the task will run, but no scrub will occur. As per my original post, the two pools were scrubbed 1 week apart, so as long as the 35 day limit is in play, nothing will happen in 2 days, and eventually 1 pool will scrub, and a week later the other pool will scrub. Have I got this correct?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So IIUC the task will run, but no scrub will occur. As per my original post, the two pools were scrubbed 1 week apart, so as long as the 35 day limit is in play, nothing will happen in 2 days, and eventually 1 pool will scrub, and a week later the other pool will scrub. Have I got this correct?
Sounds right.

All you're controlling with the schedule is the opportunity to run, not the minimum days between runs (that's the threshold's job).
 
Top