-
Notifications
You must be signed in to change notification settings - Fork 308
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-17111 cart: Use only swim ctx for outage #15924
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
* (C) Copyright 2019-2024 Intel Corporation. | ||
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||
*/ | ||
|
@@ -376,6 +377,14 @@ crt_swim_lookup_id(swim_id_t id) | |
return grp_ver; | ||
} | ||
|
||
static void crt_swim_update_last_unpack_hlc(struct crt_swim_membs *csm, uint64_t hlc) | ||
{ | ||
crt_swim_csm_lock(csm); | ||
if (csm->csm_last_unpack_hlc < hlc) | ||
csm->csm_last_unpack_hlc = hlc; | ||
crt_swim_csm_unlock(csm); | ||
} | ||
|
||
static void crt_swim_srv_cb(crt_rpc_t *rpc) | ||
{ | ||
struct crt_rpc_priv *rpc_priv = container_of(rpc, struct crt_rpc_priv, crp_pub); | ||
|
@@ -396,6 +405,8 @@ static void crt_swim_srv_cb(crt_rpc_t *rpc) | |
|
||
D_ASSERT(crt_is_service()); | ||
|
||
crt_swim_update_last_unpack_hlc(csm, hlc); | ||
|
||
from_id = rpc_priv->crp_req_hdr.cch_src_rank; | ||
|
||
/* Initialize empty array in case of error in reply */ | ||
|
@@ -605,6 +616,14 @@ static void crt_swim_cli_cb(const struct crt_cb_info *cb_info) | |
if (to_id == ctx->sc_target) | ||
ctx->sc_deadline = 0; | ||
swim_ctx_unlock(ctx); | ||
} else { | ||
struct crt_swim_membs *csm = &grp_priv->gp_membs_swim; | ||
|
||
/* | ||
* Although some errors also suggest incoming messages, we keep | ||
* it simple for now. | ||
*/ | ||
crt_swim_update_last_unpack_hlc(csm, hlc); | ||
} | ||
|
||
reply_rc = cb_info->cci_rc ? cb_info->cci_rc : rpc_out->rc; | ||
|
@@ -987,24 +1006,6 @@ static void crt_swim_new_incarnation(struct swim_context *ctx, | |
state->sms_incarnation = incarnation; | ||
} | ||
|
||
static void crt_swim_update_last_unpack_hlc(struct crt_swim_membs *csm) | ||
{ | ||
struct crt_context *ctx = NULL; | ||
d_list_t *ctx_list; | ||
|
||
D_RWLOCK_RDLOCK(&crt_gdata.cg_rwlock); | ||
|
||
ctx_list = crt_provider_get_ctx_list(true, crt_gdata.cg_primary_prov); | ||
d_list_for_each_entry(ctx, ctx_list, cc_link) { | ||
uint64_t hlc = ctx->cc_last_unpack_hlc; | ||
|
||
if (csm->csm_last_unpack_hlc < hlc) | ||
csm->csm_last_unpack_hlc = hlc; | ||
} | ||
|
||
D_RWLOCK_UNLOCK(&crt_gdata.cg_rwlock); | ||
} | ||
|
||
static void | ||
crt_metrics_sample_delay(crt_context_t crt_ctx, uint64_t delay, bool glitch) | ||
{ | ||
|
@@ -1048,10 +1049,8 @@ static int64_t crt_swim_progress_cb(crt_context_t crt_ctx, int64_t timeout_us, v | |
} else if (rc == -DER_TIMEDOUT || rc == -DER_CANCELED) { | ||
uint64_t now = swim_now_ms(); | ||
|
||
crt_swim_update_last_unpack_hlc(csm); | ||
|
||
/* | ||
* Check for network idle in all contexts. | ||
* Check for network idle in swim context. | ||
* If the time passed from last received RPC till now is more | ||
* than 2/3 of suspicion timeout suspends eviction. | ||
* The max_delay should be less suspicion timeout to guarantee | ||
|
@@ -1064,7 +1063,7 @@ static int64_t crt_swim_progress_cb(crt_context_t crt_ctx, int64_t timeout_us, v | |
uint64_t max_delay = swim_suspect_timeout_get() * 2 / 3; | ||
|
||
if (delay > max_delay) { | ||
D_ERROR("Network outage detected (idle during " | ||
D_ERROR("SWIM network outage detected (idle during " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tend to think we should never update
Do you know what's the purpose of this check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know about Agreed on "should never update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I understand what it tracks, but I don't know why this is required, like why it is critical to have at least 2 alive members. In my local fix, I just removed this check and it fixes all the issues for me in my 3-node cluster. I tend to just remove it. |
||
"%lu.%lu sec > expected %lu.%lu sec).\n", | ||
delay / 1000, delay % 1000, | ||
max_delay / 1000, max_delay % 1000); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the current style does not have any real problem, I'd like to keep it as it is. Also, seems like the current style is more consistent with similar code in the rest of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just better code. After this PR https://github.com/daos-stack/daos/pull/15929/files is merged, I believe most of places will be fixed.