Skip to content
Open
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
34 changes: 11 additions & 23 deletions src/rdb/rdb_rpc.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2017-2023 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -351,24 +351,18 @@ rdb_recvd(void *arg)
static void
rdb_raft_rpc_cb(const struct crt_cb_info *cb_info)
{
struct rdb_raft_rpc *rrpc = cb_info->cci_arg;
struct rdb *db = rrpc->drc_db;
crt_opcode_t opc = opc_get(cb_info->cci_rpc->cr_opc);
d_rank_t dstrank;
int rc;

rc = crt_req_dst_rank_get(rrpc->drc_rpc, &dstrank);
D_ASSERTF(rc == 0, ""DF_RC"\n", DP_RC(rc));
struct rdb_raft_rpc *rrpc = cb_info->cci_arg;
struct rdb *db = rrpc->drc_db;
crt_opcode_t opc = opc_get(cb_info->cci_rpc->cr_opc);
int rc = cb_info->cci_rc;

rc = cb_info->cci_rc;
D_DEBUG(DB_MD, DF_DB": opc=%u rank=%u rtt=%f\n", DP_DB(db), opc,
dstrank, ABT_get_wtime() - rrpc->drc_sent);
D_DEBUG(DB_MD, DF_DB ": opc=%u rank=%u rtt=%f\n", DP_DB(db), opc,
rrpc->drc_rpc->cr_ep.ep_rank, ABT_get_wtime() - rrpc->drc_sent);
ABT_mutex_lock(db->d_mutex);
if (rc != 0 || db->d_stop) {
if (rc != -DER_CANCELED)
D_ERROR(DF_DB": RPC %x to rank %u failed: "DF_RC"\n",
DP_DB(rrpc->drc_db), opc,
dstrank, DP_RC(rc));
DL_INFO(rc, DF_DB ": RPC %x to rank %u failed", DP_DB(rrpc->drc_db), opc,
rrpc->drc_rpc->cr_ep.ep_rank);
/*
* Drop this RPC, assuming that raft will make a new one. If we
* are stopping, rdb_recvd() might have already stopped. Hence,
Expand Down Expand Up @@ -433,14 +427,8 @@ rdb_abort_raft_rpcs(struct rdb *db)
d_list_del_init(&rrpc->drc_entry);
rc = crt_req_abort(rrpc->drc_rpc);
if (rc != 0) {
d_rank_t dstrank;
int rc2;

rc2 = crt_req_dst_rank_get(rrpc->drc_rpc, &dstrank);
D_ASSERTF(rc2 == 0, ""DF_RC"\n", DP_RC(rc2));
D_ERROR(DF_DB": failed to abort %x to rank %u: "
""DF_RC"\n", DP_DB(rrpc->drc_db),
rrpc->drc_rpc->cr_opc, dstrank, DP_RC(rc));
DL_ERROR(rc, DF_DB ": failed to abort %x to rank %u", DP_DB(rrpc->drc_db),
rrpc->drc_rpc->cr_opc, rrpc->drc_rpc->cr_ep.ep_rank);
return rc;
}
}
Expand Down
Loading