From d304d64d781592291b5f8bd3ad437dfd7cbde32f Mon Sep 17 00:00:00 2001 From: Andriy Tkachuk Date: Tue, 5 Jul 2022 15:02:36 +0100 Subject: [PATCH] CORTX-33537: disable alternative pvers by default We want the I/O to be done in the base pool version in the degraded mode. Later, when we introduce the side pool versions, we will do the degraded I/O in them and use them for fasters 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 --- conf/pvers.c | 6 ++++++ conf/pvers.h | 2 ++ configure.ac | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/pvers.c b/conf/pvers.c index 53dfeb66ee5..3df8d043f75 100644 --- a/conf/pvers.c +++ b/conf/pvers.c @@ -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)); @@ -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; @@ -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 }; diff --git a/conf/pvers.h b/conf/pvers.h index 053b832fce4..61f0fe4475d 100644 --- a/conf/pvers.h +++ b/conf/pvers.h @@ -182,6 +182,7 @@ 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. @@ -189,6 +190,7 @@ m0_conf_pver_formulaic_from_virtual(const struct m0_conf_pver *virtual, * @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. diff --git a/configure.ac b/configure.ac index 54909ecbca6..8e4d76b6c89 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) @@ -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],