[DRBD-cvs] scripts by phil; LGE's big change to the drbdadm's scanne...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Mon, 26 Apr 2004 10:36:34 +0200 (CEST)


DRBD CVS committal

Author  : phil
Project : drbd
Module  : scripts

Dir     : drbd/scripts


Modified Files:
      Tag: rel-0_7-branch
	drbd.conf patch-kernel 


Log Message:
LGE's big change to the drbdadm's scanner and other internals
of the drbdadm. 
* Improves error reporting a lot!
ATTENTION: Changes the syntax of the configuration file! -- This is
the last time we change it before 0.7 

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/scripts/drbd.conf,v
retrieving revision 1.5.2.12
retrieving revision 1.5.2.13
diff -u -3 -r1.5.2.12 -r1.5.2.13
--- drbd.conf	16 Mar 2004 14:46:02 -0000	1.5.2.12
+++ drbd.conf	26 Apr 2004 08:36:29 -0000	1.5.2.13
@@ -2,10 +2,9 @@
 # drbd.conf example
 #
 # parameters you _need_ to change are the hostname, device, disk,
-# address and port in the "on <hostname> {}" sections.
+# meta-disk, address and port in the "on <hostname> {}" sections.
 #
-# you ought to know about the protocol, inittimeout,
-# skip-wait and load-only; and the fsckcmd.
+# you ought to know about the protocol, and the various timeouts.
 #
 # you probably want to set the rate in the syncer sections
 #
@@ -13,7 +12,7 @@
 # problems with "conection lost/connection enabled"
 # (or change your setup to reduce network latency; make sure full
 #  duplex behaves as such; check average roundtrip times while
-#  network is saturated ...)
+#  network is saturated; and so on ...)
 #
 
 #
@@ -23,13 +22,50 @@
 # no longer recommended, since the agreed disk size is now stored
 # in DRBD's non volatile meta data files.
 #
+# NOTE that if you do not have some dedicated partition to use for
+# the meta-data, you may use 'internal' meta-data.
+#
+#	THIS HOWEVER WILL DESTROY THE LAST 128M
+#	OF THE LOWER LEVEL DEVICE.
+#
+# So you better make sure you shrink the filesystem by 128M FIRST!
+# or by 132M just to be sure... :)
+#
 
