Hello,
I am not sure this crash code is a good idea. I can see two use of drbd and
none of them
needs such code.
1- DRBD and heartbeat
This is up to heartbeat to decide to start or stop drbd so crash recovery
must not be
handled by the drdb script
2- DRBD alone
Have a look to the new cvs code. Here I can see 3 crash case :
a - Slave crash.
The autonegotiate will bring the slave in slave mode and the sync will
continue
b - The master crash
The autonegotiate will bring the master in master mode.
The non transmitted data are lost but nothing can help .. use B/C mode + fs
sync mode !!
c - Both crashes
This is the only problem. If the both server are performing their side test
when they
are both slave they can try to both become master and succed !!
It is the only thing I am planning to change it before the next release. But
I didn't
figured yet the best way to do it as, as far as I know once the two nodes
went master
bringing one slave will NOT solve the problem. The connection is somehow
broken and
you have to unload and reload the module to solve the problem and I am not
even sure
this is enough to fix it !!
But even will the same hardware and software installed their is always a
boot time difference.
So I never saw that, however this is still possible.
I can not see any solution to properly solve this problem at a script level.
Only a "master mode locking" performed by drdb before a real setting of the
node would prevent this.
Suggestion are welcome ..
Thomas
--
Thomas Mangin (mailto:thomas.mangin@example.com)
System Administrator (mailto:systems@example.com)
Legend Internet Ltd. (
http://www.legend.co.uk:/)
--
The urgent is done, the impossible is on the way, for miracles expect a
small delay
----- Original Message -----
From: Luis Claudio R.Goncalves <lclaudio@example.com>
To: David Gould <dg@example.com>
Cc: Philipp Reisner <philipp@example.com>; DRBD-List
<drbd-devel@example.com>
Sent: Wednesday, November 08, 2000 2:10 PM
Subject: Re: [DRBD-dev] Re: Is it possible for mounting /dev/nb0 as root?
> On Tue, Nov 07, 2000 at 06:31:58PM -0800, David Gould wrote:
> | I have been thinking about some architectural changes to drbd to allow
> | this sort of thing, and to do a better job of helping users avoid
> | resyncing the wrong way or not knowing which is the correct volume etc.
> ...
>
> A quick hack in /etc/rc.d/init.d/drbd can give you some help:
>
> ---------------------------cut here--------------------------------
> --- drbd Fri Oct 20 17:09:22 2000
> +++ drbd2 Wed Nov 8 12:05:30 2000
> @@ -80,9 +80,26 @@
> RV=0 # this means there were errors in the current device
> MINOR_COUNT=`echo $DEVICES | wc --words | sed -e s/\ file://g`
>
> +CRASH=$HA_DIR/test_crash
> +CRASH_FILE=/var/run/drbd-node_$HOST
> +
> +
> # See how we were called.
> case "$1" in
> start)
> + # Experimental stuff for testing crash...
> + if [ -e $CRASH ] # Are we looking for crashes?
> + then
> + echo "--> Test crash stuff active..."
> + if [ -e $CRASH_FILE ]
> + then
> + echo "Hey you! It seems like we've suffered a
crash..."
> + echo "Do the right thing and then remove
$CRASH_FILE"
> + exit 99
> + fi
> + touch $CRASH_FILE
> + fi
> +
> # use -s in modprobe/rmmod to keep errors in the logs
> action "Loading DRBD module" /sbin/modprobe -s drbd \
> minor_count=$MINOR_COUNT
> @@ -137,6 +154,7 @@
> stop)
> action "Unloading DRBD module" /sbin/rmmod -s drbd
> RETVAL=$?
> + [ -e $CRASH ] && rm $CRASH_FILE
> ;;
> restart)
> $0 stop
> ---------------------------cut here--------------------------------
>
> Maybe it isn't the best place to put this code but... as a proof, it
> works well. The idea is simple: Iif we're starting and there's a file
called
> /var/run/drbd-node_xxxx, where xxxx is the result of `hostname -s`, don't
> start drbd 'cause we've crashed... call the admin and let him receive all
> the guilt. :)
>
> Luis
>
> --
> [ Luis Claudio R. Goncalves lclaudio@example.com ]
> [. MSc coming soon -- Conectiva HA Team -- Gospel User -- Linuxer -- :) ]
> [. Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ]
> [. LateNite Programmer -- Jesus Is The Solid Rock On Which I Stand -- ]
> _______________________________________________
> DRBD-devel mailing list
> DRBD-devel@example.com
> http://lists.sourceforge.net/mailman/listinfo/drbd-devel
>