Skip to content

Commit

Permalink
DAOS-14010 rebuild: discard non-exist cont/obj for reint
Browse files Browse the repository at this point in the history
Some containers/objects possibly be destroyed between exclude and
reint, so during reintegration should try to discard those containers
or objects.
Add reint post process for that purpose.

Set DAOS_INCR_REINT_ENABLE ENV as "1" to enable incremental reint,
by default it is disabled for 2.8.

Skip-nlt: true

Signed-off-by: Xuezhao Liu <[email protected]>
  • Loading branch information
liuxuezhao committed Jan 12, 2025
1 parent 14e3039 commit a92a767
Show file tree
Hide file tree
Showing 10 changed files with 398 additions and 93 deletions.
7 changes: 3 additions & 4 deletions src/container/srv_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ int
ds_cont_tgt_refresh_track_eph(uuid_t pool_uuid, uuid_t cont_uuid,
daos_epoch_t ec_agg_eph, daos_epoch_t stable_eph)
{
struct ds_pool *pool;
struct ds_pool *pool = NULL;
struct pool_target *tgts;
struct refresh_track_eph_arg arg;
d_rank_t rank;
Expand Down Expand Up @@ -1861,17 +1861,16 @@ ds_cont_tgt_refresh_track_eph(uuid_t pool_uuid, uuid_t cont_uuid,
rank = dss_self_rank();
rc = pool_map_find_target_by_rank_idx(pool->sp_map, rank, -1, &tgts);
D_ASSERT(rc == dss_tgt_nr);
for (i = 0; i < dss_tgt_nr; i++) {
for (i = 0; i < dss_tgt_nr; i++)
arg.tgt_status[i] = tgts[i].ta_comp.co_status;
}
ds_pool_put(pool);

rc = ds_pool_task_collective(pool_uuid, PO_COMP_ST_NEW | PO_COMP_ST_DOWN |
PO_COMP_ST_DOWNOUT, cont_refresh_track_eph_one,
&arg, DSS_ULT_FL_PERIODIC);

out:
if (arg.tgt_status != arg.tgt_status_inline)
if (arg.tgt_status != NULL && arg.tgt_status != arg.tgt_status_inline)
D_FREE(arg.tgt_status);
return rc;
}
Expand Down
8 changes: 4 additions & 4 deletions src/include/daos_srv/daos_engine.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2016-2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -694,9 +694,9 @@ unsigned int dss_ctx_nr_get(void);

/* Cache for container root */
struct tree_cache_root {
struct btr_root btr_root;
daos_handle_t root_hdl;
unsigned int count;
struct btr_root tcr_btr_root;
daos_handle_t tcr_root_hdl;
unsigned int tcr_count;
};

int
Expand Down
5 changes: 3 additions & 2 deletions src/include/daos_srv/object.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2022 Intel Corporation.
* (C) Copyright 2022-2025 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -76,7 +77,7 @@ struct ds_migrate_status {

int
ds_migrate_query_status(uuid_t pool_uuid, uint32_t ver, unsigned int generation, int op,
struct ds_migrate_status *dms);
bool gl_scan_done, struct ds_migrate_status *dms);

int
ds_object_migrate_send(struct ds_pool *pool, uuid_t pool_hdl_uuid, uuid_t cont_uuid,
Expand Down
1 change: 1 addition & 0 deletions src/include/daos_srv/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ void ds_pool_disable_exclude(void);
void ds_pool_enable_exclude(void);

extern bool ec_agg_disabled;
extern bool daos_incr_reint_enabled;

int dsc_pool_open(uuid_t pool_uuid, uuid_t pool_hdl_uuid,
unsigned int flags, const char *grp,
Expand Down
4 changes: 2 additions & 2 deletions src/object/srv_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ struct migrate_pool_tls {
unsigned int mpt_ult_running:1,
mpt_init_tls:1,
mpt_fini:1,
mpt_reintegrating_check:1,
mpt_reintegrating:1;
mpt_reintegrating:1, /* incremental reint flag */
mpt_post_process_started:1; /* reint post process started flag */

/* migration init error */
int mpt_init_err;
Expand Down
Loading

0 comments on commit a92a767

Please sign in to comment.