+skip {
+  As you can see, you can also comment chunks of text
+  with a 'skip[optional nonsense]{ skiped text }' section.
+  This comes in handy, if you just want to comment out
+  some 'resource <some name> {...}' section:
+  just precede it with 'skip'.
+
+  The basic format of option assignment is
+  <option name><linear whitespace><value>;
+  
+  It should be obvious from the examples below,
+  but if you really care to know the details:
+  
+  <option name> :=
+        valid options in the respective scope
+  <value>  := <num>|<string>|<choice>|...
+              depending on the set of allowed values
+              for the respective option.
+  <num>    := [0-9]+, sometimes with an optional suffix of K,M,G
+  <string> := (<name>|\"([^\"\\\n]*|\\.)*\")+
+  <name>   := [/_.A-Za-z0-9-]+
+}
+
+#
+# At most ONE global section is allowed.
+# It must precede any resource section.
+#
 # global {
     # use this if you want to define more resources later
     # without reloading the module.
     # by default we load the module with exactly as many devices
     # as configured mentioned in this file.
-    # minor_count=5
+    #
+    # minor_count 5;
 
     # this is for people who set up a drbd device via the
     # loopback network interface or between two VMs on the same
@@ -38,6 +74,10 @@
     # I'm not sure whether this deadlock can happen with two
     # nodes, but it seems at least extremly unlikely; and since
     # the io_hints boost performance, keep them enabled.
+    #
+    # With linux 2.6 it no longer makes sense.
+    # So this option should vanish.	--lge
+    #
     # disable_io_hints
 # }
 
@@ -58,24 +98,34 @@
   # A: write IO is reported as completed, if it has reached
   #    local DISK and local tcp send buffer. (see also sndbuf-size)
   #    * for high latency networks
-  protocol = B
+  #
+  #**********
+  # uhm, benchmarks have shown that C is actually better than B.
+  # this note shall disappear, when we are convinced that B is
+  # the right choice "for most cases".
+  # Until then, always use C unless you have a reason not to.
+  #	--lge
+  #**********
+  #
+  protocol C;
 
   # what should be done in case the cluster starts up in
   # degraded mode, but knows it has inconsistent data.
-  incon-degr-cmd="halt -f"
+  incon-degr-cmd "halt -f";
 
   startup {
-
     # Wait for connection timeout. 
     # The init script blocks the boot process untill the resources
     # are connected. 
     # In case you want to limit the wait time, do it here.
-    # wfc-timeout=0
+    #
+    # wfc-timeout  0;
 
     # Wait for connection timeout if this node was a degraded cluster.
     # In case a degraded cluster (= cluster with only one node left)
     # is rebooted, this timeout value is used. 
-    degr-wfc-timeout=120    # 2 minutes.
+    #
+    degr-wfc-timeout 120;    # 2 minutes.
   }
 
   disk {
@@ -86,13 +136,17 @@
     #  "panic"    ->  The node leaves the cluster by doing a kernel panic.
     #  "detach"   ->  The node drops its backing storage device, and
     #                 continues in disk less mode.
-    on-io-error = detach
+    #
+    on-io-error   detach;
 
     # the device size in bytes, default unit is k (1 block == 1024 bytes)
     # should be the minimum of the sizes of the lower level devices of
     # the nodes.
     # Since DRBD-0.7 it is recommended to _not_ use this parameter.
-    # size=1G
+    #
+    # NOTE: I made this an error in drbdadm_scanner.fl!	--lge
+    # 
+    # size 1G;
   }
 
   net {
@@ -101,193 +155,152 @@
     # high latency network with reasonable write throughput.
     # defaults to 2*65535; you might try even 1M, but if your kernel or
     # network driver chokes on that, you have been warned.
-    # sndbuf-size = 512k
+    # sndbuf-size 512k;
 
-    # timeout = 60          # 6 seconds   (unit = 0.1 seconds)
-    # connect-int = 10      # 10 seconds  (unit = 1 second)
-    # ping-int = 10         # 10 seconds  (unit = 1 second)
-
-    # DRBD's write are 4k. The minimum is hardcoded to 32 (=128 kb). 
-    # For hight performace installations it might help if you increase 
-    # that number. These buffers are used to hold datablocks while they are 
-    # wirtten to disk.
-    # max-buffers = 2048    
+    # timeout       60;    #  6 seconds  (unit = 0.1 seconds)
+    # connect-int   10;    # 10 seconds  (unit = 1 second)
+    # ping-int      10;    # 10 seconds  (unit = 1 second)
+
+    # Maximal number of requests (4K) to be allocated by DRBD.
+    # The minimum is hardcoded to 32 (=128 kb).
+    # For hight performace installations it might help if you
+    # increase that number. These buffers are used to hold
+    # datablocks while they are written to disk.
+    #
+    # max-buffers     2048;
 
     # The highest number of data blocks between two write barriers. 
     # If you set this < 10 you might decrease your performance.
-    # max-epoch-size = 2048 
+    # max-epoch-size  2048;
   }
 
   syncer {
     # Limit the bandwith used by the resynchronisation process.
-    rate=10M
+    # default unit is KB/sec; optional suffixes K,M,G are allowed
+    #
+    rate 10M;
+
     # All devices in one group are resynchronized parallel. 
     # Resychronisation of groups is serialized in ascending order. 
     # Put DRBD resources which are on different physical disks in on goup.
     # Put DRBD resources on one physical disk in different groups.
-    group=1
+    #
+    group 1;
+
     # Configures the size of the active set. Each extent is 4M, 
     # 257 Extents ~> 1GB active set size. In case your syncer
     # runs @ 10MB/sec, all resync after a primary's crash will last
     # 1GB / ( 10MB/sec ) ~ 102 seconds ~ One Minute and 42 Seconds.
     # BTW, the hash algorithm works best if the number of al-extents
     # is prime. (To test the wost case performace use a power of 2)
-    al-extents=257
+    al-extents 257;
   }
 
   on amd {
-    device=/dev/nb0
-    disk=/dev/hde5
-    address=192.168.22.11
-    port=7788
-    meta-disk=internal
-    # meta-disk=/dev/hde6
-    # meta-index=0
-    # You can use a singe block device as store for multiple meta-data
-    # blocks. E.g. use meta-disk=/dev/hde6, meta-index=0 and 
-    # meta-disk=/dev/hde6, meta-index=1 for two resources. In this
-    # case the meta-disk would need to be at least 256 MB in size.
-    # 'internal' means, that the last 128 MB of the lower device are
-    # used to store the meta-data.
+    device     /dev/nb0;
+    disk       /dev/hde5;
+    address    192.168.22.11:7788;
+    meta-disk  internal;
+
+    # meta-disk is either 'internal' or '/dev/ice/name [idx]'
+    #
+    # You can use a singe block device to store meta-data
+    # of multiple DRBD's.
+    # E.g. use meta-disk /dev/hde6[0]; and meta-disk /dev/hde6[1];
+    # for two different resources. In this case the meta-disk
+    # would need to be at least 256 MB in size.
+    #
+    # 'internal' means, that the last 128 MB of the lower device
+    # are used to store the meta-data.
+    # You must not give an index with 'internal'.
   }
 
   on alf {
-    device=/dev/nb0
-    disk=/dev/hdc5
-    address=192.168.22.12
-    port=7788
-    meta-disk=internal
+    device    /dev/nb0;
+    disk      /dev/hdc5;
+    address   192.168.22.12:7788;
+    meta-disk internal;
   }
 }
 
