Skip to content

Commit

Permalink
Merge branch 'master' into amd/readdir-parallel
Browse files Browse the repository at this point in the history
Test-tag: dfuse
Required-githooks: true
  • Loading branch information
ashleypittman committed Jan 22, 2024
2 parents 68083a5 + 1946ef3 commit 2a1c453
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 88 deletions.
4 changes: 2 additions & 2 deletions src/cart/crt_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3508,8 +3508,8 @@ crt_iv_update_internal(crt_iv_namespace_t ivns, uint32_t class_id,

D_GOTO(exit, rc);
} else {
DL_CDEBUG(rc == -DER_NONEXIST || rc == -DER_NOTLEADER, DLOG_INFO, DLOG_ERR, rc,
"ivo_on_update failed");
DL_CDEBUG(rc == -DER_NONEXIST || rc == -DER_NOTLEADER || rc == -DER_BUSY,
DLOG_INFO, DLOG_ERR, rc, "ivo_on_update failed");

update_comp_cb(ivns, class_id, iv_key, NULL,
iv_value, rc, cb_arg);
Expand Down
10 changes: 9 additions & 1 deletion src/container/oid_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct oid_iv_entry {
struct oid_iv_range rg;
/** protect the entry */
ABT_mutex lock;
void *current_req;
};

/** Priv data in the iv layer */
Expand Down Expand Up @@ -130,7 +131,14 @@ oid_iv_ent_update(struct ds_iv_entry *ns_entry, struct ds_iv_key *iv_key,
D_ASSERT(priv != NULL);

entry = ns_entry->iv_value.sg_iovs[0].iov_buf;
ABT_mutex_lock(entry->lock);
rc = ABT_mutex_trylock(entry->lock);
/* For retry requests, from _iv_op(), the lock may not be released
* in some cases.
*/
if (rc == ABT_ERR_MUTEX_LOCKED && entry->current_req != src)
return -DER_BUSY;

entry->current_req = src;
avail = &entry->rg;

oids = src->sg_iovs[0].iov_buf;
Expand Down
6 changes: 3 additions & 3 deletions src/engine/server_iv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2017-2023 Intel Corporation.
* (C) Copyright 2017-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1053,7 +1053,7 @@ _iv_op(struct ds_iv_ns *ns, struct ds_iv_key *key, d_sg_list_t *value,
retry:
rc = iv_op_internal(ns, key, value, sync, shortcut, opc);
if (retry && !ns->iv_stop &&
(daos_rpc_retryable_rc(rc) || rc == -DER_NOTLEADER)) {
(daos_rpc_retryable_rc(rc) || rc == -DER_NOTLEADER || rc == -DER_BUSY)) {
if (rc == -DER_NOTLEADER && key->rank != (d_rank_t)(-1) &&
sync && (sync->ivs_mode == CRT_IV_SYNC_LAZY ||
sync->ivs_mode == CRT_IV_SYNC_EAGER)) {
Expand All @@ -1070,7 +1070,7 @@ _iv_op(struct ds_iv_ns *ns, struct ds_iv_key *key, d_sg_list_t *value,
* but in-flight fetch request return IVCB_FORWARD, then queued RPC will
* reply IVCB_FORWARD.
*/
D_WARN("ns %u retry for class %d opc %d rank %u/%u: " DF_RC "\n", ns->iv_ns_id,
D_INFO("ns %u retry for class %d opc %d rank %u/%u: " DF_RC "\n", ns->iv_ns_id,
key->class_id, opc, key->rank, ns->iv_master_rank, DP_RC(rc));
/* sleep 1sec and retry */
dss_sleep(1000);
Expand Down
15 changes: 15 additions & 0 deletions src/gurt/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,21 @@ d_getenv_uint(const char *name, unsigned *uint_val)
return -DER_SUCCESS;
}

/**
* get an unsigned integer type environment variables.
*
* \param[in] name name of the environment variable.
* \param[in,out] uint_val returned value of the ENV. Will not change the original
* value if ENV is not set or set as a non-integer value.
* \return 0 on success, a negative value on error.
* \deprecated d_getenv_int() is deprecated, please use d_getenv_uint().
*/
int
d_getenv_int(const char *name, unsigned *uint_val)
{
return d_getenv_uint(name, uint_val);
}

/**
* get a 32bits unsigned integer type environment variables
*
Expand Down
10 changes: 3 additions & 7 deletions src/include/gurt/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ d_getenv_bool(const char *name, bool *bool_val);
int
d_getenv_char(const char *name, char *char_val);
int
d_getenv_int(const char *name, unsigned int *uint_val)
__attribute__((deprecated("use d_getenv_uint")));
int
d_getenv_uint(const char *name, unsigned int *uint_val);
int
d_getenv_uint32_t(const char *name, uint32_t *uint32_val);
Expand All @@ -601,13 +604,6 @@ d_unsetenv(const char *name);
int
d_clearenv(void);

static inline int
d_getenv_int(const char *name, unsigned int *uint_val)
{
D_WARN("d_getenv_int() is deprecated, please use d_getenv_uint()");
return d_getenv_uint(name, uint_val);
}

int
d_write_string_buffer(struct d_string_buffer_t *buf, const char *fmt, ...);
void
Expand Down
4 changes: 0 additions & 4 deletions src/pool/srv_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ int ds_pool_iv_srv_hdl_invalidate(struct ds_pool *pool);
int ds_pool_iv_conn_hdl_fetch(struct ds_pool *pool);
int ds_pool_iv_conn_hdl_invalidate(struct ds_pool *pool, uuid_t hdl_uuid);

int ds_pool_iv_srv_hdl_fetch_non_sys(struct ds_pool *pool,
uuid_t *srv_cont_hdl,
uuid_t *srv_pool_hdl);

/*
* srv_metrics.c
*/
Expand Down
57 changes: 0 additions & 57 deletions src/pool/srv_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,63 +1496,6 @@ ds_pool_iv_srv_hdl_fetch(struct ds_pool *pool, uuid_t *pool_hdl_uuid,
return rc;
}

struct srv_hdl_ult_arg {
struct ds_pool *pool;
ABT_eventual eventual;
};

static void
pool_iv_srv_hdl_fetch_ult(void *data)
{
struct srv_hdl_ult_arg *arg = data;
int rc;

rc = ds_pool_iv_srv_hdl_fetch(arg->pool, NULL, NULL);

ABT_eventual_set(arg->eventual, (void *)&rc, sizeof(rc));
}

int
ds_pool_iv_srv_hdl_fetch_non_sys(struct ds_pool *pool, uuid_t *srv_cont_hdl,
uuid_t *srv_pool_hdl)
{
struct srv_hdl_ult_arg arg;
ABT_eventual eventual;
int *status;
int rc;

/* Fetch the capability from the leader. To avoid extra locks,
* all metadatas are maintained by xstream 0, so let's create
* an ULT on xstream 0 to let xstream 0 to handle capa fetch
* and update.
*/
rc = ABT_eventual_create(sizeof(*status), &eventual);
if (rc != ABT_SUCCESS)
return dss_abterr2der(rc);

arg.pool = pool;
arg.eventual = eventual;
rc = dss_ult_create(pool_iv_srv_hdl_fetch_ult, &arg, DSS_XS_SYS,
0, 0, NULL);
if (rc)
D_GOTO(out_eventual, rc);

rc = ABT_eventual_wait(eventual, (void **)&status);
if (rc != ABT_SUCCESS)
D_GOTO(out_eventual, rc = dss_abterr2der(rc));
if (*status != 0)
D_GOTO(out_eventual, rc = *status);

if (srv_cont_hdl)
uuid_copy(*srv_cont_hdl, pool->sp_srv_cont_hdl);
if (srv_pool_hdl)
uuid_copy(*srv_pool_hdl, pool->sp_srv_pool_hdl);

out_eventual:
ABT_eventual_free(&eventual);
return rc;
}

int
ds_pool_iv_prop_update(struct ds_pool *pool, daos_prop_t *prop)
{
Expand Down
10 changes: 7 additions & 3 deletions src/pool/srv_pool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1810,6 +1810,11 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
} else {
uuid_generate(pool_hdl_uuid);
uuid_generate(cont_hdl_uuid);
/* Only copy server handle to make is_from_srv() check correctly, and
* container server handle will not be copied here, otherwise
* ds_pool_iv_refresh_hdl will not open the server container handle.
*/
uuid_copy(svc->ps_pool->sp_srv_pool_hdl, pool_hdl_uuid);
}

rc = ds_pool_iv_srv_hdl_update(svc->ps_pool, pool_hdl_uuid,
Expand Down Expand Up @@ -4296,8 +4301,7 @@ ds_pool_query_handler(crt_rpc_t *rpc, int handler_version)
metrics = svc->ps_pool->sp_metrics[DAOS_POOL_MODULE];

/* See comment above, rebuild doesn't connect the pool */
if ((query_bits & DAOS_PO_QUERY_SPACE) &&
!is_pool_from_srv(in->pqi_op.pi_uuid, in->pqi_op.pi_hdl)) {
if (query_bits & DAOS_PO_QUERY_SPACE) {
rc = pool_space_query_bcast(rpc->cr_ctx, svc, in->pqi_op.pi_hdl,
&out->pqo_space);
if (unlikely(rc))
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/erasurecode/multiple_failure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ server_config:
storage: auto
pool:
size: 93%
svcn: 1
svcn: 5
control_method: dmg
container:
type: POSIX
Expand Down
14 changes: 4 additions & 10 deletions src/tests/ftest/ior/hard_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,28 @@ server_config:
log_file: daos_server1.log
log_mask: ERR
storage: auto
create_pool_max_size:
scm: true
percentage: 90
pool:
control_method: dmg
size: 90%
container:
type: POSIX
control_method: daos
properties: dedup:memcmp
ior:
api: "DFS"
client_processes:
np: 32
dfs_destroy: false
iorflags:
flags: "-C -k -e -w -g -G 27 -D 120 -Q 1 -vv"
read_flags: "-C -k -e -r -R -g -G 27 -D 120 -Q 1 -vv"
test_file: daos:testFile
segment_count: 2000000
repetitions: 1
chunk_block_transfer_sizes:
# [ChunkSize, BlocksSize, TransferSize]
- [47008, 47008, 47008]
objectclass:
dfs_oclass_list:
# - [EC_Object_Class, Minimum number of servers]
- ["EC_2P2G1", 6]
- ["EC_4P2G1", 8]
- ["EC_8P2G1", 12]
- ["EC_2P2GX", 6]
- ["EC_4P2GX", 8]
- ["EC_8P2GX", 12]
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"

0 comments on commit 2a1c453

Please sign in to comment.