ctdb-daemon: Change default volatile database directory
authorMartin Schwenke <martin@meltin.net>
Thu, 26 Apr 2018 01:58:13 +0000 (11:58 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 1 May 2018 11:31:21 +0000 (13:31 +0200)
Volatile databases now have their own subdirectory.  This makes things
easier if we later recommend mounting a tmpfs on the volatile database
directory, rather than supporting the current CTDB_DBDIR=tmpfs magic.

No need to create database directories for local daemon tests.  ctdbd
will do that.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/debug_locks.sh
ctdb/doc/ctdbd.1.xml
ctdb/doc/ctdbd.conf.5.xml
ctdb/server/ctdbd.c
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/simple/scripts/local_daemons.bash

index 3feb121e2bacd0e0da42eff1cccd8607604d579c..e51640bbee5e247d339febb1a00e794d7e8a44c7 100755 (executable)
@@ -14,7 +14,7 @@
 
 # Default fallback location for database directories.
 # These can be overwritten from CTDB configuration
-CTDB_DBDIR="${CTDB_VARDIR}"
+CTDB_DBDIR="${CTDB_VARDIR}/volatile"
 CTDB_DBDIR_PERSISTENT="${CTDB_VARDIR}/persistent"
 
 loadconfig
index 47c4007a5fbeab992c7c129fe2f4a1b96e6af9b6..abab2a4121f77461a102ac3ff35d95a020241589 100644 (file)
@@ -72,7 +72,7 @@
            should not be stored on the shared cluster filesystem.
          </para>
          <para>
-           Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
+           Defaults to <filename>/usr/local/var/lib/ctdb/volatile</filename>.
          </para>
        </listitem>
       </varlistentry>
index d0b25c1eab2e5fafc6817bbfbc96d4a71a76d695..3452f84047e4896b4c5c6d5d248bc583d095d1ab 100644 (file)
        <term>CTDB_DBDIR=<parameter>DIRECTORY</parameter></term>
        <listitem>
          <para>
-           Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
+           Defaults to <filename>/usr/local/var/lib/ctdb/volatile</filename>.
          </para>
          <para>
            Apart from a DIRECTORY, this can take a special value of
index b9c502c22b49f56a91bd355342bebdd1211d9f08..b93686acd8e516fa8e1ed1e2bcf7db53db49dd46 100644 (file)
@@ -60,7 +60,7 @@ static struct {
        .debuglevel = "NOTICE",
        .transport = "tcp",
        .logging = "file:" LOGDIR "/log.ctdb",
-       .db_dir = CTDB_VARDIR,
+       .db_dir = CTDB_VARDIR "/volatile",
        .db_dir_persistent = CTDB_VARDIR "/persistent",
        .db_dir_state = CTDB_VARDIR "/state",
        .script_log_level = DEBUG_ERR,
index a90adeca4790e2ce669147dbde4296208ae62678..49c84baa95e14f4891a73c90b5961f88a1c48807 100644 (file)
@@ -86,7 +86,7 @@ setup_script_options ()
 setup_dbdir ()
 {
        export CTDB_DBDIR_BASE="${EVENTSCRIPTS_TESTS_VAR_DIR}/db"
-       export CTDB_DBDIR="$CTDB_DBDIR_BASE"
+       export CTDB_DBDIR="${CTDB_DBDIR_BASE}/volatile"
        export CTDB_DBDIR_PERSISTENT="${CTDB_DBDIR_BASE}/persistent"
        export CTDB_DBDIR_STATE="${CTDB_DBDIR_BASE}/state"
        mkdir -p "$CTDB_DBDIR"
index a17fef2b9988677ddf00a9f21a5dff7d950b4969..e68ca226454e154c6f398259197f4d06a00a696e 100644 (file)
@@ -131,7 +131,6 @@ setup_ctdb ()
                local node_ip=$(sed -n -e "$(($pnn + 1))p" "$nodes_file")
 
                local db_dir="${CTDB_BASE}/db"
-               mkdir -p "${db_dir}/persistent"
 
                if $no_event_scripts ; then
                        rm -vf "${CTDB_BASE}/events.d/"*
@@ -142,7 +141,7 @@ CTDB_RECOVERY_LOCK="${SIMPLE_TESTS_VAR_DIR}/rec.lock"
 CTDB_NODE_ADDRESS="${node_ip}"
 CTDB_LOGGING="file:${CTDB_BASE}/log.ctdb"
 CTDB_DEBUGLEVEL=INFO
-CTDB_DBDIR="${db_dir}"
+CTDB_DBDIR="${db_dir}/volatile"
 CTDB_DBDIR_PERSISTENT="${db_dir}/persistent"
 CTDB_DBDIR_STATE="${db_dir}/state"
 EOF