Skip to content
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-16902 pool: Polish map change logging #15744

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions src/placement/tests/jump_map_place_obj.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -436,8 +437,9 @@ jtc_set_status_on_target(struct jm_test_ctx *ctx, const int status,
tgts.pti_ids = &tgt_id;
tgts.pti_number = 1;

int rc = ds_pool_map_tgts_update(ctx->po_map, &tgts, pool_opc_2map_opc(status),
false, &ctx->ver, ctx->enable_print_debug_msgs);
int rc = ds_pool_map_tgts_update(NULL /* pool_uuid */, ctx->po_map, &tgts,
pool_opc_2map_opc(status), false, &ctx->ver,
ctx->enable_print_debug_msgs);

/* Make sure pool map changed */
assert_success(rc);
Expand Down
22 changes: 13 additions & 9 deletions src/pool/srv_pool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -2113,11 +2114,11 @@ pool_svc_check_node_status(struct pool_svc *svc)
}

/*
* Log a NOTE of as well as print a message. Arguments may be evaluated more
* Log as well as print a message. Arguments may be evaluated more
* than once.
*/
#define DS_POOL_NOTE_PRINT(fmt, ...) do { \
D_NOTE(fmt, ## __VA_ARGS__); \
#define DS_POOL_LOG_PRINT(log, fmt, ...) do { \
D_##log(fmt, ## __VA_ARGS__); \
D_PRINT(fmt, ## __VA_ARGS__); \
} while (0)

Expand Down Expand Up @@ -2369,9 +2370,10 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
D_GOTO(out, rc);
}

DS_POOL_NOTE_PRINT(DF_UUID": rank %u became pool service leader "DF_U64": srv_pool_hdl="
DF_UUID" srv_cont_hdl="DF_UUID"\n", DP_UUID(svc->ps_uuid), rank,
svc->ps_rsvc.s_term, DP_UUID(pool_hdl_uuid), DP_UUID(cont_hdl_uuid));
DS_POOL_LOG_PRINT(NOTE, DF_UUID": rank %u became pool service leader "DF_U64
": srv_pool_hdl="DF_UUID" srv_cont_hdl="DF_UUID"\n",
DP_UUID(svc->ps_uuid), rank, svc->ps_rsvc.s_term, DP_UUID(pool_hdl_uuid),
DP_UUID(cont_hdl_uuid));
out:
if (rc != 0) {
if (events_initialized)
Expand Down Expand Up @@ -2404,8 +2406,8 @@ pool_svc_step_down_cb(struct ds_rsvc *rsvc)
sched_cancel_and_wait(&svc->ps_rfcheck_sched);
ds_cont_svc_step_down(svc->ps_cont_svc);

DS_POOL_NOTE_PRINT(DF_UUID": rank %u no longer pool service leader "DF_U64"\n",
DP_UUID(svc->ps_uuid), rank, svc->ps_rsvc.s_term);
DS_POOL_LOG_PRINT(NOTE, DF_UUID": rank %u no longer pool service leader "DF_U64"\n",
DP_UUID(svc->ps_uuid), rank, svc->ps_rsvc.s_term);
}

static void
Expand Down Expand Up @@ -6937,7 +6939,7 @@ pool_svc_update_map_internal(struct pool_svc *svc, unsigned int opc,
* before and after. If the version hasn't changed, we are done.
*/
map_version_before = pool_map_get_version(map);
rc = ds_pool_map_tgts_update(map, tgts, opc, exclude_rank, tgt_map_ver, true);
rc = ds_pool_map_tgts_update(svc->ps_uuid, map, tgts, opc, exclude_rank, tgt_map_ver, true);
if (rc != 0)
D_GOTO(out_map, rc);
map_version = pool_map_get_version(map);
Expand Down Expand Up @@ -7031,6 +7033,8 @@ pool_svc_update_map_internal(struct pool_svc *svc, unsigned int opc,
goto out_map_buf;
}

DS_POOL_LOG_PRINT(INFO, DF_UUID ": committed pool map: version=%u->%u map=%p\n",
DP_UUID(svc->ps_uuid), map_version_before, map_version, map);
updated = true;

/* Update svc->ps_pool to match the new pool map. */
Expand Down
Loading
Loading