[DRBD-cvs] svn commit by phil - r3075 - in branches/drbd-8.2: .
debian documentation drbd drbd/linux scripts user - svnp run.
lars on 2007-09-19 18:50:30 +0200 (Wed, 19 Se
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Fri Sep 28 11:13:20 CEST 2007
Author: phil
Date: 2007-09-28 11:13:15 +0200 (Fri, 28 Sep 2007)
New Revision: 3075
Added:
branches/drbd-8.2/scripts/block-drbd
branches/drbd-8.2/scripts/pretty-proc-drbd.sh
Modified:
branches/drbd-8.2/
branches/drbd-8.2/ChangeLog
branches/drbd-8.2/debian/changelog
branches/drbd-8.2/documentation/drbd.conf.sgml
branches/drbd-8.2/documentation/drbd.sgml
branches/drbd-8.2/documentation/drbdadm.sgml
branches/drbd-8.2/documentation/drbddisk.sgml
branches/drbd-8.2/documentation/drbdmeta.sgml
branches/drbd-8.2/documentation/drbdsetup.sgml
branches/drbd-8.2/drbd.spec.in
branches/drbd-8.2/drbd/drbd_main.c
branches/drbd-8.2/drbd/drbd_receiver.c
branches/drbd-8.2/drbd/drbd_strings.c
branches/drbd-8.2/drbd/linux/drbd.h
branches/drbd-8.2/scripts/Makefile
branches/drbd-8.2/scripts/drbd
branches/drbd-8.2/scripts/drbd.conf
branches/drbd-8.2/user/drbdadm_main.c
branches/drbd-8.2/user/drbdadm_scanner.fl
Log:
svnp run.
lars on 2007-09-19 18:50:30 +0200 (Wed, 19 Sep 2007)
Changed paths:
M /branches/drbd-8.1
M /branches/drbd-8.1/ChangeLog
M /branches/drbd-8.1/debian/changelog
M /branches/drbd-8.1/documentation/drbd.conf.sgml
M /branches/drbd-8.1/documentation/drbd.sgml
M /branches/drbd-8.1/documentation/drbdadm.sgml
M /branches/drbd-8.1/documentation/drbddisk.sgml
M /branches/drbd-8.1/documentation/drbdmeta.sgml
M /branches/drbd-8.1/documentation/drbdsetup.sgml
M /branches/drbd-8.1/drbd/drbd_main.c
M /branches/drbd-8.1/drbd/drbd_receiver.c
M /branches/drbd-8.1/drbd/drbd_strings.c
M /branches/drbd-8.1/drbd/linux/drbd.h
M /branches/drbd-8.1/drbd.spec.in
M /branches/drbd-8.1/scripts/Makefile
A /branches/drbd-8.1/scripts/block-drbd (from /branches/drbd-8.0/scripts/block-drbd:3038)
M /branches/drbd-8.1/scripts/drbd
M /branches/drbd-8.1/scripts/drbd.conf
A /branches/drbd-8.1/scripts/pretty-proc-drbd.sh (from /branches/drbd-8.0/scripts/pretty-proc-drbd.sh:3046)
M /branches/drbd-8.1/user/drbdadm_main.c
M /branches/drbd-8.1/user/drbdadm_scanner.fl
svnp run. Investigated 3035 to 3063
r3037 by phil on 2007-08-30 21:45:14 +0200 (Thu, 30 Aug 2007)
Changed paths:
M /branches/drbd-8.0/documentation/drbd.conf.sgml
M /branches/drbd-8.0/documentation/drbd.sgml
M /branches/drbd-8.0/documentation/drbdadm.sgml
M /branches/drbd-8.0/documentation/drbddisk.sgml
M /branches/drbd-8.0/documentation/drbdmeta.sgml
M /branches/drbd-8.0/documentation/drbdsetup.sgml
M /branches/drbd-8.0/scripts/drbd
M /branches/drbd-8.0/scripts/drbd.conf
M /branches/drbd-8.0/user/drbdadm_main.c
M /branches/drbd-8.0/user/drbdadm_scanner.fl
Implemented the "become-primary-on" option for the startup section.
r3038 by phil on 2007-08-30 22:17:24 +0200 (Thu, 30 Aug 2007)
Changed paths:
M /branches/drbd-8.0/drbd.spec.in
M /branches/drbd-8.0/scripts/Makefile
A /branches/drbd-8.0/scripts/block-drbd
Florian's nice Xen-DRBD script.
r3039 by florian on 2007-08-31 09:41:41 +0200 (Fri, 31 Aug 2007)
Changed paths:
M /branches/drbd-8.0/scripts/block-drbd
Added extensive comments. Sanitized device sharing check for DRBD.
r3040 by florian on 2007-08-31 09:51:08 +0200 (Fri, 31 Aug 2007)
Changed paths:
M /branches/drbd-8.0/scripts/block-drbd
M-x untabify
r3041 by phil on 2007-08-31 13:10:40 +0200 (Fri, 31 Aug 2007)
Changed paths:
M /branches/drbd-8.0/ChangeLog
M /branches/drbd-8.0/debian/changelog
M /branches/drbd-8.0/drbd/linux/drbd_config.h
M /branches/drbd-8.0/drbd.spec.in
Preparing 8.0.6 for release on Monday
r3042 by florian on 2007-08-31 14:33:54 +0200 (Fri, 31 Aug 2007)
Changed paths:
M /branches/drbd-8.0/scripts/block-drbd
Updated comments.
r3043 by phil on 2007-08-31 23:24:39 +0200 (Fri, 31 Aug 2007)
Changed paths:
M /branches/drbd-8.0/drbd/drbd_main.c
M /branches/drbd-8.0/drbd/drbd_receiver.c
M /branches/drbd-8.0/drbd/drbd_strings.c
M /branches/drbd-8.0/drbd/linux/drbd.h
When you let DRBD connect to an listening TCP port and close
that, then allowing it to connect a second time you trigger
an workaround from the DRBD-0.7 days. It is printed to the
syslog as "My msock connect got accepted onto peer's sock!".
The the receiver sleeps for connect_int/2.
When you droped the network config during this time with
"drbdadm disconnect", you hit an OOPS.
The root of this bug was the the
if(drbd_request_state(mdev,NS(conn,WFConnection)) < SS_Success ) ...
statement in drbd_connect() elevated the connection state from
StandAlone to WFConnection. Later we dereference mdev->net_conf
and OOPS...
I fixed this by allowing that state change only when the connection
state before was >= Unconnected (I.e. we had a network config).
r3044 by phil on 2007-09-01 08:47:22 +0200 (Sat, 01 Sep 2007)
Changed paths:
M /branches/drbd-8.0/drbd/drbd_receiver.c
Fixed possible socket leakage.
r3046 by lars on 2007-09-01 23:39:01 +0200 (Sat, 01 Sep 2007)
Changed paths:
A /branches/drbd-8.0/scripts/pretty-proc-drbd.sh
pretty print /proc/drbd
output defaults to one line per resource, prepends resource name
-c add color
-v adds all the details back in
have fun
r3047 by phil on 2007-09-03 10:28:49 +0200 (Mon, 03 Sep 2007)
Changed paths:
M /branches/drbd-8.0/ChangeLog
M /branches/drbd-8.0/drbd.spec.in
Last changes to ChangeLog.
r3048 by phil on 2007-09-03 10:33:37 +0200 (Mon, 03 Sep 2007)
Changed paths:
M /branches/drbd-8.0/debian/changelog
M /branches/drbd-8.0/drbd.spec.in
Fixing stupid typo bugs in changelogs
r3050 by phil on 2007-09-04 15:46:40 +0200 (Tue, 04 Sep 2007)
Changed paths:
M /branches/drbd-8.0/drbd/drbd_receiver.c
Removed a workaround from the 0.7 time, that hinders us now
while developing drbd-proxy.
r3054 by phil on 2007-09-06 17:25:55 +0200 (Thu, 06 Sep 2007)
Changed paths:
M /branches/drbd-8.0/drbd/drbd_compat_wrappers.h
[Do not propagate]
crypto_alloc_hash() has to use the ERR_PTR() macros for reporting
errors.
r3056 by phil on 2007-09-06 17:47:39 +0200 (Thu, 06 Sep 2007)
Changed paths:
M /branches/drbd-8.0/drbd/drbd_compat_wrappers.h
Thanks Simon!
r3063 by lars on 2007-09-19 17:48:47 +0200 (Wed, 19 Sep 2007)
Changed paths:
M /branches/drbd-8.0/user/drbdadm_main.c
would you please initialize an array before iterating over it?
Property changes on: branches/drbd-8.2
___________________________________________________________________
Name: propagate:at:3
- 3059
+ 3074
Modified: branches/drbd-8.2/ChangeLog
===================================================================
--- branches/drbd-8.2/ChangeLog 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/ChangeLog 2007-09-28 09:13:15 UTC (rev 3075)
@@ -20,6 +20,27 @@
Changelog for fixes propagated from 8.0.x:
------------------------------------------
+8.0.6 (api:86/proto:86)
+--------
+ * Fixed DRBD to not deadlock while doing bitmap updates on Linux
+ 2.6.22 and later.
+ * Make it compile on Linux-2.6.22 and later.
+ * Removed a hardcoded path to docbook DTDs from our sgml files,
+ maybe improving the situation with building the documentation.
+ * When a drbd connect attempt gets accepted onto a other program,
+ that simply closes the socket, drbd stays for some seconds in the
+ "BrokenPipe" network state. When one removed the network
+ config during that time, drbd OOPSed. This is fixed now.
+ * drbdmeta can now also initialize meta data on meta devices
+ smaller than 128MB.
+ * Added an explicit NULL argument to our ioctl() calls in drbdmeta.
+ * Added scripts/block-drbd, which is a nice way hand over DRBD
+ role assignment to Xen, allowing one to do Xen live migrations
+ in a sane way.
+ * Added scripts/pretty-proc-drbd.sh
+ * Added an option to drbd.conf which instructs the init script
+ to promote DRBD devices to primary role upon machine start up.
+
8.0.5 (api:86/proto:86)
--------
* Changed the default behaviour of the init script. Now the init
Modified: branches/drbd-8.2/debian/changelog
===================================================================
--- branches/drbd-8.2/debian/changelog 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/debian/changelog 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,3 +1,9 @@
+drbd8 (8.0.6-0) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Philipp Reisner <phil at linbit.com> Mon, 3 Sep 2007 10:00:00 +0200
+
drbd8 (8.0.5-0) unstable; urgency=low
* New upstream release.
Modified: branches/drbd-8.2/documentation/drbd.conf.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbd.conf.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbd.conf.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>06 April 2006</date></docinfo>
@@ -217,8 +217,8 @@
<manvolnum>8</manvolnum></citerefentry> for a detailed description
of this section's parameters.
Optional parameters:
- <option>wfc-timeout</option>, <option>degr-wfc-timeout</option> and
- <option>wait-after-sb</option>.
+ <option>wfc-timeout</option>, <option>degr-wfc-timeout</option>,
+ <option>wait-after-sb</option> and <option>become-primary-on</option>.
</para>
</listitem>
</varlistentry>
@@ -846,6 +846,18 @@
</varlistentry>
<varlistentry>
+ <term><option>become-primary-on <replaceable>node-name</replaceable></option></term>
+ <listitem><para>
+ Sets on which node the device should be promoted to primary role by
+ the init script. The <replaceable>node-name</replaceable> might either
+ be a host name or the key word <option>both</option>. When this option is
+ not set the devices stay in secondary role on both nodes. Usually
+ one deligates the role assignment to a cluster manager (e.g. heartbeat).
+ </para>
+ </listitem>
+</varlistentry>
+
+<varlistentry>
<term><option>rate <replaceable>rate</replaceable></option></term>
<listitem><para>
<indexterm><primary>drbd.conf</primary><secondary>rate </secondary></indexterm>
Modified: branches/drbd-8.2/documentation/drbd.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbd.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbd.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>01 Oct 2001</date></docinfo>
Modified: branches/drbd-8.2/documentation/drbdadm.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbdadm.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbdadm.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>09 Feb 2004</date></docinfo>
Modified: branches/drbd-8.2/documentation/drbddisk.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbddisk.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbddisk.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>30 Aug 2005</date></docinfo>
Modified: branches/drbd-8.2/documentation/drbdmeta.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbdmeta.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbdmeta.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>31 March 2006</date></docinfo>
Modified: branches/drbd-8.2/documentation/drbdsetup.sgml
===================================================================
--- branches/drbd-8.2/documentation/drbdsetup.sgml 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/documentation/drbdsetup.sgml 2007-09-28 09:13:15 UTC (rev 3075)
@@ -1,4 +1,4 @@
-<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "/usr/share/xml/docbook/schema/dtd/3/docbookx.dtd" []>
+<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<refentry>
<docinfo><date>30 March 2006</date></docinfo>
Modified: branches/drbd-8.2/drbd/drbd_main.c
===================================================================
--- branches/drbd-8.2/drbd/drbd_main.c 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/drbd/drbd_main.c 2007-09-28 09:13:15 UTC (rev 3075)
@@ -610,6 +610,9 @@
if (ns.disk > Attaching && os.disk == Diskless)
rv = SS_IsDiskLess;
+ if ( ns.conn == WFConnection && os.conn < Unconnected )
+ rv=SS_NoNetConfig;
+
return rv;
}
Modified: branches/drbd-8.2/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-8.2/drbd/drbd_receiver.c 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/drbd/drbd_receiver.c 2007-09-28 09:13:15 UTC (rev 3075)
@@ -547,14 +547,15 @@
struct socket *sock;
struct sockaddr_in src_in;
+ if (!inc_net(mdev)) return NULL;
+
err = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
if (err) {
+ dec_net(mdev);
ERR("sock_creat(..)=%d\n", err);
return NULL;
}
- if (!inc_net(mdev)) return NULL;
-
sock->sk->sk_rcvtimeo =
sock->sk->sk_sndtimeo = mdev->net_conf->try_connect_int*HZ;
@@ -597,14 +598,15 @@
int err;
struct socket *sock, *sock2;
+ if (!inc_net(mdev)) return NULL;
+
err = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock2);
if (err) {
+ dec_net(mdev);
ERR("sock_creat(..)=%d\n", err);
return NULL;
}
- if (!inc_net(mdev)) return NULL;
-
sock2->sk->sk_reuse = 1; /* SO_REUSEADDR */
sock2->sk->sk_rcvtimeo =
sock2->sk->sk_sndtimeo = mdev->net_conf->try_connect_int*HZ;
@@ -657,17 +659,18 @@
* 0 oops, did not work out, please try again
* -1 peer talks different language,
* no point in trying again, please go standalone.
+ * -2 We do not have a network config...
*/
int drbd_connect(struct drbd_conf *mdev)
{
struct socket *s, *sock, *msock;
int try, h;
- D_ASSERT(mdev->state.conn >= Unconnected);
D_ASSERT(!mdev->data.socket);
- if (drbd_request_state(mdev, NS(conn, WFConnection)) < SS_Success)
- return 0;
+ if (_drbd_request_state(mdev, NS(conn, WFConnection),0) < SS_Success)
+ return -2;
+
clear_bit(DISCARD_CONCURRENT, &mdev->flags);
sock = NULL;
@@ -2668,6 +2671,7 @@
int rv = SS_UnknownError;
D_ASSERT(mdev->state.conn < Connected);
+ if (mdev->state.conn == StandAlone) return;
/* FIXME verify that:
* the state change magic prevents us from becoming >= Connected again
* while we are still cleaning up.
@@ -2845,11 +2849,11 @@
rv = drbd_send_handshake(mdev);
if (!rv)
- goto break_c_loop;
+ return 0;
rv = drbd_recv_header(mdev, &p->head);
if (!rv)
- goto break_c_loop;
+ return 0;
if (p->head.command != HandShake) {
ERR( "expected HandShake packet, received: %s (0x%04x)\n",
@@ -2893,23 +2897,6 @@
PRO_VERSION_MIN,PRO_VERSION_MAX,
p->protocol_min, p->protocol_max);
return -1;
-
- break_c_loop:
- WARN( "My msock connect got accepted onto peer's sock!\n");
- /* In case a tcp connection set-up takes longer than
- connect-int, we might get into the situation that this
- node's msock gets connected to the peer's sock!
-
- To break out of this endless loop behaviour, we need to
- wait unti the peer's msock connect tries are over. (1 Second)
-
- Additionally we wait connect-int/2 to hit with our next
- connect try exactly in the peer's window of expectation. */
-
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ + (mdev->net_conf->try_connect_int*HZ)/2);
-
- return 0;
}
#if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE)
@@ -3080,7 +3067,7 @@
drbd_disconnect(mdev);
schedule_timeout(HZ);
}
- if (h < 0) {
+ if (h == -1) {
WARN("Discarding network configuration.\n");
drbd_force_state(mdev, NS(conn, Disconnecting));
}
@@ -3420,8 +3407,7 @@
if (0) {
err:
clear_bit(SIGNAL_ASENDER, &mdev->flags);
- if (mdev->state.conn >= Connected)
- drbd_force_state(mdev, NS(conn, NetworkFailure));
+ drbd_force_state(mdev, NS(conn, NetworkFailure));
}
D_ASSERT(mdev->state.conn < Connected);
Modified: branches/drbd-8.2/drbd/drbd_strings.c
===================================================================
--- branches/drbd-8.2/drbd/drbd_strings.c 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/drbd/drbd_strings.c 2007-09-28 09:13:15 UTC (rev 3075)
@@ -80,7 +80,8 @@
[-SS_CW_FailedByPeer] = "State changed was refused by peer node",
[-SS_IsDiskLess] =
"Device is diskless, the requesed operation requires a disk",
- [-SS_DeviceInUse] = "Device is held open by someone"
+ [-SS_DeviceInUse] = "Device is held open by someone",
+ [-SS_NoNetConfig] = "Have no net/connection configuration"
};
const char *conns_to_name(enum drbd_conns s)
@@ -101,7 +102,7 @@
const char *set_st_err_name(enum set_st_err err)
{
- return err < SS_DeviceInUse ? "TOO_SMALL" :
+ return err < SS_NoNetConfig ? "TOO_SMALL" :
err > SS_TwoPrimaries ? "TOO_LARGE"
: drbd_state_sw_errors[-err];
}
Modified: branches/drbd-8.2/drbd/linux/drbd.h
===================================================================
--- branches/drbd-8.2/drbd/linux/drbd.h 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/drbd/linux/drbd.h 2007-09-28 09:13:15 UTC (rev 3075)
@@ -220,7 +220,8 @@
SS_AlreadyStandAlone = -9,
SS_CW_FailedByPeer = -10,
SS_IsDiskLess = -11,
- SS_DeviceInUse = -12
+ SS_DeviceInUse = -12,
+ SS_NoNetConfig = -13
};
/* from drbd_strings.c */
Modified: branches/drbd-8.2/drbd.spec.in
===================================================================
--- branches/drbd-8.2/drbd.spec.in 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/drbd.spec.in 2007-09-28 09:13:15 UTC (rev 3075)
@@ -122,6 +122,7 @@
/sbin/drbdmeta
/usr/lib/drbd/outdate-peer.sh
/etc/ha.d/resource.d/drbddisk
+/etc/xen/scripts/block-drbd
%defattr(644,root,root)
%config(noreplace) /etc/drbd.conf
@@ -191,6 +192,27 @@
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true
%changelog
+* Mon Sep 3 2007 10:00:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (8.0.6-1)
+ * Fixed DRBD to not deadlock while doing bitmap updates on Linux
+ 2.6.22 and later.
+ * Make it compile on Linux-2.6.22 and later.
+ * Removed a hardcoded path to docbook DTDs from our sgml files,
+ maybe improving the situation with building the documentation.
+ * When a drbd connect attempt gets accepted onto a other program,
+ that simply closes the socket, drbd stays for some seconds in the
+ "BrokenPipe" network state. When one removed the network
+ config during that time, drbd OOPSed. This is fixed now.
+ * drbdmeta can now also initialize meta data on meta devices
+ smaller than 128MB.
+ * Added an explicit NULL argument to our ioctl() calls in drbdmeta.
+ * Added scripts/block-drbd, which is a nice way hand over DRBD
+ role assignment to Xen, allowing one to do Xen live migrations
+ in a sane way.
+ * Added scripts/pretty-proc-drbd.sh
+ * Added an option to drbd.conf which instructs the init script
+ to promote DRBD devices to primary role upon machine start up.
+
* Fri Aug 3 2007 09:34:49 +0200 Philipp Reisner <phil at linbit.com>
- drbd (8.0.5-1)
* Changed the default behaviour of the init script. Now the init
Modified: branches/drbd-8.2/scripts/Makefile
===================================================================
--- branches/drbd-8.2/scripts/Makefile 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/scripts/Makefile 2007-09-28 09:13:15 UTC (rev 3075)
@@ -62,6 +62,8 @@
install -m 755 drbddisk $(PREFIX)/etc/ha.d/resource.d
install -d $(PREFIX)/usr/lib/drbd
install -m 755 outdate-peer.sh $(PREFIX)/usr/lib/drbd
+ mkdir -p $(PREFIX)/etc/xen/scripts
+ install -m 755 block-drbd $(PREFIX)/etc/xen/scripts
ifeq ($(DIST),suselike)
ln -sf ../etc/init.d/drbd $(PREFIX)/sbin/rcdrbd
endif
@@ -77,4 +79,5 @@
uninstall:
rm $(INITD)drbd
rm $(PREFIX)/etc/ha.d/resource.d/drbddisk
+ rm $(PREFIX)/etc/xen/scripts/block-drbd
! test -L $(PREFIX)/sbin/rcdrbd || rm $(PREFIX)/sbin/rcdrbd
Copied: branches/drbd-8.2/scripts/block-drbd (from rev 3064, branches/drbd-8.1/scripts/block-drbd)
Modified: branches/drbd-8.2/scripts/drbd
===================================================================
--- branches/drbd-8.2/scripts/drbd 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/scripts/drbd 2007-09-28 09:13:15 UTC (rev 3075)
@@ -96,6 +96,8 @@
[ -d /var/lock/subsys ] && touch /var/lock/subsys/drbd # for RedHat
echo "."
$DRBDADM wait-con-int # User interruptible version of wait-connect all
+
+ $DRBDADM sh-b-pri all # Become primary if configured
;;
stop)
echo -n "Stopping all DRBD resources"
Modified: branches/drbd-8.2/scripts/drbd.conf
===================================================================
--- branches/drbd-8.2/scripts/drbd.conf 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/scripts/drbd.conf 2007-09-28 09:13:15 UTC (rev 3075)
@@ -170,6 +170,11 @@
# it to continue waiting in this case set this option.
#
# wait-after-sb;
+
+ # In case you are using DRBD for GFS/OCFS2 you want that the
+ # startup script promotes it to primary. Nodenames are also
+ # possible instead of "both".
+ # become-primary-on both;
}
disk {
@@ -362,7 +367,7 @@
# To achieve better resynchronisation performance you should resync
# DRBD resources which have their backing storage on one physical
# disk sequentially. The express this use the "after" keyword.
- after "r2";
+ #after "r2";
# Configures the size of the active set. Each extent is 4M,
# 257 Extents ~> 1GB active set size. In case your syncer
@@ -373,11 +378,19 @@
al-extents 257;
}
+ proxy {
+ memlimit 20M;
+ }
+
on amd {
device /dev/drbd0;
disk /dev/hde5;
address 192.168.22.11:7788;
flexible-meta-disk internal;
+ proxy on mescal {
+ inside 127.0.0.1:1234;
+ outside 127.0.0.1:1235;
+ }
# meta-disk is either 'internal' or '/dev/ice/name [idx]'
#
@@ -397,82 +410,9 @@
disk /dev/hdc5;
address 192.168.22.12:7788;
meta-disk internal;
+ proxy on alf {
+ inside 127.0.0.1:2234;
+ outside 127.0.0.1:2235;
+ }
}
}
-
-#
-# yes, you may also quote the resource name.
-# but don't include whitespace, unless you mean it :)
-#
-resource "r1" {
- protocol C;
- startup {
- wfc-timeout 0; ## Infinite!
- degr-wfc-timeout 120; ## 2 minutes.
- }
- disk {
- on-io-error detach;
- }
- net {
- # timeout 60;
- # connect-int 10;
- # ping-int 10;
- # max-buffers 2048;
- # max-epoch-size 2048;
- }
- syncer {
- }
-
- on amd {
- device /dev/drbd1;
- disk /dev/hde6;
- address 192.168.22.11:7789;
- meta-disk /dev/somewhere [7];
- }
-
- on alf {
- device /dev/drbd1;
- disk /dev/hdc6;
- address 192.168.22.12:7789;
- meta-disk /dev/somewhere [7];
- }
-}
-
-resource r2 {
- protocol C;
-
- startup { wfc-timeout 0; degr-wfc-timeout 120; }
- disk { on-io-error detach; }
- net { timeout 60; connect-int 10; ping-int 10;
- max-buffers 2048; max-epoch-size 2048; }
- syncer { rate 4M; } # sync when r0 and r1 are finished syncing.
- on amd {
- address 192.168.22.11:7790;
- disk /dev/hde7; device /dev/drbd2; meta-disk "internal";
- }
- on alf {
- device "/dev/drbd2"; disk "/dev/hdc7"; meta-disk "internal";
- address 192.168.22.12:7790;
- }
-}
-
-resource r3 {
- protocol C;
-
- startup { wfc-timeout 0; degr-wfc-timeout 120; }
- disk { on-io-error detach; }
- syncer {
- }
- on amd {
- device /dev/drbd3;
- disk /dev/hde8;
- address 192.168.22.11:7791;
- meta-disk internal;
- }
- on alf {
- device /dev/drbd3;
- disk /dev/hdc8;
- address 192.168.22.12:7791;
- meta-disk /some/where[8];
- }
-}
Copied: branches/drbd-8.2/scripts/pretty-proc-drbd.sh (from rev 3064, branches/drbd-8.1/scripts/pretty-proc-drbd.sh)
Modified: branches/drbd-8.2/user/drbdadm_main.c
===================================================================
--- branches/drbd-8.2/user/drbdadm_main.c 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/user/drbdadm_main.c 2007-09-28 09:13:15 UTC (rev 3075)
@@ -106,11 +106,14 @@
static int sh_ll_dev(struct d_resource* ,const char* );
static int sh_md_dev(struct d_resource* ,const char* );
static int sh_md_idx(struct d_resource* ,const char* );
+static int sh_b_pri(struct d_resource* ,const char* );
static int admm_generic(struct d_resource* ,const char* );
static int adm_khelper(struct d_resource* ,const char* );
static int adm_generic_b(struct d_resource* ,const char* );
static int hidden_cmds(struct d_resource* ,const char* );
+static char* get_opt_val(struct d_option*,const char*,char*);
+
static struct ifreq* get_ifreq();
char ss_buffer[255];
@@ -234,6 +237,7 @@
{ "sh-md-dev", sh_md_dev, 2,1,0 },
{ "sh-md-idx", sh_md_idx, 2,1,0 },
{ "sh-ip", sh_ip, 0,1,0 },
+ { "sh-b-pri", sh_b_pri, 2,1,0 },
{ "pri-on-incon-degr", adm_khelper, 3,1,0 },
{ "pri-lost-after-sb", adm_khelper, 3,1,0 },
{ "outdate-peer", adm_khelper, 3,1,0 },
@@ -563,7 +567,18 @@
return 0;
}
+static int sh_b_pri(struct d_resource *res,const char* unused __attribute((unused)))
+{
+ char* val;
+ val = get_opt_val(res->startup_options, "become-primary-on", NULL);
+ if ( val && ( !strcmp(val,nodeinfo.nodename) ||
+ !strcmp(val,"both") ) ) {
+ return adm_generic_s(res,"primary");
+ }
+ return 0;
+}
+
static int sh_mod_parms(struct d_resource* res __attribute((unused)),const char* unused __attribute((unused)))
{
int mc=global_options.minor_count;
@@ -788,6 +803,19 @@
OPT=OPT->next; \
}
+#define make_options_wait(OPT) \
+ while(OPT) { \
+ if(!strcmp(OPT->name,"become-primary-on")) {\
+ OPT=OPT->next; continue; \
+ } \
+ if(OPT->value) { \
+ ssprintf(argv[NA(argc)],"--%s=%s",OPT->name,OPT->value); \
+ } else { \
+ ssprintf(argv[NA(argc)],"--%s",OPT->name); \
+ } \
+ OPT=OPT->next; \
+ }
+
int adm_attach(struct d_resource* res,const char* unused __attribute((unused)))
{
char* argv[MAX_ARGS];
@@ -920,8 +948,6 @@
return rv;
}
-static char* get_opt_val(struct d_option*,const char*,char*);
-
static int adm_khelper(struct d_resource* res ,const char* cmd)
{
int rv=0;
@@ -1080,7 +1106,7 @@
argv[NA(argc)]=res->me->device;
argv[NA(argc)]="wait-connect";
opt=res->startup_options;
- make_options(opt);
+ make_options_wait(opt);
argv[NA(argc)]=0;
rv = m_system(argv,SLEEPS_FOREVER);
@@ -1264,6 +1290,9 @@
sigaction(SIGCHLD,&sa,&so);
pids = alloca( nr_resources * sizeof(pid_t) );
+ /* alloca can not fail, it can "only" overflow the stack :)
+ * but it needs to be initialized anyways! */
+ memset(pids,0,nr_resources * sizeof(pid_t));
for_each_resource(res,t,config) {
argc=0;
@@ -1271,7 +1300,7 @@
argv[NA(argc)]=res->me->device;
argv[NA(argc)]="wait-connect";
opt=res->startup_options;
- make_options(opt);
+ make_options_wait(opt);
argv[NA(argc)]=0;
pids[i++]=m_system(argv,RETURN_PID);
@@ -1619,6 +1648,7 @@
void validate_resource(struct d_resource * res)
{
struct d_option* opt;
+ char *bpo;
if (!res->protocol) {
if (!common || !common->protocol) {
@@ -1676,6 +1706,16 @@
if(strstr(opt->value,"drbd-peer-outdater")) sanity_check_perm();
}
+ bpo = get_opt_val(res->startup_options, "become-primary-on", "undef");
+ opt = find_opt(res->net_options, "allow-two-primaries");
+ if(!strcmp(bpo,"both") && opt == NULL) {
+ fprintf(stderr,
+ "In resource %s:\n"
+ "become-primary-on is set to both, but allow-two-primaries "
+ "is not set.\n", res->name);
+ config_valid = 0;
+ }
+
if (( res->me->proxy == NULL ) != (res->peer->proxy == NULL)) {
fprintf(stderr,
"Incomplete proxy configuration. in resource %s.\n",
Modified: branches/drbd-8.2/user/drbdadm_scanner.fl
===================================================================
--- branches/drbd-8.2/user/drbdadm_scanner.fl 2007-09-28 09:03:46 UTC (rev 3074)
+++ branches/drbd-8.2/user/drbdadm_scanner.fl 2007-09-28 09:13:15 UTC (rev 3075)
@@ -92,6 +92,7 @@
al-extents { DP; CP; RC(AL_EXTENTS); return TK_SYNCER_OPTION;}
wfc-timeout { DP; CP; RC(WFC_TIMEOUT); return TK_STARTUP_OPTION;}
degr-wfc-timeout { DP; CP; RC(DEGR_WFC_TIMEOUT); return TK_STARTUP_OPTION;}
+become-primary-on { DP; CP; return TK_STARTUP_OPTION; }
wait-after-sb { DP; CP; return TK_STARTUP_SWITCH; }
pri-on-incon-degr { DP; CP; return TK_HANDLER_OPTION; }
pri-lost-after-sb { DP; CP; return TK_HANDLER_OPTION; }
More information about the drbd-cvs
mailing list