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-15930 test: extend_simple add FI required macro call #14667

Merged
merged 1 commit into from
Jul 3, 2024
Merged
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
51 changes: 37 additions & 14 deletions src/tests/suite/daos_extend_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ extend_cb_internal(void *arg)
int total_entries = 0;
uint32_t num_ents = 10;
daos_anchor_t anchor = { 0 };
const char *pre_op = (cb_arg->kill ? "kill" : "extend");
int rc;
int i;

print_message("sleep 10 seconds then kill/extend %u and start op %d\n",
print_message("sleep 10 seconds then %s %u and start op %d\n", pre_op,
cb_arg->rank, opc);
sleep(10);

Expand All @@ -339,14 +340,16 @@ extend_cb_internal(void *arg)
test_arg->pool.alive_svc, cb_arg->rank);
} else {
/* it should fail with -DER_BUSY */
print_message("extend pool " DF_UUID " rank %u\n",
DP_UUID(test_arg->pool.pool_uuid), cb_arg->rank);
rc = dmg_pool_extend(test_arg->dmg_config, test_arg->pool.pool_uuid,
test_arg->group, &cb_arg->rank, 1);
assert_int_equal(rc, 0);
}
/* Kill another rank during extend */
switch(opc) {
case EXTEND_PUNCH:
print_message("punch objects during extend\n");
print_message("punch objects during %s\n", pre_op);
for (i = 0; i < EXTEND_OBJ_NR; i++) {
char filename[32];

Expand All @@ -356,7 +359,7 @@ extend_cb_internal(void *arg)
}
break;
case EXTEND_STAT:
print_message("stat objects during extend\n");
print_message("stat objects during %s\n", pre_op);
for (i = 0; i < EXTEND_OBJ_NR; i++) {
char filename[32];
struct stat stbuf;
Expand All @@ -367,7 +370,7 @@ extend_cb_internal(void *arg)
}
break;
case EXTEND_ENUMERATE:
print_message("enumerate objects during extend\n");
print_message("enumerate objects during %s\n", pre_op);
while (!daos_anchor_is_eof(&anchor)) {
num_ents = 10;
rc = dfs_readdir(dfs_mt, dir, &anchor, &num_ents, ents);
Expand All @@ -377,11 +380,11 @@ extend_cb_internal(void *arg)
assert_int_equal(total_entries, 1000);
break;
case EXTEND_FETCH:
print_message("fetch objects during extend\n");
print_message("fetch objects during %s\n", pre_op);
extend_read_check(dfs_mt, dir);
break;
case EXTEND_UPDATE:
print_message("update objects during extend\n");
print_message("update objects during %s\n", pre_op);
extend_write(dfs_mt, dir);
break;
default:
Expand All @@ -403,6 +406,7 @@ dfs_extend_internal(void **state, int opc, test_rebuild_cb_t extend_cb, bool kil
dfs_obj_t *dir;
uuid_t co_uuid;
int i;
d_rank_t extend_rank = 3;
char str[37];
daos_obj_id_t oids[EXTEND_OBJ_NR];
struct extend_cb_arg cb_arg;
Expand Down Expand Up @@ -454,29 +458,38 @@ dfs_extend_internal(void **state, int opc, test_rebuild_cb_t extend_cb, bool kil
arg->rebuild_cb = extend_cb;
arg->rebuild_cb_arg = &cb_arg;

/* HOLD rebuild ULT */
/* HOLD rebuild ULT. FIXME: maybe change to use test_set_engine_fail_loc()? */
print_message("inject DAOS_REBUILD_TGT_SCAN_HANG fault on engines\n");
daos_debug_set_params(arg->group, -1, DMG_KEY_FAIL_LOC,
DAOS_REBUILD_TGT_SCAN_HANG | DAOS_FAIL_ALWAYS, 0, NULL);

arg->no_rebuild=1;
extend_single_pool_rank(arg, 3);
extend_single_pool_rank(arg, extend_rank);
arg->no_rebuild=0;

print_message("sleep 30 secs for rank %u exclude or reintegrate.\n", cb_arg.rank);
print_message("sleep 30 secs for rank %u %s\n", cb_arg.rank,
cb_arg.kill ? "exclude" : "extend");
sleep(30);
print_message("wait for rebuild due to rank %u extend and rank %u %s\n", extend_rank,
cb_arg.rank, cb_arg.kill ? "exclude" : "extend");
test_rebuild_wait(&arg, 1);

if (opc == EXTEND_UPDATE)
if (opc == EXTEND_UPDATE) {
print_message("First extend update read check\n");
extend_read_check(dfs_mt, dir);
}

print_message("reintegrate rank %u then check\n", cb_arg.rank);
arg->rebuild_cb = NULL;
arg->rebuild_cb_arg = NULL;
if (kill)
reintegrate_single_pool_rank(arg, 2, true);
if (kill) {
print_message("reintegrate rank %u\n", cb_arg.rank);
reintegrate_single_pool_rank(arg, cb_arg.rank, true);
}

if (opc == EXTEND_UPDATE)
if (opc == EXTEND_UPDATE) {
print_message("Second extend update read check\n");
extend_read_check(dfs_mt, dir);
}

rc = dfs_release(dir);
assert_int_equal(rc, 0);
Expand All @@ -494,6 +507,8 @@ dfs_extend_internal(void **state, int opc, test_rebuild_cb_t extend_cb, bool kil
void
dfs_extend_punch_kill(void **state)
{
FAULT_INJECTION_REQUIRED();

dfs_extend_internal(state, EXTEND_PUNCH, extend_cb_internal, true);
}

Expand All @@ -508,6 +523,8 @@ dfs_extend_punch_extend(void **state)
void
dfs_extend_stat_kill(void **state)
{
FAULT_INJECTION_REQUIRED();

dfs_extend_internal(state, EXTEND_STAT, extend_cb_internal, true);
}

Expand All @@ -522,6 +539,8 @@ dfs_extend_stat_extend(void **state)
void
dfs_extend_enumerate_kill(void **state)
{
FAULT_INJECTION_REQUIRED();

dfs_extend_internal(state, EXTEND_ENUMERATE, extend_cb_internal, true);
}

Expand All @@ -536,6 +555,8 @@ dfs_extend_enumerate_extend(void **state)
void
dfs_extend_fetch_kill(void **state)
{
FAULT_INJECTION_REQUIRED();

dfs_extend_internal(state, EXTEND_FETCH, extend_cb_internal, true);
}

Expand All @@ -550,6 +571,8 @@ dfs_extend_fetch_extend(void **state)
void
dfs_extend_write_kill(void **state)
{
FAULT_INJECTION_REQUIRED();

dfs_extend_internal(state, EXTEND_UPDATE, extend_cb_internal, true);
}

Expand Down