+#
+# yes, you may also quote the resource name.
+# but don't include whitespace, unless you mean it :)
+#
 resource "r1" {
-  protocol=B
-  incon-degr-cmd="halt -f"
-
+  protocol C;
+  incon-degr-cmd "halt -f";
   startup {
-    wfc-timeout=0         ## Infinite!
-    degr-wfc-timeout=120  ## 2 minutes.
+    wfc-timeout         0;  ## Infinite!
+    degr-wfc-timeout  120;  ## 2 minutes.
   }
-
   disk {
-    on-io-error = detach
-    # size=1G
+    on-io-error detach;
   }
-
   net {
-    # timeout = 60
-    # connect-int = 10
-    # ping-int = 10
-    # max-buffers = 2048
-    # max-epoch-size = 2048 
+    # timeout           60;
+    # connect-int       10;
+    # ping-int          10;
+    # max-buffers     2048;
+    # max-epoch-size  2048;
   }
-
   syncer {
-    rate=4M
-    group=1 # sync concurently with r0
+    rate   4M;
+    group   1; # sync concurently with r0
   }
 
   on amd {
-    device=/dev/nb1
-    disk=/dev/hde6
-    address=192.168.22.11
-    port=7789
-    meta-disk=internal
+    device	/dev/nb1;
+    disk	/dev/hde6;
+    address	192.168.22.11:7789;
+    meta-disk	/dev/somewhere [7];
   }
 
   on alf {
-    device=/dev/nb1
-    disk=/dev/hdc6
-    address=192.168.22.12
-    port=7789
-    meta-disk=internal
+    device     /dev/nb1;
+    disk       /dev/hdc6;
+    address    192.168.22.12:7789;
+    meta-disk  /dev/somewhere [7];
   }
 }
 
 resource r2 {
-  protocol=C
-  incon-degr-cmd="halt -f"
-
-  startup {
-    wfc-timeout=0         ## Infinite!
-    degr-wfc-timeout=120  ## 2 minutes.
-  }
-
-  disk {
-    on-io-error = detach
-    # size=1G
-  }
-
-  net {
-    # timeout = 60
-    # connect-int = 10
-    # ping-int = 10
-    # max-buffers = 2048
-    # max-epoch-size = 2048 
-  }
-
-  syncer {
-    rate=4M
-    group=2        # sync when r0 and r1 are finished syncing.
-  }
-
+  protocol C;
+  incon-degr-cmd "halt -f";
+  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; group 2; } # sync when r0 and r1 are finished syncing.
   on amd {
-    device=/dev/nb2
-    disk=/dev/hde7
-    address=192.168.22.11
-    port=7790
-    meta-disk=internal
+    address 192.168.22.11:7790;
+    disk /dev/hde7; device /dev/nb2; meta-disk "internal";
   }
