config: add CTDB_MAX_PERSISTENT_CHECK_ERRORS option
authorStefan Metzmacher <metze@samba.org>
Mon, 7 Dec 2009 09:53:31 +0000 (10:53 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 16 Dec 2009 07:08:33 +0000 (08:08 +0100)
metze

config/ctdb.init
config/ctdb.sysconfig

index d0de1867217f3d40c2712a082fc628d84dc1c1da..ff8b387377766fd269014dd919642674ce7b55cc 100755 (executable)
@@ -103,6 +103,7 @@ build_ctdb_options () {
     maybe_set "--lvs --single-public-ip" "$CTDB_LVS_PUBLIC_IP"
     maybe_set "--script-log-level"       "$CTDB_SCRIPT_LOG_LEVEL"
     maybe_set "--syslog"                 "$CTDB_SYSLOG"               "yes"
+    maybe_set "--max-persistent-check-errors" "$CTDB_MAX_PERSISTENT_CHECK_ERRORS"
 }
 
 check_tdb () {
@@ -132,6 +133,14 @@ check_tdb () {
 check_persistent_databases () {
     PERSISTENT_DB_DIR="${CTDB_DBDIR:-/var/ctdb}/persistent"
     mkdir -p $PERSISTENT_DB_DIR 2>/dev/null
+    local ERRCOUNT=$CTDB_MAX_PERSISTENT_CHECK_ERRORS
+
+    test -z "$ERRCOUNT" && {
+       ERRCOUNT="0"
+    }
+    test x"$ERRCOUNT" != x"0" && {
+       return 0;
+    }
     for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do
        check_tdb $PDBASE || {
            echo "Persistent database $PDBASE is corrupted! CTDB will not start."
index e6c7b4f2cccf869b8ed683231f4704ff2327ba98..bc3100150e4a0b7c40374bfaf743bc6dc405942c 100644 (file)
@@ -200,6 +200,14 @@ CTDB_DEBUGLEVEL=ERR
 # The default is "no".
 # CTDB_RUN_TIMEOUT_MONITOR=no
 
+# Should ctdbd start with corrupted/unhealthy persistent databases?
+# This parameter specifies the max error count for persistent health
+# checks before the "startup" event. The value must be a positive
+# interger value, "0" or "-1".
+# The default is "0", which means ctdbd will not start.
+# "-1" means wait forever.
+# CTDB_MAX_PERSISTENT_CHECK_ERRORS=0
+
 # set any default tuning options for ctdb
 # use CTDB_SET_XXXX=value where XXXX is the name of the tuning
 # variable