mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-scripts: Support CTDB_STATD_CALLOUT_SHARED_STORAGE=none
Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
112c6b43bc
commit
16df4de954
@ -1096,6 +1096,27 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
none
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
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.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
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
|
||||||
|
<filename>statd_callout</filename>, without
|
||||||
|
including any storage costs.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -36,11 +36,15 @@
|
|||||||
*
|
*
|
||||||
* persistent_db
|
* persistent_db
|
||||||
* shared_dir
|
* 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
|
* path: directory where files should be created
|
||||||
* ips_file: file containing node's currently assigned public IP addresses
|
* 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"
|
#define CONFIG_FILE CTDB_VARDIR "/scripts/statd_callout.conf"
|
||||||
|
|
||||||
@ -50,6 +54,7 @@ struct {
|
|||||||
enum {
|
enum {
|
||||||
CTDB_SC_MODE_PERSISTENT_DB,
|
CTDB_SC_MODE_PERSISTENT_DB,
|
||||||
CTDB_SC_MODE_SHARED_DIR,
|
CTDB_SC_MODE_SHARED_DIR,
|
||||||
|
CTDB_SC_MODE_NONE,
|
||||||
} mode;
|
} mode;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
@ -94,6 +99,9 @@ static void free_config(void)
|
|||||||
config.path = NULL;
|
config.path = NULL;
|
||||||
free(config.ips_file);
|
free(config.ips_file);
|
||||||
config.ips_file = NULL;
|
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;
|
config.mode = CTDB_SC_MODE_PERSISTENT_DB;
|
||||||
} else if (strcmp(mode, "shared_dir") == 0) {
|
} else if (strcmp(mode, "shared_dir") == 0) {
|
||||||
config.mode = CTDB_SC_MODE_SHARED_DIR;
|
config.mode = CTDB_SC_MODE_SHARED_DIR;
|
||||||
|
} else if (strcmp(mode, "none") == 0) {
|
||||||
|
config.mode = CTDB_SC_MODE_NONE;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: unknown mode=%s in %s\n",
|
"%s: unknown mode=%s in %s\n",
|
||||||
@ -156,6 +166,8 @@ static void read_config(void)
|
|||||||
goto parse_error;
|
goto parse_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case CTDB_SC_MODE_NONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,6 +379,8 @@ int main(int argc, const char *argv[])
|
|||||||
case CTDB_SC_MODE_SHARED_DIR:
|
case CTDB_SC_MODE_SHARED_DIR:
|
||||||
add_client_shared_dir(mon_name);
|
add_client_shared_dir(mon_name);
|
||||||
break;
|
break;
|
||||||
|
case CTDB_SC_MODE_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (strcmp(event, "del-client") == 0) {
|
} else if (strcmp(event, "del-client") == 0) {
|
||||||
mon_name = argv[2];
|
mon_name = argv[2];
|
||||||
@ -377,6 +391,8 @@ int main(int argc, const char *argv[])
|
|||||||
case CTDB_SC_MODE_SHARED_DIR:
|
case CTDB_SC_MODE_SHARED_DIR:
|
||||||
del_client_shared_dir(mon_name);
|
del_client_shared_dir(mon_name);
|
||||||
break;
|
break;
|
||||||
|
case CTDB_SC_MODE_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
usage();
|
usage();
|
||||||
|
@ -106,11 +106,20 @@ check_shared_storage_statd_state()
|
|||||||
esac
|
esac
|
||||||
check_shared_dir_statd_state "$@"
|
check_shared_dir_statd_state "$@"
|
||||||
;;
|
;;
|
||||||
|
none)
|
||||||
|
:
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
check_statd_callout_smnotify()
|
check_statd_callout_smnotify()
|
||||||
{
|
{
|
||||||
|
case "$statd_callout_mode" in
|
||||||
|
none)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# The state here doesn't really matter because the date stub
|
# The state here doesn't really matter because the date stub
|
||||||
# generates a fixed value (as per above setup() function,
|
# generates a fixed value (as per above setup() function,
|
||||||
# which happens to set it to an even value). In reality,
|
# which happens to set it to an even value). In reality,
|
||||||
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.201.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.201.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.001.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.202.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.202.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.002.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.203.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.203.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.003.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.204.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.204.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.004.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.205.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.205.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.005.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.206.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.206.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.006.sh"
|
6
ctdb/tests/UNIT/eventscripts/statd-callout.207.sh
Executable file
6
ctdb/tests/UNIT/eventscripts/statd-callout.207.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CTDB_STATD_CALLOUT_SHARED_STORAGE="none"
|
||||||
|
|
||||||
|
_dir=$(dirname "$0")
|
||||||
|
. "${_dir}/statd-callout.007.sh"
|
@ -116,6 +116,9 @@ shared_dir)
|
|||||||
statd_callout_shared_dir="$t"
|
statd_callout_shared_dir="$t"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
none)
|
||||||
|
:
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
mode="$statd_callout_mode"
|
mode="$statd_callout_mode"
|
||||||
die "error: unknown CTDB_STATD_CALLOUT_SHARED_STORAGE mode ${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" <<EOF
|
||||||
|
none
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
update_none()
|
||||||
|
{
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
list_records_none()
|
||||||
|
{
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_records_none()
|
||||||
|
{
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup_none()
|
||||||
|
{
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
|
||||||
# Per-mode initialisation
|
# Per-mode initialisation
|
||||||
startup()
|
startup()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user