-
   on alf {
-    device=/dev/nb2
-    disk=/dev/hdc7
-    address=192.168.22.12
-    port=7790
-    meta-disk=internal
+    device "/dev/nb2"; disk "/dev/hdc7"; meta-disk "internal";
+    address 192.168.22.12:7790;
   }
 }
 
 resource r3 {
-  protocol=B
-  incon-degr-cmd="halt -f"
-
-  startup {
-    wfc-timeout=0         ## Infinite!
-    degr-wfc-timeout=120  ## 2 minutes.
-  }
-
-  disk {
-    on-io-error = detach
-    # size=1G
-  }
-
-  net {
-    # timeout = 60
-    # connect-int = 10
-    # ping-int = 10
-    # max-buffers = 2048
-    # max-epoch-size = 2048 
-  }
-
+  protocol	C;
+  incon-degr-cmd	"halt -f";
+  startup { wfc-timeout	0; degr-wfc-timeout	120; }
+  disk { on-io-error detach; }
   syncer {
-    rate=4M
-    group=3 # sync when r2 is finished syncing.
+    rate	4M;
+    group	3;   # sync when r2 is finished syncing.
   }
-
   on amd {
-    device=/dev/nb3
-    disk=/dev/hde8
-    address=192.168.22.11
-    port=7791
-    meta-disk=internal
+    device	/dev/nb3;
+    disk	/dev/hde8;
+    address	192.168.22.11:7791;
+    meta-disk	internal;
   }
-
   on alf {
-    device=/dev/nb3
-    disk=/dev/hdc8
-    address=192.168.22.12
-    port=7791
-    meta-disk=internal
+    device	/dev/nb3;
+    disk	/dev/hdc8;
+    address	192.168.22.12:7791;
+    meta-disk	/some/where[8];
   }
 }
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/scripts/Attic/patch-kernel,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -3 -r1.1.2.2 -r1.1.2.3
--- patch-kernel	20 Apr 2004 16:16:50 -0000	1.1.2.2
+++ patch-kernel	26 Apr 2004 08:36:29 -0000	1.1.2.3
@@ -2,7 +2,7 @@
 #
 # Create a patch against a kernel tree which adds the DRBD sources.
 #
-# $Id: patch-kernel,v 1.1.2.2 2004/04/20 16:16:50 lars Exp $
+# $Id: patch-kernel,v 1.1.2.3 2004/04/26 08:36:29 phil Exp $
 #
 # Copyright (C) 2003 Kees Cook, OSDL
 # kees@osdl.org, http://developer.osdl.org/kees/
@@ -101,8 +101,8 @@
 grep "HLIST_HEAD_INIT" $KERNEL/include/linux/list.h >/dev/null &&
 	rm $DRBD_SUB/hlist.h
 
-# remove __arch_um__ to_virt() hack 
-sed -e '/^#ifdef __arch_um__/,/^#endif/d' \
+# disable __arch_um__ to_virt() hack 
+sed -e 's/^#ifdef __arch_um__/#if 0/' \
 	< $DRBD/drbd/drbd_receiver.c > $DRBD_SUB/drbd_receiver.c
 
 # and, in case this kernel was already patched: