Ok, so I hacked together this script that sysvinit should call if there is a
RAID resync in progress. I cannot tell if the bug that originally was
discovered *only* happened if swap was on a RAID device, or if swapon was
started while ANY raid device was resynchronizing. Until someone tells me
the specifics, I am sticking with the most broadest case:

so instead of:

----
    if [ ! -e /proc/mdstat ] || \ 
                   [ ! grep grep swap /etc/fstab | awk -F/ '(print $3}' \ 
                     /proc/mdstat | grep resync ] ; then 
              swapon -a 2> /dev/null 
    fi 
----

I am going to replace it with:

if egrep '(resync|delay)' /tmp/mdstat 2>&1 >/dev/null 
then 
  echo "Raid resynchronization in progress, swapon delayed 10 minutes" 
  /etc/init.d/raiddelay.sh& 
fi         

and in /etc/init.d/raiddelay.sh I have:

#!/bin/sh
while  egrep '(resync|delay)' /tmp/mdstat 2>&1 >/dev/null 
do 
  sleep 10m 
done 
 
swapon -a


Does anyone see a problem with this? I wasn't sure if resync and delay would
catch all cases, but this is sure better than what is there now! 

Like I said, if someone can give me the details on the kernel panic with
swap and raid resync I would gladly tune this... like just check to see if
raid is on a swap device and if so delay it then, otherwise don't delay it.


Micah











On Tue, Sep 26, 2000 at 04:09:33PM -0500, Tim Walberg wrote:
> On 09/26/2000 13:58 -0700, Micah Anderson wrote:
> 
> ... stuff deleted ...
> 
> >>    if [ ! -e /proc/mdstat ] || \
> >>                   [ ! grep `grep swap /etc/fstab | awk -F/ '(print $3}'` \
> >>                     /proc/mdstat | grep resync ] ; then
> >>              swapon -a 2> /dev/null
> >>    fi        
> >>    
> 
> 
> Does this catch the case where a swap device will be
> resynced, but isn't syncing now because it has been
> serialized? I.e.:
>       / = /dev/md0
>       swap = /dev/md1
>       md0 and md1 both have underlying partitions
>               on hda and hdc
>       md0 is now resyncing
>       md1 needs to be resynced, but must wait
>               for md0 to finish first to avoid
>               severe performance degradation
> 
> 
> 
> 
> -- 
> +--------------------------+------------------------------+
> | Tim Walberg              | [EMAIL PROTECTED]       |
> | 828 Marshall Ct.         | www.concentric.net/~twalberg |
> | Palatine, IL 60074       |                              |
> +--------------------------+------------------------------+


PGP signature

Reply via email to