Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 2010 16:29:43 -0400
From:      jhell <jhell@DataIX.net>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: daily run output 800.scrub-zfs fixups
Message-ID:  <4C703737.3020007@DataIX.net>
In-Reply-To: <20100821215052.000030f1@unknown>
References:  <4C6F5344.6040808@DataIX.net> <20100821215052.000030f1@unknown>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030703000401080309080401
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 08/21/2010 15:50, Alexander Leidinger wrote:
> On Sat, 21 Aug 2010 00:17:08 -0400 jhell <jhell@DataIX.net> wrote:
> 
>>
>> Hi Alexander,
>>
>> Attached is a fix for one problem and one slight overlook for
>> 800.scrub-zfs.
>>
>> The first & second change was probably just an oversight but none the
>> less they both give a false impression of actions taken.
>>
>> Change1:
>> 	${daily_scrub_zfs_default_threshold=30} is missng the ':'
>> which would ultimately reset the users supplied value in
>> periodic.conf to 30.
> 
> I will have a look at this.
> 
>> Change2:
>> 	${_scrub_diff} -le ${_pool_threshold} would cause the scrub
>> to be run on the day after the threshold was met. So I changed '-le'
>> -> '-lt' which causes it to be run on the 30th day instead of the
>> 31st day.
> 
> This depends how you define threshold... I had number of days between
> scrubs in my mind. Now it depends what I wrote in the man page, if it
> tells what I had in mind (I don't remember, I have to look at it
> myself, but I'm not a native english speaker, so I may have not wrote
> it good enough).
> 

I believe that people in this case would think that if they set the
threshold to 12 days that its going to run on the same day that the
threshold was expired and not the 13th. Usually when thresholds are met
the commands are fired that same instance and not a day later.

> This is not set in stone, if the majority of people want something
> else, I'm surely not in the way.
> 

Also I just noticed another confusing message 'at least for me' that
said "starting first scrubbing (after reboot) of pool 'exports'". I read
that like it is going to scrub the pool after the next reboot. I
actually had to open up the script to double check that was not the
case. The new attached patch changes the message to "starting scrub of
pool 'pool'" so there is no confusion of when the scrub is actually
going to happen.


Regards,

-- 

 jhell,v

--------------030703000401080309080401
Content-Type: text/x-patch;
 name="800.scrub-zfs.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="800.scrub-zfs.diff"

Index: etc/periodic/daily/800.scrub-zfs
===================================================================
--- etc/periodic/daily/800.scrub-zfs	(revision 211527)
+++ etc/periodic/daily/800.scrub-zfs	(working copy)
@@ -11,7 +11,7 @@
     source_periodic_confs
 fi
 
-: ${daily_scrub_zfs_default_threshold=30}
+: ${daily_scrub_zfs_default_threshold:=30}
 
 case "$daily_scrub_zfs_enable" in
     [Yy][Ee][Ss])
@@ -53,7 +53,7 @@
 		# Now minus last scrub (both in seconds) converted to days.
 		_scrub_diff=$(expr -e \( $(date +%s) - \
 		    $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
-		if [ ${_scrub_diff} -le ${_pool_threshold} ]; then
+		if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then
 			echo "   skipping scrubbing of pool '${pool}':"
 			echo "      last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days"
 			continue
@@ -65,11 +65,11 @@
 				echo "   scrubbing of pool '${pool}' already in progress, skipping:"
 				;;
 			*"none requested"*)
-				echo "   starting first scrubbing (after reboot) of pool '${pool}':"
+				echo "   starting scrub of pool '${pool}':"
 				zpool scrub ${pool}
 				;;
 			*)
-				echo "   starting scrubbing of pool '${pool}':"
+				echo "   starting scrub of pool '${pool}':"
 				zpool scrub ${pool}
 				;;
 		esac

--------------030703000401080309080401--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C703737.3020007>