Skip to content

DAOS-19768 pool: fix debug logging of long pool rank lists (#19362) - #19457

Draft
kccain wants to merge 4 commits into
release/2.6from
kccain/daos_19768_rel2p6
Draft

kccain wants to merge 4 commits into
release/2.6from
kccain/daos_19768_rel2p6

Conversation

@kccain

@kccain kccain commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

The client debug helper pool_print_range_list() formatted a pool's
enabled/disabled rank ranges into a fixed 512-byte stack buffer and,
when that was too small, logged "snprintf failed" at ERR level. Pools
with many non-contiguous ranks (e.g., 204 rank ranges on a 1600-rank
system) hit this on every daos_pool_query() that returns ranks,
including "daos pool query -e" and the periodic space queries issued
by "daos pool autotest", so the error was printed to the terminal even
though the query itself succeeded and returned correct results.

Replace it with dc_pool_log_ranks(), which:

  • returns immediately unless DB_MD debug logging is enabled,
  • builds the string with d_rank_list_to_str() (dynamically sized), and
  • logs it in pieces of at most 512 bytes split after a ',', since
    d_vlog() silently truncates a log line at 1024 bytes.

The rank list is still logged for every query, including those whose
caller did not ask for ranks. The returned rank list is still sorted
unconditionally; that was previously a side effect of building the
debug log string.

Avoid calling qsort() with a NULL array for an empty rank list (e.g.,
the disabled ranks of a healthy pool), which is undefined behavior
reported by UBSan: d_rank_range_list_create_from_ranks() now sorts
only after its empty-list check, and the client skips sorting an
empty list.

Add pool_cli_tests, a cmocka unit test for dc_pool_log_ranks()
covering debug logging disabled, the 204-range rank list from the
original report, small and empty lists, chunk-size boundaries, and a
50000-range list.

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).

The client debug helper pool_print_range_list() formatted a pool's
enabled/disabled rank ranges into a fixed 512-byte stack buffer and,
when that was too small, logged "snprintf failed" at ERR level. Pools
with many non-contiguous ranks (e.g., 204 rank ranges on a 1600-rank
system) hit this on every daos_pool_query() that returns ranks,
including "daos pool query -e" and the periodic space queries issued
by "daos pool autotest", so the error was printed to the terminal even
though the query itself succeeded and returned correct results.

Replace it with dc_pool_log_ranks(), which:
- returns immediately unless DB_MD debug logging is enabled,
- builds the string with d_rank_list_to_str() (dynamically sized), and
- logs it in pieces of at most 512 bytes split after a ',', since
  d_vlog() silently truncates a log line at 1024 bytes.

The rank list is still logged for every query, including those whose
caller did not ask for ranks. The returned rank list is still sorted
unconditionally; that was previously a side effect of building the
debug log string.

Avoid calling qsort() with a NULL array for an empty rank list (e.g.,
the disabled ranks of a healthy pool), which is undefined behavior
reported by UBSan: d_rank_range_list_create_from_ranks() now sorts
only after its empty-list check, and the client skips sorting an
empty list.

Add pool_cli_tests, a cmocka unit test for dc_pool_log_ranks()
covering debug logging disabled, the 204-range rank list from the
original report, small and empty lists, chunk-size boundaries, and a
50000-range list.

Signed-off-by: Kenneth Cain <kenneth.cain@hpe.com>
in process_query_reply()

Signed-off-by: Kenneth Cain <kenneth.cain@hpe.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Ticket title is 'Aurora daos_user: daos pool query with large number of enabled rank option print extra error line "pool_print_range_list() 33af052a: snprintf failed, 4"'
Status is 'In Review'
Labels: 'ALCF,request_for_2.6.6,triaged'
Job should run at elevated priority (1)
https://daosio.atlassian.net/browse/DAOS-19768

@github-actions github-actions Bot added the priority Ticket has high priority (automatically managed) label Nov 5, 2026
@kccain kccain added unclean-cherry-pick Indicates that a cherry-pick had merge conflicts that needed resolving. and removed priority Ticket has high priority (automatically managed) labels Nov 5, 2026
Signed-off-by: Kenneth Cain <kenneth.cain@hpe.com>
@github-actions github-actions Bot added the priority Ticket has high priority (automatically managed) label Nov 5, 2026
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/3/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/3/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/3/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/3/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/4/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/4/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/4/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/4/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Signed-off-by: Kenneth Cain <kenneth.cain@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/5/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/5/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/5/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/5/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/6/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/6/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/6/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-19457/6/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority Ticket has high priority (automatically managed) unclean-cherry-pick Indicates that a cherry-pick had merge conflicts that needed resolving.

Development

Successfully merging this pull request may close these issues.

2 participants