Add new Lustre specific ZFS dataset user property to
control/manage degraded ZFS OSTs, also modify the existing
lustre/scripts/statechange-lustre.sh zedlet accordingly.
Extend the same to mkfs.lustre utility to add this property
by default when creating a new Lustre ZFS server.
HPE-bug-id: LUS-11447
Test-Parameters: trivial fstype=zfs testlist=sanity
Signed-off-by: Akash B <akash-b@hpe.com>
Change-Id: I7032538f507c9ad20d5b109b54e3c3bab8138458
Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49660
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Siddarth Raj <siddarth.raj@hpe.com>
Reviewed-by: Nikitas Angelinas <nikitas.angelinas@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */
#define PARAM_ROOTSQUASH "root_squash=" /* root squash */
#define PARAM_NOSQUASHNIDS "nosquash_nids=" /* no squash nids */
#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */
#define PARAM_ROOTSQUASH "root_squash=" /* root squash */
#define PARAM_NOSQUASHNIDS "nosquash_nids=" /* no squash nids */
+#define PARAM_AUTODEGRADE "autodegrade=" /* autodegrade OST's */
/* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */
#define PARAM_OST "ost."
/* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */
#define PARAM_OST "ost."
+ /* For handling degraded zfs OST */
+ if (class_match_param(ptr, PARAM_AUTODEGRADE, NULL) == 0)
+ GOTO(end, rc);
+
LCONSOLE_WARN("Ignoring unrecognized param '%s'\n", ptr);
end:
LCONSOLE_WARN("Ignoring unrecognized param '%s'\n", ptr);
end:
local dataset="$1"
local state="$2"
local service=$($ZFS list -H -o lustre:svname ${dataset})
local dataset="$1"
local state="$2"
local service=$($ZFS list -H -o lustre:svname ${dataset})
-
- zed_log_msg "Lustre:sync_degrade_state pool:${dataset} degraded:${state}"
+ local autodegrade=$($ZFS get -rH -s local -t filesystem -o value \
+ lustre:autodegrade ${dataset})
if [ -n "${service}" ] && [ "${service}" != "-" ] ; then
local current=$($LCTL get_param -n obdfilter.${service}.degraded)
if [ -n "${service}" ] && [ "${service}" != "-" ] ; then
local current=$($LCTL get_param -n obdfilter.${service}.degraded)
- if [ "${current}" != "${state}" ] ; then
+ if [ "${current}" != "${state}" ] &&
+ [ "${autodegrade}" == "on" ] ; then
$LCTL set_param obdfilter.${service}.degraded=${state}
$LCTL set_param obdfilter.${service}.degraded=${state}
+ ds_state="pool:${dataset} degraded:${state}"
+ zed_log_msg "Lustre:sync_degrade_state $ds_state"
+ if (ldd->ldd_mount_type == LDD_MT_ZFS &&
+ (ldd->ldd_flags & LDD_F_SV_TYPE_OST)) {
+ rc = add_param(ldd->ldd_params, PARAM_AUTODEGRADE, "on");
+ if (rc)
+ return rc;
+ }
+
if (strlen(new_fsname) > 0) {
if (!(mop->mo_flags & (MO_FORCEFORMAT | MO_RENAME)) &&
(!(ldd->ldd_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF)))) {
if (strlen(new_fsname) > 0) {
if (!(mop->mo_flags & (MO_FORCEFORMAT | MO_RENAME)) &&
(!(ldd->ldd_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF)))) {