Skip to content

Commit

Permalink
DAOS-16943 rebuild: check DAOS_REBUILD ENV also for restart (#15729)
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
liuxuezhao authored Jan 22, 2025
1 parent ba3ec5a commit 6614071
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
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
15 changes: 13 additions & 2 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 @@ -2143,11 +2144,21 @@ regenerate_task_of_type(struct ds_pool *pool, pool_comp_state_t match_states, ui
int
ds_rebuild_regenerate_task(struct ds_pool *pool, daos_prop_t *prop)
{
struct daos_prop_entry *entry;
int rc = 0;
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 6614071

Please sign in to comment.