diff --git a/ctdb/doc/ctdb-script.options.5.xml b/ctdb/doc/ctdb-script.options.5.xml index acfb9d082f8..9f04bcfa268 100644 --- a/ctdb/doc/ctdb-script.options.5.xml +++ b/ctdb/doc/ctdb-script.options.5.xml @@ -1096,6 +1096,27 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 + + + none + + + + No cluster-aware handling of NFSv3 statd state is + done. NFSv3 lock reclaim will not occur and + applications that use locking over NFSv3 are + likely to lose or corrupt data. + + + This should be used with care and only in the case + where no applications are using POSIX locks in + NFSv3 mounts. It should probably be considered an + option to test the latency of + statd_callout, without + including any storage costs. + + + diff --git a/ctdb/failover/statd_callout.c b/ctdb/failover/statd_callout.c index 6123316c6a7..8064432b21f 100644 --- a/ctdb/failover/statd_callout.c +++ b/ctdb/failover/statd_callout.c @@ -36,11 +36,15 @@ * * persistent_db * shared_dir + * none * - * In these modes, the file contains 2 subsequent lines of text: + * In persistent_db and shared_dir modes, the file contains 2 + * subsequent lines of text: * * path: directory where files should be created * ips_file: file containing node's currently assigned public IP addresses + * + * In none mode, there are no subsequent lines. */ #define CONFIG_FILE CTDB_VARDIR "/scripts/statd_callout.conf" @@ -50,6 +54,7 @@ struct { enum { CTDB_SC_MODE_PERSISTENT_DB, CTDB_SC_MODE_SHARED_DIR, + CTDB_SC_MODE_NONE, } mode; union { struct { @@ -94,6 +99,9 @@ static void free_config(void) config.path = NULL; free(config.ips_file); config.ips_file = NULL; + break; + case CTDB_SC_MODE_NONE: + break; } } @@ -132,6 +140,8 @@ static void read_config(void) config.mode = CTDB_SC_MODE_PERSISTENT_DB; } else if (strcmp(mode, "shared_dir") == 0) { config.mode = CTDB_SC_MODE_SHARED_DIR; + } else if (strcmp(mode, "none") == 0) { + config.mode = CTDB_SC_MODE_NONE; } else { fprintf(stderr, "%s: unknown mode=%s in %s\n", @@ -156,6 +166,8 @@ static void read_config(void) goto parse_error; } + break; + case CTDB_SC_MODE_NONE: break; } @@ -367,6 +379,8 @@ int main(int argc, const char *argv[]) case CTDB_SC_MODE_SHARED_DIR: add_client_shared_dir(mon_name); break; + case CTDB_SC_MODE_NONE: + break; } } else if (strcmp(event, "del-client") == 0) { mon_name = argv[2]; @@ -377,6 +391,8 @@ int main(int argc, const char *argv[]) case CTDB_SC_MODE_SHARED_DIR: del_client_shared_dir(mon_name); break; + case CTDB_SC_MODE_NONE: + break; } } else { usage(); diff --git a/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh b/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh index 53b8dbc485b..fea83fde2f8 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh @@ -106,11 +106,20 @@ check_shared_storage_statd_state() esac check_shared_dir_statd_state "$@" ;; + none) + : + ;; esac } check_statd_callout_smnotify() { + case "$statd_callout_mode" in + none) + return + ;; + esac + # The state here doesn't really matter because the date stub # generates a fixed value (as per above setup() function, # which happens to set it to an even value). In reality, diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.201.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.201.sh new file mode 100755 index 00000000000..95a95e0d94e --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.201.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.001.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.202.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.202.sh new file mode 100755 index 00000000000..e448974ceba --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.202.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.002.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.203.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.203.sh new file mode 100755 index 00000000000..9938a80a066 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.203.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.003.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.204.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.204.sh new file mode 100755 index 00000000000..d2b8009732c --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.204.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.004.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.205.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.205.sh new file mode 100755 index 00000000000..31867e36cd6 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.205.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.005.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.206.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.206.sh new file mode 100755 index 00000000000..5bd031d9e83 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.206.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.006.sh" diff --git a/ctdb/tests/UNIT/eventscripts/statd-callout.207.sh b/ctdb/tests/UNIT/eventscripts/statd-callout.207.sh new file mode 100755 index 00000000000..3995e23bc0e --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/statd-callout.207.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +CTDB_STATD_CALLOUT_SHARED_STORAGE="none" + +_dir=$(dirname "$0") +. "${_dir}/statd-callout.007.sh" diff --git a/ctdb/tools/statd_callout_helper b/ctdb/tools/statd_callout_helper index 0ef88f06c96..11018029412 100755 --- a/ctdb/tools/statd_callout_helper +++ b/ctdb/tools/statd_callout_helper @@ -116,6 +116,9 @@ shared_dir) statd_callout_shared_dir="$t" fi ;; +none) + : + ;; *) mode="$statd_callout_mode" die "error: unknown CTDB_STATD_CALLOUT_SHARED_STORAGE mode ${mode}" @@ -335,6 +338,39 @@ cleanup_shared_dir() ############################################################ +# No-op implementation + +startup_none() +{ + _config_file="$1" + + cat >"$_config_file" <