Skip to content
Merged
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
16 changes: 8 additions & 8 deletions src/common/pool_map.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 @@ -1877,7 +1877,7 @@ child_status_check(struct pool_domain *domain, uint32_t status)
/* Domain status update state machine */
static int
update_dom_status(struct pool_domain *domain, uint32_t id, uint32_t status, uint32_t version,
bool *updated)
bool *updated, bool for_revert)
{
int i;

Expand All @@ -1893,7 +1893,7 @@ update_dom_status(struct pool_domain *domain, uint32_t id, uint32_t status, uint
struct pool_domain *child = &domain->do_children[i];
int found;

found = update_dom_status(child, id, status, version, updated);
found = update_dom_status(child, id, status, version, updated, for_revert);
if (!found)
continue;

Expand Down Expand Up @@ -1947,14 +1947,14 @@ update_dom_status(struct pool_domain *domain, uint32_t id, uint32_t status, uint
/* Only change to DOWNOUT/DOWN if all of children are DOWNOUT/DOWN */
if (child_status_check(child, PO_COMP_ST_DOWN | PO_COMP_ST_DOWNOUT) &&
(child->do_comp.co_status != status)) {
D_DEBUG(DB_MD, "rank %u id %u status %u --> %u\n",
D_DEBUG(DB_MD, "rank %u id %u status %u --> %u, for_revert %d",
child->do_comp.co_rank, child->do_comp.co_id,
child->do_comp.co_status, status);
child->do_comp.co_status, status, for_revert);
if (child->do_comp.co_status == PO_COMP_ST_DOWN)
child->do_comp.co_flags = PO_COMPF_DOWN2OUT;

child->do_comp.co_status = status;
if (status == PO_COMP_ST_DOWN)
if (status == PO_COMP_ST_DOWN && !for_revert)
child->do_comp.co_fseq = version;
*updated = true;
}
Expand All @@ -1975,12 +1975,12 @@ update_dom_status(struct pool_domain *domain, uint32_t id, uint32_t status, uint

int
update_dom_status_by_tgt_id(struct pool_map *map, uint32_t tgt_id, uint32_t status,
uint32_t version, bool *updated)
uint32_t version, bool *updated, bool for_revert)
{
int rc;

D_ASSERT(map->po_tree != NULL);
rc = update_dom_status(map->po_tree, tgt_id, status, version, updated);
rc = update_dom_status(map->po_tree, tgt_id, status, version, updated, for_revert);
if (rc < 0)
return rc;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/include/daos/pool_map.h
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 @@ -309,7 +309,7 @@ int pool_map_find_failed_tgts_by_rank(struct pool_map *map,
unsigned int *tgt_cnt, d_rank_t rank);
int
update_dom_status_by_tgt_id(struct pool_map *map, uint32_t tgt_id, uint32_t status,
uint32_t version, bool *updated);
uint32_t version, bool *updated, bool for_revert);
bool
pool_map_node_status_match(struct pool_domain *dom, unsigned int status);

Expand Down
20 changes: 11 additions & 9 deletions src/pool/srv_pool_map.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* (C) Copyright 2021-2024 Intel Corporation.
* (C) Copyright 2025 Google LLC
* (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 @@ -318,40 +318,42 @@ update_one_dom(struct pool_map *map, struct pool_domain *dom, struct pool_target
if (dom->do_comp.co_status == PO_COMP_ST_DOWNOUT ||
dom->do_comp.co_status == PO_COMP_ST_DOWN)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_UP,
*version, &updated);
*version, &updated, false);
break;
case MAP_EXTEND:
if (dom->do_comp.co_status == PO_COMP_ST_NEW)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_UP,
*version, &updated);
*version, &updated, false);
break;
case MAP_EXCLUDE:
/* Only change the dom status if it is from SWIM eviction */
if (exclude_rank &&
!(dom->do_comp.co_status & (PO_COMP_ST_DOWN | PO_COMP_ST_DOWNOUT)) &&
pool_map_node_status_match(dom, PO_COMP_ST_DOWN | PO_COMP_ST_DOWNOUT))
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_DOWN,
*version, &updated);
*version, &updated, false);
break;
case MAP_FINISH_REBUILD:
if (dom->do_comp.co_status == PO_COMP_ST_UP)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_UPIN,
*version, &updated);
*version, &updated, false);
else if (dom->do_comp.co_status == PO_COMP_ST_DOWN && exclude_rank)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_DOWNOUT,
*version, &updated);
*version, &updated, false);
break;
case MAP_REVERT_REBUILD:
if (dom->do_comp.co_status == PO_COMP_ST_UP) {
if (dom->do_comp.co_fseq == 1)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id, PO_COMP_ST_NEW,
*version, &updated);
*version, &updated, true);
else if (dom->do_comp.co_flags == PO_COMPF_DOWN2UP)
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id,
PO_COMP_ST_DOWN, *version, &updated);
PO_COMP_ST_DOWN, *version, &updated,
true);
else
update_dom_status_by_tgt_id(map, tgt->ta_comp.co_id,
PO_COMP_ST_DOWNOUT, *version, &updated);
PO_COMP_ST_DOWNOUT, *version, &updated,
true);
}
break;
default:
Expand Down
9 changes: 5 additions & 4 deletions src/rebuild/srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ rebuild_leader_set_status(struct rebuild_global_pool_tracker *rgt,
}

if (status->dtx_resync_version != resync_ver)
D_INFO(DF_RB " rank %d, update dtx_resync_version from %d to %d", DP_RB_RGT(rgt),
rank, status->dtx_resync_version, resync_ver);
D_DEBUG(DB_REBUILD, DF_RB " rank %d, update dtx_resync_version from %d to %d",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
D_DEBUG(DB_REBUILD, DF_RB " rank %d, update dtx_resync_version from %d to %d",
D_DEBUG(DB_REBUILD, DF_RB " rank %d, update dtx_resync_version from %d to %d\n",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks the gurt d_vlog() code will add the "\n" automatically if not provided.

DP_RB_RGT(rgt), rank, status->dtx_resync_version, resync_ver);
status->dtx_resync_version = resync_ver;
if (flags & SCAN_DONE)
status->scan_done = 1;
Expand Down Expand Up @@ -2906,8 +2906,9 @@ rebuild_tgt_status_check_ult(void *arg)
rpt->rt_reported_rec_cnt = status.rec_count;
rpt->rt_reported_size = status.size;
if (iv.riv_dtx_resyc_version > reported_dtx_resyc_ver) {
D_INFO(DF_RB "reported riv_dtx_resyc_version %d",
DP_RB_RPT(rpt), iv.riv_dtx_resyc_version);
D_DEBUG(DB_REBUILD,
DF_RB "reported riv_dtx_resyc_version %d",
DP_RB_RPT(rpt), iv.riv_dtx_resyc_version);
reported_dtx_resyc_ver = iv.riv_dtx_resyc_version;
}
} else {
Expand Down
Loading