Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-14535 pool: start/stop ds_pool_child individually #13347

Merged
merged 2 commits into from
Nov 22, 2023
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
4 changes: 1 addition & 3 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ ds_cont_child_stop_all(struct ds_pool_child *pool_child)
DP_UUID(pool_child->spc_uuid),
dss_get_module_info()->dmi_tgt_id);

D_ASSERT(d_list_empty(&pool_child->spc_list));

cont_list = &pool_child->spc_cont_list;
while (!d_list_empty(cont_list)) {
cont_child = d_list_entry(cont_list->next,
Expand Down Expand Up @@ -1532,7 +1530,7 @@ ds_cont_local_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid, uuid_t cont_uuid,
if (ddra == NULL)
D_GOTO(err_dtx, rc = -DER_NOMEM);

ddra->pool = ds_pool_child_get(hdl->sch_cont->sc_pool);
ddra->pool = ds_pool_child_lookup(hdl->sch_cont->sc_pool->spc_uuid);
uuid_copy(ddra->co_uuid, cont_uuid);
rc = dss_ult_create(ds_dtx_resync, ddra, DSS_XS_SELF,
0, 0, NULL);
Expand Down
20 changes: 18 additions & 2 deletions src/include/daos_srv/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct ds_pool {
ABT_cond sp_fetch_hdls_cond;
ABT_cond sp_fetch_hdls_done_cond;
struct ds_iv_ns *sp_iv_ns;
uint32_t *sp_states; /* pool child state array */

/* structure related to EC aggregate epoch query */
d_list_t sp_ec_ephs_list;
Expand Down Expand Up @@ -128,6 +129,13 @@ struct ds_pool_hdl {
struct ds_pool_hdl *ds_pool_hdl_lookup(const uuid_t uuid);
void ds_pool_hdl_put(struct ds_pool_hdl *hdl);

enum pool_child_state {
POOL_CHILD_NEW = 0,
POOL_CHILD_STARTING,
POOL_CHILD_STARTED,
POOL_CHILD_STOPPING,
};

/*
* Per-thread pool object
*
Expand Down Expand Up @@ -160,8 +168,9 @@ struct ds_pool_child {
int spc_ref;
ABT_eventual spc_ref_eventual;

uint64_t spc_discard_done:1;
uint32_t spc_discard_done:1;
uint32_t spc_reint_mode;
uint32_t *spc_state; /* Pointer to ds_pool->sp_states[i] */
/**
* Per-pool per-module metrics, see ${modname}_pool_metrics for the
* actual structure. Initialized only for modules that specified a
Expand All @@ -182,9 +191,16 @@ struct ds_pool_svc_op_val {
char ov_resvd[60];
};

/* Find ds_pool_child in cache, hold one reference */
struct ds_pool_child *ds_pool_child_lookup(const uuid_t uuid);
struct ds_pool_child *ds_pool_child_get(struct ds_pool_child *child);
/* Put the reference held by ds_pool_child_lookup() */
void ds_pool_child_put(struct ds_pool_child *child);
/* Start ds_pool child */
int ds_pool_child_start(uuid_t pool_uuid);
/* Stop ds_pool_child */
int ds_pool_child_stop(uuid_t pool_uuid);
/* Query pool child state */
uint32_t ds_pool_child_state(struct ds_pool *pool, uint32_t tgt_id);

int ds_pool_bcast_create(crt_context_t ctx, struct ds_pool *pool,
enum daos_module_id module, crt_opcode_t opcode,
Expand Down
Loading
Loading