-
Notifications
You must be signed in to change notification settings - Fork 306
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
base: master
Are you sure you want to change the base?
Conversation
No logic changes; just adding pool UUID and pool map address to pool map change logging, and logging important messages to both stdout and log. Signed-off-by: Li Wei <[email protected]> Required-githooks: true
Ticket title is 'LRZ: rebuild of pool is hanging' |
Since the CI run has taken 3 days and is still in progress, I'm prematurely marking this PR as ready for review. |
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.
LGTM
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.
Hope I haven't overthought this patch with some of the suggestions that are independent potential fixes for existing log messages (as opposed to the intent of this patch to provide pool UUID / map pointer context to messages).
src/pool/srv_pool_map.c
Outdated
return -DER_BUSY; | ||
case PO_COMP_ST_UPIN: | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to DRAIN %p\n", | ||
DP_TARGET(target), map); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DRAIN %p\n", |
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.
map is now printed twice in this format string (DF_MAP and final %p that perhaps can be removed?)
And no change requested for this: at first I started to think this D_DEBUG call (and similar instances) could be removed, since the subsequent D_PRINT() and D_INFO() cover the logging needed. But DP_TARGET() logged before and after the target changes will show the status and failure sequence transitions.
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.
Removed %p
at the end of the message.
Since I did not design this code, I'll leave the potential removal of this D_DEBUG
to you and @liuxuezhao.
src/pool/srv_pool_map.c
Outdated
@@ -101,29 +106,28 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DRAIN: | |||
case PO_COMP_ST_DOWNOUT: | |||
/* Nothing to do, already excluded / draining */ | |||
D_INFO("Skip drain down target (rank %u idx %u)\n", | |||
target->ta_comp.co_rank, | |||
D_INFO(DF_MAP ": Skip drain down target (rank %u idx %u)\n", |
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.
no change requested (unless it is obvious) - I'm assuming DF_TARGET/DP_TARGET are somehow not appropriate to use in this particular state change?
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.
I don't see any reason; changed to DF_TARGET
.
src/pool/srv_pool_map.c
Outdated
return -DER_BUSY; | ||
case PO_COMP_ST_DOWN: | ||
target->ta_comp.co_flags |= PO_COMPF_DOWN2UP; | ||
case PO_COMP_ST_DOWNOUT: | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to UP %p\n", | ||
DP_TARGET(target), map); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to UP %p\n", |
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.
redundant printing of map pointer value in the format?
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.
Removed the %p
at the end of the message.
src/pool/srv_pool_map.c
Outdated
@@ -213,12 +217,13 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_NEW: | |||
case PO_COMP_ST_UP: | |||
/* Nothing to do, already UPIN */ | |||
D_INFO("Skip ADD_IN UPIN "DF_TARGET"\n", | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), |
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.
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), | |
D_INFO(DF_MAP ": Skip EXCLUDE_OUT " DF_TARGET "\n", DP_MAP(pool_uuid, map), |
and maybe the comment above meant to say already downout
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
@@ -229,16 +234,17 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DOWNOUT: | |||
case PO_COMP_ST_NEW: | |||
/* Nothing to do, already UPIN */ | |||
D_INFO("Skip ADD_IN UPIN "DF_TARGET"\n", | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), |
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.
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), | |
D_INFO(DF_MAP ": Skip FINISH_REBUILD DF_TARGET "\n", DP_MAP(pool_uuid, map), |
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
@@ -250,8 +256,8 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DOWN: | |||
case PO_COMP_ST_NEW: | |||
/* Nothing to do, already UPIN and DOWNOUT. DOWN can not be revert. */ | |||
D_INFO("Skip ADD_IN UPIN DOWN "DF_TARGET"\n", | |||
DP_TARGET(target)); | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN DOWN " DF_TARGET "\n", |
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.
D_INFO(DF_MAP ": Skip ADD_IN UPIN DOWN " DF_TARGET "\n", | |
D_INFO(DF_MAP ": Skip REVERT_REBUILD UPIN DOWN " DF_TARGET "\n", |
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
target->ta_comp.co_status = PO_COMP_ST_NEW; | ||
target->ta_comp.co_in_ver = 0; | ||
++(*version); | ||
} else { | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to DOWNOUT %p fseq %u\n", | ||
DP_TARGET(target), map, target->ta_comp.co_fseq); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DOWNOUT fseq %u\n", |
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.
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DOWNOUT fseq %u\n", | |
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DOWN or DOWNOUT fseq %u\n", |
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.
Changed this to two messages, one for each if
branch. Please check.
src/pool/srv_pool_map.c
Outdated
D_PRINT(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
else | ||
D_INFO(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
D_PRINT(DF_MAP ": " DF_TARGET " is excluded.\n", |
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.
This one is more difficult for me to interpret quickly, and then I suppose get the log message perfectly accurate ("excluded" not always the case?). It seems the state may have changed to NEW, DOWN, or DOWNOUT. Maybe not worth perfecting it right now (if my understanding is accurate to begin with).
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.
Changed to "reverted". Please double check.
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.
That seems good, though I think the change will be needed also in the D_PRINT() in addition to the D_INFO() call.
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.
Oops, sorry.
src/pool/srv_pool_map.c
Outdated
return -DER_NONEXIST; | ||
} | ||
|
||
rc = update_one_tgt(map, target, opc, &version, print_changes); | ||
rc = update_one_tgt(pool_uuid, map, target, opc, &version, print_changes); | ||
if (rc < 0) | ||
return rc; | ||
|
||
/* if the target status does not need to change */ |
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.
not sure but maybe the comment is intended to say this?
/* if the target status does not need to change */ | |
/* if the rank status does not need to change */ |
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.
Changed to "rank".
Required-githooks: true
Signed-off-by: Li Wei <[email protected]> Required-githooks: true
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.
@kccain, thanks.
src/pool/srv_pool_map.c
Outdated
@@ -101,29 +106,28 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DRAIN: | |||
case PO_COMP_ST_DOWNOUT: | |||
/* Nothing to do, already excluded / draining */ | |||
D_INFO("Skip drain down target (rank %u idx %u)\n", | |||
target->ta_comp.co_rank, | |||
D_INFO(DF_MAP ": Skip drain down target (rank %u idx %u)\n", |
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.
I don't see any reason; changed to DF_TARGET
.
src/pool/srv_pool_map.c
Outdated
return -DER_BUSY; | ||
case PO_COMP_ST_UPIN: | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to DRAIN %p\n", | ||
DP_TARGET(target), map); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DRAIN %p\n", |
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.
Removed %p
at the end of the message.
Since I did not design this code, I'll leave the potential removal of this D_DEBUG
to you and @liuxuezhao.
src/pool/srv_pool_map.c
Outdated
return -DER_BUSY; | ||
case PO_COMP_ST_DOWN: | ||
target->ta_comp.co_flags |= PO_COMPF_DOWN2UP; | ||
case PO_COMP_ST_DOWNOUT: | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to UP %p\n", | ||
DP_TARGET(target), map); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to UP %p\n", |
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.
Removed the %p
at the end of the message.
src/pool/srv_pool_map.c
Outdated
@@ -213,12 +217,13 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_NEW: | |||
case PO_COMP_ST_UP: | |||
/* Nothing to do, already UPIN */ | |||
D_INFO("Skip ADD_IN UPIN "DF_TARGET"\n", | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), |
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
@@ -229,16 +234,17 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DOWNOUT: | |||
case PO_COMP_ST_NEW: | |||
/* Nothing to do, already UPIN */ | |||
D_INFO("Skip ADD_IN UPIN "DF_TARGET"\n", | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN " DF_TARGET "\n", DP_MAP(pool_uuid, map), |
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
@@ -250,8 +256,8 @@ update_one_tgt(struct pool_map *map, struct pool_target *target, | |||
case PO_COMP_ST_DOWN: | |||
case PO_COMP_ST_NEW: | |||
/* Nothing to do, already UPIN and DOWNOUT. DOWN can not be revert. */ | |||
D_INFO("Skip ADD_IN UPIN DOWN "DF_TARGET"\n", | |||
DP_TARGET(target)); | |||
D_INFO(DF_MAP ": Skip ADD_IN UPIN DOWN " DF_TARGET "\n", |
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.
Changed to reflect the case
s better. Please double check.
src/pool/srv_pool_map.c
Outdated
target->ta_comp.co_status = PO_COMP_ST_NEW; | ||
target->ta_comp.co_in_ver = 0; | ||
++(*version); | ||
} else { | ||
D_DEBUG(DB_MD, "change "DF_TARGET" to DOWNOUT %p fseq %u\n", | ||
DP_TARGET(target), map, target->ta_comp.co_fseq); | ||
D_DEBUG(DB_MD, DF_MAP ": change " DF_TARGET " to DOWNOUT fseq %u\n", |
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.
Changed this to two messages, one for each if
branch. Please check.
src/pool/srv_pool_map.c
Outdated
D_PRINT(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
else | ||
D_INFO(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
D_PRINT(DF_MAP ": " DF_TARGET " is excluded.\n", |
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.
Changed to "reverted". Please double check.
src/pool/srv_pool_map.c
Outdated
return -DER_NONEXIST; | ||
} | ||
|
||
rc = update_one_tgt(map, target, opc, &version, print_changes); | ||
rc = update_one_tgt(pool_uuid, map, target, opc, &version, print_changes); | ||
if (rc < 0) | ||
return rc; | ||
|
||
/* if the target status does not need to change */ |
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.
Changed to "rank".
src/pool/srv_pool_map.c
Outdated
D_PRINT(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
else | ||
D_INFO(DF_TARGET" is excluded.\n", DP_TARGET(target)); | ||
D_PRINT(DF_MAP ": " DF_TARGET " is excluded.\n", |
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.
That seems good, though I think the change will be needed also in the D_PRINT() in addition to the D_INFO() call.
Signed-off-by: Li Wei <[email protected]> Required-githooks: true
Allow-unstable-test: true Required-githooks: true
Merged master to add |
Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15744/4/testReport/ [liw] Unrelated Valgrind errors in command |
@daos-stack/daos-gatekeeper, please note that the latest build has been tested with |
No logic changes; just adding pool UUID and pool map address to pool map change logging, and logging important messages to both stdout and log.
Before requesting gatekeeper:
Features:
(orTest-tag*
) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.Gatekeeper: