Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

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 #1958.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
  • Loading branch information
andriytk committed Jul 6, 2022
1 parent 275f821 commit d97232f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions conf/pvers.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,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 +282,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 +307,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
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 d97232f

Please sign in to comment.