Skip to content

DAOS-19326 cart: bulk transfer issued from CORPC root handler fails - #18729

Open
frostedcmos wants to merge 7 commits into
masterfrom
frostedcmos/DAOS-19326
Open

DAOS-19326 cart: bulk transfer issued from CORPC root handler fails#18729
frostedcmos wants to merge 7 commits into
masterfrom
frostedcmos/DAOS-19326

Conversation

@frostedcmos

Copy link
Copy Markdown
Contributor
  • When sending CORPC to self the mercury handle and associated address are not available. Instead save self address in the cart context and use it when mercury handle is not available (sending to self)

  • Added test_corpc_bulks ftest to test inline corpc bulks as well as explicit bulk transfers from within corpc handlers.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

- When sending CORPC to self the mercury handle and associated address
are not available. Instead save self address in the cart context and use
it when mercury handle is not available (sending to self)

- Added test_corpc_bulks ftest to test inline corpc bulks as well as
explicit bulk transfers from within corpc handlers.

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
@frostedcmos
frostedcmos requested review from a team as code owners July 27, 2026 21:57
Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Ticket title is 'CART: bulk transfer issued from CORPC root handler fails/crashes'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-19326

@daosbuild3

Copy link
Copy Markdown
Collaborator

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
Comment thread src/cart/crt_hg.c
/* cache self address */
hg_ret = HG_Addr_self(hg_ctx->chc_hgcla, &hg_ctx->chc_self_addr);
if (hg_ret != HG_SUCCESS) {
hg_ctx->chc_self_addr = HG_ADDR_NULL;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it fails, the address should not have been touched so in theory there's no need to reset it...

Comment thread src/cart/crt_hg.c Outdated
crt_hg_pool_fini(hg_ctx);

/* Free the cached self address while the HG class is still valid */
if (hg_ctx->chc_self_addr != HG_ADDR_NULL && hg_ctx->chc_hgcla != NULL) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hg_ctx->chc_hgcla should always be non-null here no ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to assert

Comment thread src/cart/crt_hg.c
} else {
ctx_idx = ctx->cc_idx;
orig_addr = hg_ctx->chc_self_addr;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm a little scared here that you could fall into a case where it's neither a bind bulk transfer nor a corpc, in which case if for some reason the HG address is not set, you'd transparently use the self address without realizing it. To some extent it would be nice if there were a `else if (corpc == true) { use self address } else {error}. And I'm mostly saying that because the logic is within crt_hg itself which I think should really have nothing to do with corpcs in the first place...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added corpc checks

Comment thread src/tests/ftest/cart/test_corpc_bulks.c Outdated
#include <unistd.h>

#include <cart/api.h>
#include "crt_utils.h"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headers are still in the wrong order :)

assert(0);
}

#define error_exit() __error_exit(__LINE__, __func__);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there not macros already defined for that ? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didnt find one; we should do it in crtu_utils, but probably in separate pr

Comment thread src/tests/ftest/cart/test_corpc_bulks.c Outdated
static int
corpc_aggregate(crt_rpc_t *src, crt_rpc_t *result, void *priv)
{
return 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not doing anything ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

 - co_aggregate is now optional in corpcs
 - removed unneeded empty corpc_ops from tests
 - corpc checks added in bulk transfer when handle is null
 - naming cleanup

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
Comment thread src/cart/crt_corpc.c
memset(child_rpc_priv->crp_pub.cr_output, 0,
child_rpc_priv->crp_pub.cr_output_size);
} else {
D_ASSERT(co_ops->co_aggregate != NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Why change the co_aggregate assertions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in few tests, including an earlier version of this test, an empty co_ops with empty co_aggregate had to be declared just to work. all other co_* callbacks are optional; as such after talking with Jerome we decided to change this one as well and make it optional. The original ASSERT here is from 2017

Comment thread src/cart/crt_hg.c
Comment on lines +2284 to +2288
/* regular RPCs must have a valid handle */
if (!rpc_priv->crp_coll) {
RPC_ERROR(rpc_priv, "Unexpected crp_hg_hdl=NULL\n");
D_GOTO(out, rc = -DER_INVAL);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Not knowing the answer, I wonder if this should be an assertion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main intention here was to dump/log RPC_ERROR with a problematic 'rpc_priv' before failing, however an assert would be better here indeed instead of D_GOTO() with a failure that we cant recover from.

@daltonbohning daltonbohning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ftest LGTM

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-18729/6/testReport/

@frostedcmos

Copy link
Copy Markdown
Contributor Author

1 test pool/mem_ratio.py failed due to SSD error on hdr-102: https://daosio.atlassian.net/browse/DAOS-19271

@frostedcmos
frostedcmos requested review from liw and soumagne July 31, 2026 17:22
@frostedcmos frostedcmos added the forced-landing The PR has known failures or has intentionally reduced testing, but should still be landed. label Jul 31, 2026
Comment thread src/cart/crt_corpc.c
if (co_info->co_rc == 0)
co_info->co_rc = rc;

if (co_ops && co_ops->co_aggregate) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor but since it's a d_list_for_each loop, you could have done:

if (!co_ops || !co_ops->co_aggregate)
    continue;

Comment thread src/cart/crt_corpc.c
child_req->cr_opc, DP_RC(rc));
if (co_info->co_rc == 0)
co_info->co_rc = rc;
if (co_ops && co_ops->co_aggregate) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here could have combined else and else if :) to save on braces...

Comment thread src/cart/crt_hg.c Outdated
D_ERROR("HG_Bulk_(bind)transfer failed, hg_ret: " DF_HG_RC "\n",
DP_HG_RC(hg_ret));
D_FREE(bulk_cbinfo);
D_FREE(bulk_desc_dup);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if I'm not reading correctly but it seems that the D_FREE here do not apply to the previous HG_Bulk_bind_transfer if it fails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks. fixed

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forced-landing The PR has known failures or has intentionally reduced testing, but should still be landed.

Development

Successfully merging this pull request may close these issues.

6 participants