Disksuite - Should mirror state be ok before S98SUNWmd.sync?
Philip A. Kufeldt
pak@harbor.net
Thu, 26 Mar 1998 06:08:02 -0800
No one answered this, so I'll stick my neck out. My answer comes from engineering
experience with VERITAS Volume Manager and I can only assume that SDS deals with
mirrors in the same fashion.
Once a mirror device is opened (ie a DB open the devices, it gets mounted, etc), it
is functionally dirty and marked as so. The reason I say functionally is that it may
not be actually dirty. In fact, after I open the device even though I have not done
a single I/O it is still marked as dirty. The only time the device would be marked
clean is if the device had been completely closed. This because the designers chose
to do their accounting at device open/cose time instead of I/O start/completion.
And it only makes sense, right? The device state must be stored persistently so that
after any reboot event (init 0, panic, etc) it knows the state of the device. This
means to dirty or clean a device you must do I/O to save this state. So it does not
make sense to dirty/clean a device for each I/O.
So my guess is that during tests you probably have the device mounted which equates
to an open and consequently a dirty device. If it is not unmounted then the state
will be dirty at reboot.
As far as remirroring is concerned, even if the device is dirty (needs a resync)
you should be able to read and write to it providing that mirroring code does the
right thing. Remember, that when recovering a dirty mirrored device that there is no
correct mirror ( I could go into the proof of that but I won't for now, I just say
it is so). So picking one side to exclusesively do reads from and writing to both,
is correct. The big thing you want avoid while the mrror is out of sync is doing two
identical reads and returning different data. So picking one mirror for reads will
prevent that. Now that you can do I/O, the resync can begin at any time reading
from the selected mirror and writing to the other.
John Navitsky wrote:
> Hello,
>
> I've currently set up some Solaris 2.5.1 systems with all the disks mirrored
> with Disksuite 4.1. Each system has six disks for a total of three disks with
> three mirrors.
>
> I've done a test where I've temporarily taken the S98SUNWmd.sync out of rc2.d.
> And when all the metadisks are in a clean state (all applications out of the
> rc2.d and rc3.d directories), shut the system down with "init 0". Then, after
> booting the system, all the mirrors state that they need attention. I've run
> this test several times and the result is always the same.
>
> Running metasync or S98SUNWmd.sync works fine, but it would seem that if the
> system was shut down correctly and especially if there was basically nothing
> running that the mirrors should come up as "ok". I assumed that S98SUNWmd.sync
> was there as a "just in case" kind of thing? Shouldn't the state be "ok" unless
> something bad happened?
>
> Also, it seems odd that SUNWmd.sync is so far down in the startup sequence. I'd
> think you would want run it early on, like S02 or such. Any thoughts here?
>
> Thanks,
>
> -john