Skip to content

Commit

Permalink
CORTX-33537: disable alternative pvers by default
Browse files Browse the repository at this point in the history
In case of some failure, we want the I/O to be done in the
base pool version in the degraded mode always without switching
to the alternative pool version. Later, when we introduce the
side pool versions, we will do the degraded I/O in them and use
them for faster SNS-recovery, which will try to recover only the
objects which have the side pool versions instead of traversing
all objects in the cluster.

Closes Seagate#1958.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
  • Loading branch information
andriytk committed Jul 6, 2022
1 parent 275f821 commit 12f0856
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
14 changes: 14 additions & 0 deletions conf/pvers.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ struct arr_int_pos {
uint32_t ap_pos;
};

#ifdef ENABLE_ALT_PVERS
static int conf_pver_formulate(const struct m0_conf_pver *fpver,
struct m0_conf_pver **out);
#endif
static int conf_pver_formulaic_base(const struct m0_conf_pver *fpver,
struct m0_conf_pver **out);
static int conf_pver_objvs_count(struct m0_conf_pver *base, uint32_t *out);
Expand All @@ -73,7 +75,9 @@ static int conf_pver_virtual_create(const struct m0_fid *fid,
const uint32_t *allowance,
struct arr_int *failed,
struct m0_conf_pver **out);
#ifdef ENABLE_ALT_PVERS
static int conf_pver_failures_cid(struct m0_conf_pver *base, uint64_t *out);
#endif
static void conf_pver_subtree_delete(struct m0_conf_obj *obj);
static int conf_pver_recd_build(struct m0_conf_obj *obj, void *args);

Expand Down Expand Up @@ -145,13 +149,17 @@ static int conf_pver_find_locked(const struct m0_conf_pool *pool,
M0_LOG(M0_INFO, "Skipping "FID_F, FID_P(pver_to_skip));
continue;
}
#ifdef ENABLE_ALT_PVERS
if (!m0_conf_pver_is_clean(pver))
continue;
#endif
if (pver->pv_kind == M0_CONF_PVER_ACTUAL) {
*out = pver;
return M0_RC(0);
}
#ifdef ENABLE_ALT_PVERS
return M0_RC(conf_pver_formulate(pver, out));
#endif
} m0_tl_endfor;
return M0_ERR_INFO(-ENOENT, "No suitable pver is found at pool "FID_F,
FID_P(&pool->pl_obj.co_id));
Expand Down Expand Up @@ -278,6 +286,7 @@ static int conf_pver_formulaic_base(const struct m0_conf_pver *fpver,
return M0_RC(0);
}

#ifdef ENABLE_ALT_PVERS
M0_INTERNAL bool m0_conf_pver_is_clean(const struct m0_conf_pver *pver)
{
struct m0_conf_pver *base = NULL;
Expand All @@ -302,6 +311,7 @@ M0_INTERNAL bool m0_conf_pver_is_clean(const struct m0_conf_pver *pver)
return M0_RC(m0_forall(i, M0_CONF_PVER_HEIGHT,
recd[i] == allowance[i]));
}
#endif

enum { CONF_PVER_FID_MASK = 0x003fffffffffffffULL };

Expand Down Expand Up @@ -414,6 +424,7 @@ M0_INTERNAL unsigned m0_conf_pver_level(const struct m0_conf_obj *obj)
}
/* page break */

#ifdef ENABLE_ALT_PVERS
/** Finds or creates virtual pool version, described by a formulaic one. */
static int
conf_pver_formulate(const struct m0_conf_pver *fpver, struct m0_conf_pver **out)
Expand Down Expand Up @@ -441,6 +452,7 @@ conf_pver_formulate(const struct m0_conf_pver *fpver, struct m0_conf_pver **out)
&virt_fid, base,
fpver->pv_u.formulaic.pvf_allowance, NULL, out));
}
#endif

struct conf_pver_enumerate_st {
int est_counter;
Expand Down Expand Up @@ -534,6 +546,7 @@ static int conf_pver_recd_build(struct m0_conf_obj *obj, void *args)
return M0_CW_CONTINUE;
}

#ifdef ENABLE_ALT_PVERS
static int conf_objv_failed_fill(struct m0_conf_obj *obj, void *args)
{
struct arr_int_pos *a = args;
Expand Down Expand Up @@ -591,6 +604,7 @@ static int conf_pver_failures_cid(struct m0_conf_pver *base, uint64_t *out)
m0_free(a.ap_arr.ai_elems);
return M0_RC(0);
}
#endif

struct conf_pver_base_walk_st {
uint32_t bws_allowance[M0_CONF_PVER_HEIGHT];
Expand Down
2 changes: 2 additions & 0 deletions conf/pvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,15 @@ m0_conf_pver_formulaic_from_virtual(const struct m0_conf_pver *virtual,
const struct m0_conf_root *root,
const struct m0_conf_pver **out);

#ifdef ENABLE_ALT_PVERS
/**
* Returns true iff pver consists of online elements only or can be
* used to generate such a pver.
*
* @pre pver is not virtual
*/
M0_INTERNAL bool m0_conf_pver_is_clean(const struct m0_conf_pver *pver);
#endif

/**
* Returns m0_conf_pver fid.
Expand Down
9 changes: 8 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ AH_TEMPLATE([M0_TRACE_HIGHEST_ALLOWED_LEVEL],[Highest trace level that is allowe
AH_TEMPLATE([M0_DEFAULT_NETWORK], [Default network transport type.])
AH_TEMPLATE([M0_LUSTRE_VERSION], [Autodetected Lustre version represented as integer])
AH_TEMPLATE([ENABLE_USER_MODE_ONLY], [Enabling user mode shall avoid kernel deps])
AH_TEMPLATE([ENABLE_ALT_PVERS], [Enable alternative pool versions.])
AH_TEMPLATE([HAVE_JOURNAL_ABORT], [Have journal_abort() function])
AH_TEMPLATE([HAVE_FILE_READV], [Have fops->readv function])
AH_TEMPLATE([HAVE_FILE_AIO_READ], [Have fops->aio_read function])
Expand Down Expand Up @@ -544,7 +545,13 @@ AC_ARG_WITH([user-mode-only],
AS_IF([test "x$with_user_mode_only" = xyes],
[AC_DEFINE([ENABLE_USER_MODE_ONLY])])


# alternative-pvers {{{3
AC_ARG_ENABLE([alternative_pvers],
AS_HELP_STRING([--enable-alternative-pvers], [enable alternative pvers]),
[], [enable_alternative_pvers=no]
)
AS_IF([test x$enable_alternative_pvers = xyes],
AC_DEFINE([ENABLE_ALT_PVERS], 1))

# linux {{{3
AC_ARG_WITH([linux],
Expand Down

0 comments on commit 12f0856

Please sign in to comment.