Skip to content
Snippets Groups Projects
Commit eb7822f5 authored by Lucas A. M. Magalhaes's avatar Lucas A. M. Magalhaes
Browse files

pool: disable SDS check if not supported


pmempool SDS checks where not a automaticaly skipping if SDS is not
supported.

Signed-off-by: default avatarLucas A. M. Magalhaes <lamm@linux.ibm.com>
parent d29eb2ed
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ enum question {
#define SDS_CHECK_STR "checking shutdown state"
#define SDS_OK_STR "shutdown state correct"
#define SDS_DIRTY_STR "shutdown state is dirty"
#define SDS_NOT_SUPP "shutdown state not supported"
#define ADR_FAILURE_STR \
"an ADR failure was detected - your pool might be corrupted"
......@@ -46,6 +47,22 @@ enum question {
? SDS_DIRTY_STR ".|" ZERO_SDS_STR \
: ADR_FAILURE_STR ".|" RESET_SDS_STR
/*
*
*/
static int
sds_is_supported(location *loc)
{
LOG(3, NULL);
ASSERTne(loc, NULL);
struct pool_replica *rep = REP(loc->set, 0);
ASSERTne(rep, NULL);
ASSERTne(PART(rep, 0)->fd, 0);
return shutdown_state_is_supported(PART(rep, 0)->fd);
}
/*
* sds_check_replica -- (internal) check if replica is healthy
*/
......@@ -89,6 +106,13 @@ sds_check(PMEMpoolcheck *ppc, location *loc)
CHECK_INFO(ppc, "%s" SDS_CHECK_STR, loc->prefix);
/* shutdown state is supported */
if (sds_is_supported(loc)) {
CHECK_INFO(ppc, "%s" SDS_NOT_SUPP, loc->prefix);
loc->step = CHECK_STEP_COMPLETE;
return 0;
}
/* shutdown state is valid */
if (!sds_check_replica(loc)) {
CHECK_INFO(ppc, "%s" SDS_OK_STR, loc->prefix);
......@@ -245,6 +269,20 @@ check_sds(PMEMpoolcheck *ppc)
const unsigned nreplicas = ppc->pool->set_file->poolset->nreplicas;
location *loc = check_get_step_data(ppc->data);
/*
* SDS check can be made before header repair so header features can be
* corrupted at this point.
*/
/* initialize replica 0 for sds check */
loc->replica = 0;
init_location_data(ppc, loc);
if (!sds_is_supported(loc)) {
CHECK_INFO(ppc, "%s" SDS_CHECK_STR,
loc->prefix);
CHECK_INFO(ppc, "%s" SDS_NOT_SUPP, loc->prefix);
return;
}
if (!loc->init_done) {
sds_get_healthy_replicas_num(ppc, loc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment