Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/include/daos/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ enum {
#define DAOS_POOL_RFCHECK_FAIL (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xa1)
#define DAOS_POOL_REINT_SLOW (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xa2)
#define DAOS_CONT_DESTROY_FAIL_POST (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xa3)
#define DAOS_POOL_TGT_UPDATE_SKIP_RF_CHECK (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xa4)

#define DAOS_CHK_CONT_ORPHAN (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xb0)
#define DAOS_CHK_CONT_BAD_LABEL (DAOS_FAIL_UNIT_TEST_GROUP_LOC | 0xb1)
Expand Down
3 changes: 2 additions & 1 deletion src/pool/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -7584,7 +7584,8 @@ pool_svc_update_map_internal(struct pool_svc *svc, unsigned int opc, bool exclud
* Do not change the pool map if the `pw_rf` is broken or is about to break,
* unless the force option is given.
*/
if (!(flags & POOL_TGT_UPDATE_SKIP_RF_CHECK) && opc == MAP_EXCLUDE) {
if (!(flags & POOL_TGT_UPDATE_SKIP_RF_CHECK) && opc == MAP_EXCLUDE &&
!DAOS_FAIL_CHECK(DAOS_POOL_TGT_UPDATE_SKIP_RF_CHECK)) {
int failed_cnt;

rc = pool_map_update_failed_cnt(map);
Expand Down
29 changes: 23 additions & 6 deletions src/rebuild/srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,13 +873,17 @@ ds_rebuild_query(uuid_t pool_uuid, struct daos_rebuild_status *status)
d_list_for_each_entry(task, &rebuild_gst.rg_queue_list, dst_list) {
if (uuid_compare(task->dst_pool_uuid, pool_uuid) == 0) {
status->rs_state = DRS_IN_PROGRESS;
D_DEBUG(DB_REBUILD, "pool " DF_UUID " in rg_queue_list\n",
DP_UUID(pool_uuid));
D_GOTO(out, rc);
}
}

d_list_for_each_entry(task, &rebuild_gst.rg_running_list, dst_list) {
if (uuid_compare(task->dst_pool_uuid, pool_uuid) == 0) {
status->rs_state = DRS_IN_PROGRESS;
D_DEBUG(DB_REBUILD, "pool " DF_UUID " in rg_running_list\n",
DP_UUID(pool_uuid));
D_GOTO(out, rc);
}
}
Expand Down Expand Up @@ -1815,6 +1819,13 @@ rebuild_leader_start(struct ds_pool *pool, struct rebuild_task *task,
return rc;
}

static bool
rebuild_retryable_err(int error)
{
return (daos_crt_network_error(error) || error == -DER_TIMEDOUT || error == -DER_GRPVER ||
error == -DER_STALE || error == -DER_VOS_PARTIAL_UPDATE);
}

static void
retry_rebuild_task(struct rebuild_task *task, struct rebuild_global_pool_tracker *rgt,
daos_rebuild_opc_t *opc)
Expand All @@ -1833,8 +1844,7 @@ retry_rebuild_task(struct rebuild_task *task, struct rebuild_global_pool_tracker
/* retry with network error, since the pool map will be changed accordingly, so
* rebuild job can be fixed by the new pool map anyway.
*/
if (daos_crt_network_error(error) || error == -DER_TIMEDOUT ||
error == -DER_GRPVER || error == -DER_STALE || error == -DER_VOS_PARTIAL_UPDATE) {
if (rebuild_retryable_err(error)) {
DL_CDEBUG(error, DLOG_ERR, DLOG_INFO, error, DF_UUID " opc %u/%u retry",
DP_UUID(task->dst_pool_uuid), task->dst_rebuild_op, task->dst_map_ver);
*opc = task->dst_rebuild_op;
Expand Down Expand Up @@ -1944,7 +1954,14 @@ rebuild_task_complete_schedule(struct rebuild_task *task, struct ds_pool *pool,
daos_rebuild_opc_t retry_opc = 0;

/* If current job failed */
rgt->rgt_status.rs_state = DRS_IN_PROGRESS;
if ((rgt->rgt_opc == RB_OP_REBUILD) && (rgt->rgt_status.rs_errno != 0) &&
!rebuild_retryable_err(rgt->rgt_status.rs_errno))
rgt->rgt_status.rs_state = DRS_COMPLETED;
else
rgt->rgt_status.rs_state = DRS_IN_PROGRESS;

D_DEBUG(DB_REBUILD, DF_RB " rs_errno %d, rs_state %d\n", DP_RB_RGT(rgt),
rgt->rgt_status.rs_errno, rgt->rgt_status.rs_state);

/* reclaim or fail_reclaim failed - retry */
if (task->dst_rebuild_op == RB_OP_RECLAIM ||
Expand Down Expand Up @@ -2499,9 +2516,9 @@ rebuild_print_list_update(const uuid_t uuid, const uint32_t map_ver,
{
int i;

D_PRINT("%s [%s] (pool="DF_UUID" ver=%u) tgts=",
RB_OP_STR(rebuild_op), delay_sec == -1 ? "queued/delayed" : "queued",
DP_UUID(uuid), map_ver);
D_PRINT("%s [%s] (pool=" DF_UUID " ver=%u) %d tgts=", RB_OP_STR(rebuild_op),
delay_sec == -1 ? "queued/delayed" : "queued", DP_UUID(uuid), map_ver,
tgts->pti_number);
for (i = 0; tgts != NULL && i < tgts->pti_number; i++) {
if (i > 0)
D_PRINT(",");
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/daos_test/rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ daos_tests:
test_rebuild_29: -s5 -u subtests="29"
test_rebuild_30: -s5 -u subtests="30"
test_rebuild_31: -s5 -u subtests="31"
test_rebuild_32: -s5 -u subtests="32"
test_rebuild_32: -s7 -u subtests="32"
test_rebuild_33: -s5 -u subtests="33"
test_rebuild_34: -s5 -u subtests="34"
test_rebuild_35: -s5 -u subtests="35"
Expand Down
19 changes: 13 additions & 6 deletions src/tests/suite/daos_rebuild.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1408,12 +1408,14 @@ reintegrate_failure_and_retry(void **state)
rebuild_single_pool_rank(arg, ranks_to_kill[0], true);

arg->rebuild_cb = reintegrate_failure_cb;
print_message("start reintegrate rank %d\n", ranks_to_kill[0]);
reintegrate_single_pool_rank(arg, ranks_to_kill[0], true);

arg->rebuild_cb = NULL;
daos_debug_set_params(arg->group, -1, DMG_KEY_FAIL_LOC, 0, 0, NULL);
rebuild_io_validate(arg, oids, OBJ_NR);

print_message("redo reintegrate rank %d\n", ranks_to_kill[0]);
reintegrate_single_pool_rank(arg, ranks_to_kill[0], false);

rebuild_io_validate(arg, oids, OBJ_NR);
Expand All @@ -1425,11 +1427,11 @@ rebuild_kill_more_RF_ranks(void **state)
test_arg_t *arg = *state;
daos_obj_id_t oids[OBJ_NR];
struct ioreq req;
d_rank_t ranks[4] = {7, 6, 5, 4};
d_rank_t ranks[3] = {7, 6, 5};
int i;

if (!test_runable(arg, 7) || arg->pool.alive_svc->rl_nr < 5) {
print_message("need at least 5 svcs, -s5\n");
if (!test_runable(arg, 7) || arg->pool.alive_svc->rl_nr < 7) {
print_message("need at least 7 svcs, -s7\n");
return;
}

Expand All @@ -1440,13 +1442,18 @@ rebuild_kill_more_RF_ranks(void **state)
DAOS_TX_NONE, &req);
ioreq_fini(&req);
}
rebuild_pools_ranks(&arg, 1, ranks, 4, true);

daos_debug_set_params(arg->group, -1, DMG_KEY_FAIL_LOC,
DAOS_POOL_TGT_UPDATE_SKIP_RF_CHECK | DAOS_FAIL_ALWAYS, 0, NULL);

rebuild_pools_ranks(&arg, 1, ranks, 3, true);

reintegrate_single_pool_rank(arg, 5, true);
reintegrate_single_pool_rank(arg, 6, true);
reintegrate_single_pool_rank(arg, 4, true);
reintegrate_single_pool_rank(arg, 7, true);

daos_debug_set_params(arg->group, -1, DMG_KEY_FAIL_LOC, 0, 0, NULL);

print_message("lookup and expect -DER_RF\n");
for (i = 0; i < OBJ_NR; i++) {
ioreq_init(&req, arg->coh, oids[i], DAOS_IOD_ARRAY, arg);
Expand Down
Loading