Skip to content

Commit

Permalink
Revert "DAOS-14969 container: retry IV might cause deadlock (#13632)"
Browse files Browse the repository at this point in the history
This reverts commit 1946ef3.

Conflicts:
  src/engine/server_iv.c

Required-githooks: true
  • Loading branch information
daltonbohning committed Apr 24, 2024
1 parent ddaf6ce commit f957c56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/cart/crt_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3509,8 +3509,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 || rc == -DER_BUSY,
DLOG_INFO, DLOG_ERR, rc, "ivo_on_update failed");
DL_CDEBUG(rc == -DER_NONEXIST || rc == -DER_NOTLEADER, 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: 1 addition & 9 deletions src/container/oid_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ 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 @@ -131,14 +130,7 @@ 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;
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;
ABT_mutex_lock(entry->lock);
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-2024 Intel Corporation.
* (C) Copyright 2017-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1067,7 +1067,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 || rc == -DER_BUSY)) {
(daos_rpc_retryable_rc(rc) || rc == -DER_NOTLEADER)) {
if (rc == -DER_GRPVER && engine_in_check()) {
/*
* Under check mode, the pool shard on peer rank/target does
Expand All @@ -1094,7 +1094,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_INFO("ns %u retry for class %d opc %d rank %u/%u: " DF_RC "\n", ns->iv_ns_id,
D_WARN("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

0 comments on commit f957c56

Please sign in to comment.