Skip to content

common: Make buffer::list::rebuild_aligned_size_and_memory correctly handle zero-sized buffers - #69023

Merged
aainscow merged 1 commit into
ceph:mainfrom
aainscow:zero_bufferptr_rebuild
Aug 26, 2026
Merged

aainscow merged 1 commit into
ceph:mainfrom
aainscow:zero_bufferptr_rebuild

Conversation

@aainscow

@aainscow aainscow commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Prior to this fix, if there was a zero-sized bufferptr in a bufferlist, then rebuild_aligned_size_and_memory would not honour the max_buffers parameter.

This change causes rebuild_aligned_size_and_memory to drop any zero-sized buffer when doing the rebuild.

There is a recreate test, although this might be a little delicate, as it relies on a quirk of buffer::list::append to generate the zero length buffers.

Fixes: https://tracker.ceph.com/issues/76466

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@bill-scales bill-scales 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.

rebuild_aligned_size_and_memory certainly was not dealing with zero length buffers correctly, this appears to be the most likely (only?) reason why this function failed to create a single contiguous buffer when called with max_buffers = 1.

It doesn't really explain why we had a zero length buffer in the list, but as long as this is a very rare scenario perhaps we don't care, especially as this is in the legacy EC code.

@yuriw

yuriw commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri4-testing-20260603.222947-main.

@ljflores

Copy link
Copy Markdown
Member

Retesting this since the old results got stale and there is a new force-push. Apologies for the delay- it will be prioritized.

@ljflores

Copy link
Copy Markdown
Member

@ljflores

ljflores commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Adding DNM re: above comment, but @aainscow feel free to remove and merge if you deem the test failure unrelated. Otherwise, we can retest this if it requires more changes.

Also, appears there actually was a regression? https://tracker.ceph.com/issues/78658#note-1 cc @lee-j-sanders

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test classic perf

…handle zero-sized buffers

Prior to this fix, if there was a zero-sized bufferptr in a bufferlist, then
rebuild_aligned_size_and_memory would not honour the max_buffers parameter.

This change causes rebuild_aligned_size_and_memory to drop any zero-sized buffer when doing
the rebuild.

There is a recreate test, although this might be a little delicate, as it relies
on a quirk of buffer::list::append to generate the zero length buffers.

AI assistance used for creating test only.

Fixes: https://tracker.ceph.com/issues/76466

Signed-off-by: Alex Ainscow <[email protected]>
Assisted-by: IBM-Bob
@aainscow
aainscow force-pushed the zero_bufferptr_rebuild branch from b66073c to 845b447 Compare July 28, 2026 07:45
@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test classic perf

2 similar comments
@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test classic perf

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test classic perf

@lee-j-sanders

Copy link
Copy Markdown
Member

comparitive_performance_report_260729_053612.pdf

This performance comparison of 4k random writes and 1MB random writes with librbd on Replica-3 that there is not a performance regression introduced by this PR. The slight difference in 4k random writes is run to run variance and not a concern

@lee-j-sanders

Copy link
Copy Markdown
Member

jenkins test classic perf

@aainscow aainscow removed the DNM label Aug 25, 2026
@aainscow

Copy link
Copy Markdown
Contributor Author

I have removed DNM, because further performance test have shown that this does not have a real performance regression. A re-run showed the same thing.

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@aainscow

Copy link
Copy Markdown
Contributor Author

perf-test-classic failed here: https://github.com/ceph/ceph/pull/69023/checks?check_run_id=86374280601

@aainscow is it related to the changes?

@ljflores That failure looks like a test issue and is not related to my change.

@aainscow
aainscow merged commit f9b268c into ceph:main Aug 26, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/32943525799

@aainscow aainscow added no-backport-required Label that can be optionally added to show that we do not need to backport. backport-complete A backport was necessary, but all work has been completed. and removed backport-complete A backport was necessary, but all work has been completed. labels Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common no-backport-required Label that can be optionally added to show that we do not need to backport. performance TESTED tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants