Skip to content

Commit

Permalink
DAOS-16943 rebuild: check DAOS_REBUILD ENV also for restart
Browse files Browse the repository at this point in the history
For restart, check DAOS_REBUILD ENV in ds_rebuild_regenerate_task
to make it be able to disable rebuild.

Signed-off-by: Xuezhao Liu <[email protected]>
  • Loading branch information
Liu Xuezhao committed Jan 15, 2025
1 parent ef6b324 commit 211685a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pool/srv_pool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -7255,7 +7256,8 @@ pool_svc_update_map(struct pool_svc *svc, crt_opcode_t opc, bool exclude_rank,
d_agetenv_str(&env, REBUILD_ENV);
if ((env && !strcasecmp(env, REBUILD_ENV_DISABLED)) ||
daos_fail_check(DAOS_REBUILD_DISABLE)) {
D_DEBUG(DB_TRACE, "Rebuild is disabled\n");
D_DEBUG(DB_REBUILD, DF_UUID ": Rebuild is disabled for all pools\n",
DP_UUID(svc->ps_pool->sp_uuid));
d_freeenv_str(&env);
D_GOTO(out, rc = 0);
}
Expand Down
11 changes: 11 additions & 0 deletions src/rebuild/srv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -2144,10 +2145,20 @@ int
ds_rebuild_regenerate_task(struct ds_pool *pool, daos_prop_t *prop)
{
struct daos_prop_entry *entry;
char *env;
int rc = 0;

rebuild_gst.rg_abort = 0;

d_agetenv_str(&env, REBUILD_ENV);
if (env && !strcasecmp(env, REBUILD_ENV_DISABLED)) {
D_DEBUG(DB_REBUILD, DF_UUID ": Rebuild is disabled for all pools\n",
DP_UUID(pool->sp_uuid));
d_freeenv_str(&env);
return DER_SUCCESS;
}
d_freeenv_str(&env);

if (pool->sp_reint_mode == DAOS_REINT_MODE_NO_DATA_SYNC) {
D_DEBUG(DB_REBUILD, DF_UUID" No data sync for reintegration\n",
DP_UUID(pool->sp_uuid));
Expand Down

0 comments on commit 211685a

Please sign in to comment.