Skip to content

Commit

Permalink
DAOS-13047 chk: properly handle start options
Browse files Browse the repository at this point in the history
Test-tag-hw-medium: Pass1Test

The start options for new instance should properly overwrite old ones.
It also enhances CR pass 1 functionality tests:

1. Verify DAOS checker under dryrun mode.

2. Verify DAOS checker under auto mode.

3. Verify that the DAOS checker can detect and repair the inconsistency
   under regular mode.

4. Fix some typo for the test tags.

5. More accurate comment for test flow.

Signed-off-by: Fan Yong <[email protected]>
  • Loading branch information
Nasf-Fan committed May 27, 2023
1 parent 7eaf5d2 commit ce96c87
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 156 deletions.
2 changes: 2 additions & 0 deletions src/chk/chk_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ chk_prop_prepare(d_rank_t leader, uint32_t flags, int phase,
int i;

prop->cp_leader = leader;
if (!(flags & CHK__CHECK_FLAG__CF_DRYRUN))
prop->cp_flags &= ~CHK__CHECK_FLAG__CF_DRYRUN;
if (flags & CHK__CHECK_FLAG__CF_NO_FAILOUT)
prop->cp_flags &= ~CHK__CHECK_FLAG__CF_FAILOUT;
if (flags & CHK__CHECK_FLAG__CF_NO_AUTO)
Expand Down
11 changes: 6 additions & 5 deletions src/chk/chk_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1972,8 +1972,8 @@ chk_engine_start_prep(struct chk_instance *ins, uint32_t rank_nr, d_rank_t *rank

init:
if (!chk_is_on_leader(gen, leader, true)) {
rc = chk_prop_prepare(leader, api_flags | prop->cp_flags, phase,
policy_nr, policies, rank_list, prop);
rc = chk_prop_prepare(leader, api_flags, phase, policy_nr, policies, rank_list,
prop);
if (rc != 0)
goto out;

Expand Down Expand Up @@ -2209,9 +2209,10 @@ chk_engine_start(uint64_t gen, uint32_t rank_nr, d_rank_t *ranks, uint32_t polic
chk_destroy_pool_tree(ins);
out_log:
if (rc >= 0) {
D_INFO(DF_ENGINE" started on rank %u with api_flags %x, phase %d, leader %u, "
"flags %x: rc %d\n",
DP_ENGINE(ins), myrank, api_flags, phase, leader, flags, rc);
D_INFO(DF_ENGINE" %s on rank %u with api_flags %x, phase %d, leader %u, "
"flags %x: rc %d\n", DP_ENGINE(ins),
(api_flags & CHK__CHECK_FLAG__CF_RESET || flags & CSF_RESET_ALL) ?
"start" : "resume", myrank, api_flags, phase, leader, flags, rc);

chk_ranks_dump(ins->ci_ranks->rl_nr, ins->ci_ranks->rl_ranks);
chk_pools_dump(&ins->ci_pool_list, pool_nr, pools);
Expand Down
5 changes: 2 additions & 3 deletions src/chk/chk_leader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2325,7 +2325,7 @@ chk_leader_start_prep(struct chk_instance *ins, uint32_t rank_nr, d_rank_t *rank
if (rc != 0)
goto out;

ins->ci_start_flags |= CSF_RESET_ALL;
ins->ci_start_flags = CSF_RESET_ALL;
if (pool_nr <= 0)
ins->ci_start_flags |= CSF_ORPHAN_POOL;

Expand All @@ -2334,8 +2334,7 @@ chk_leader_start_prep(struct chk_instance *ins, uint32_t rank_nr, d_rank_t *rank
cbk->cb_version = DAOS_CHK_VERSION;

init:
rc = chk_prop_prepare(leader, flags | prop->cp_flags, phase,
policy_nr, policies, rank_list, prop);
rc = chk_prop_prepare(leader, flags, phase, policy_nr, policies, rank_list, prop);
if (rc != 0)
goto out;

Expand Down
Loading

0 comments on commit ce96c87

Please sign in to comment.