Skip to content

Commit

Permalink
DAOS-14473 pool: Fix merge conflict resolution (#13130)
Browse files Browse the repository at this point in the history
Fix the merge conflict resolution around pool_svc_schedule.

Signed-off-by: Li Wei <[email protected]>
  • Loading branch information
liw authored Oct 10, 2023
1 parent 0508fe7 commit 03ebef2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/chk/chk_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ chk_engine_pool_ult(void *args)
if (rc != 0)
goto out;

ds_pool_svc_schedule_reconf(svc);
rc = ds_pool_svc_schedule_reconf(svc);

out:
chk_engine_cont_list_fini(&aggregator);
Expand Down
2 changes: 1 addition & 1 deletion src/include/daos_srv/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ int ds_pool_target_status_check(struct ds_pool *pool, uint32_t id,
int ds_pool_mark_connectable(struct ds_pool_svc *ds_svc);
int ds_pool_svc_load_map(struct ds_pool_svc *ds_svc, struct pool_map **map);
int ds_pool_svc_flush_map(struct ds_pool_svc *ds_svc, struct pool_map *map);
void ds_pool_svc_schedule_reconf(struct ds_pool_svc *svc);
int ds_pool_svc_schedule_reconf(struct ds_pool_svc *svc);
int ds_pool_svc_update_label(struct ds_pool_svc *ds_svc, const char *label);
int ds_pool_svc_evict_all(struct ds_pool_svc *ds_svc);
struct ds_pool *ds_pool_svc2pool(struct ds_pool_svc *ds_svc);
Expand Down
46 changes: 27 additions & 19 deletions src/pool/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1714,9 +1714,9 @@ pool_svc_check_node_status(struct pool_svc *svc)
} while (0)

static int pool_svc_schedule(struct pool_svc *svc, struct pool_svc_sched *sched,
void (*func)(void *), bool for_chk, void *arg);
void (*func)(void *), void *arg, bool for_chk);
static int pool_svc_schedule_reconf(struct pool_svc *svc, struct pool_map *map,
uint32_t map_version_for, bool sync_remove);
uint32_t map_version_for, bool sync_remove, bool for_chk);
static void pool_svc_rfcheck_ult(void *arg);

static int
Expand Down Expand Up @@ -1777,7 +1777,8 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
* reconfigurations or the last MS notification.
*/
svc->ps_force_notify = true;
rc = pool_svc_schedule_reconf(svc, NULL /* map */, map_version, false /* sync_remove */);
rc = pool_svc_schedule_reconf(svc, NULL /* map */, map_version, false /* sync_remove */,
false /* for_chk */);
if (rc == -DER_OP_CANCELED) {
DL_INFO(rc, DF_UUID": not scheduling pool service reconfiguration",
DP_UUID(svc->ps_uuid));
Expand All @@ -1787,8 +1788,8 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
goto out;
}

rc = pool_svc_schedule(svc, &svc->ps_rfcheck_sched, pool_svc_rfcheck_ult,
false /* for_chk */, NULL /* arg */);
rc = pool_svc_schedule(svc, &svc->ps_rfcheck_sched, pool_svc_rfcheck_ult, NULL /* arg */,
false /* for_chk */);
if (rc != 0) {
DL_ERROR(rc, DF_UUID": failed to schedule RF check", DP_UUID(svc->ps_uuid));
goto out;
Expand Down Expand Up @@ -5875,16 +5876,15 @@ pool_svc_reconf_ult(void *varg)

static int
pool_svc_schedule(struct pool_svc *svc, struct pool_svc_sched *sched, void (*func)(void *),
bool for_chk, void *arg)
void *arg, bool for_chk)
{
enum ds_rsvc_state state;
int rc;

D_DEBUG(DB_MD, DF_UUID": begin\n", DP_UUID(svc->ps_uuid));

if (!for_chk && engine_in_check()) {
D_DEBUG(DB_MD, DF_UUID": end: skip automatic reconf in check mode\n",
DP_UUID(svc->ps_uuid));
D_DEBUG(DB_MD, DF_UUID": end: skip in check mode\n", DP_UUID(svc->ps_uuid));
return 0;
}

Expand Down Expand Up @@ -5926,13 +5926,22 @@ pool_svc_schedule(struct pool_svc *svc, struct pool_svc_sched *sched, void (*fun
* Schedule PS reconfigurations (if necessary). This is currently for the chk
* module only.
*/
void
int
ds_pool_svc_schedule_reconf(struct ds_pool_svc *svc)
{
struct pool_svc *s = pool_ds2svc(svc);
int rc;

pool_svc_schedule(s, &s->ps_reconf_sched,
pool_svc_reconf_ult, true /* for_chk */, NULL /* arg */);
/*
* Pass 1 as map_version_for, since there shall be no other
* reconfiguration in progress.
*/
rc = pool_svc_schedule_reconf(s, NULL /* map */, 1 /* map_version_for */,
false /* sync_remove */, true /* for_chk */);
if (rc != 0)
DL_ERROR(rc, DF_UUID": failed to schedule pool service reconfiguration",
DP_UUID(s->ps_uuid));
return rc;
}

static int pool_find_all_targets_by_addr(struct pool_map *map,
Expand Down Expand Up @@ -5993,7 +6002,7 @@ pool_svc_rfcheck_ult(void *arg)
*/
static int
pool_svc_schedule_reconf(struct pool_svc *svc, struct pool_map *map, uint32_t map_version_for,
bool sync_remove)
bool sync_remove, bool for_chk)
{
struct pool_svc_reconf_arg *reconf_arg;
uint32_t v;
Expand Down Expand Up @@ -6031,7 +6040,7 @@ pool_svc_schedule_reconf(struct pool_svc *svc, struct pool_map *map, uint32_t ma
* If successful, this call passes the ownership of reconf_arg to
* pool_svc_reconf_ult.
*/
rc = pool_svc_schedule(svc, &svc->ps_reconf_sched, pool_svc_reconf_ult, false, reconf_arg);
rc = pool_svc_schedule(svc, &svc->ps_reconf_sched, pool_svc_reconf_ult, reconf_arg, false);
if (rc != 0) {
D_FREE(reconf_arg);
return rc;
Expand Down Expand Up @@ -6215,7 +6224,8 @@ pool_svc_update_map_internal(struct pool_svc *svc, unsigned int opc,
* Remove all undesired PS replicas (if any) before committing map, so
* that the set of PS replicas remains a subset of the pool groups.
*/
rc = pool_svc_schedule_reconf(svc, map, 0 /* map_version_for */, true /* sync_remove */);
rc = pool_svc_schedule_reconf(svc, map, 0 /* map_version_for */, true /* sync_remove */,
false /* for_chk */);
if (rc != 0) {
DL_ERROR(rc, DF_UUID": failed to remove undesired pool service replicas",
DP_UUID(svc->ps_uuid));
Expand Down Expand Up @@ -6247,14 +6257,15 @@ pool_svc_update_map_internal(struct pool_svc *svc, unsigned int opc,

ds_rsvc_request_map_dist(&svc->ps_rsvc);

rc = pool_svc_schedule_reconf(svc, NULL /* map */, map_version, false /* sync_remove */);
rc = pool_svc_schedule_reconf(svc, NULL /* map */, map_version, false /* sync_remove */,
false /* for_chk */);
if (rc != 0)
DL_INFO(rc, DF_UUID": failed to schedule pool service reconfiguration",
DP_UUID(svc->ps_uuid));

if (opc == POOL_EXCLUDE) {
rc = pool_svc_schedule(svc, &svc->ps_rfcheck_sched, pool_svc_rfcheck_ult,
false /* for_chk */, NULL /* arg */);
NULL /* arg */, false /* for_chk */);
if (rc != 0)
DL_INFO(rc, DF_UUID": failed to schedule RF check", DP_UUID(svc->ps_uuid));
}
Expand Down Expand Up @@ -7835,9 +7846,6 @@ ds_pool_svc_flush_map(struct ds_pool_svc *ds_svc, struct pool_map *map)
ABT_rwlock_unlock(svc->ps_lock);
locked = false;
ds_rsvc_wait_map_dist(&svc->ps_rsvc);

pool_svc_schedule(svc, &svc->ps_reconf_sched,
pool_svc_reconf_ult, false /* for_chk */, NULL /* arg */);
}

out_buf:
Expand Down

0 comments on commit 03ebef2

Please sign in to comment.