Skip to content

qa/tasks/mgr/dashboard: write non-zero data in test_copy - #72988

Merged
idryomov merged 1 commit into
ceph:mainfrom
djgalloway:wip-68544-test-copy-zero-pattern
Oct 26, 2026
Merged

idryomov merged 1 commit into
ceph:mainfrom
djgalloway:wip-68544-test-copy-zero-pattern

Conversation

@djgalloway

Copy link
Copy Markdown
Contributor

tasks.mgr.dashboard.test_rbd.RbdTest.test_copy fails intermittently in the dashboard API tests (tracker #68544, open since 2024-10; most recently on ceph-pr-pipeline 5952) with:

  File "/ceph/qa/tasks/mgr/dashboard/test_rbd.py", line 791, in test_copy
    self._validate_image(img_copy, ... disk_usage=img['disk_usage'])
AssertionError: 0 != 67108864

Cause: the test fills the source image with rbd bench --io-type write --io-total 5M, and rbd bench's default --pattern-byte rand fills its single write buffer with one byte, memset(bp.c_str(), rand() & 0xff, io_size) (src/tools/rbd/action/Bench.cc, seeded from time()). So in about 1 run of 256 every byte written is 0x00. The source still accounts the written objects (64 MiB), but librbd's copy skips all-zero extents (if (m_bl->is_zero()) ... return; in src/librbd/internal.cc), so the copy is correctly sparse and reports disk_usage 0.

This is not a timing race, so waiting for the copy's usage to converge (#68904, auto-closed unreviewed) would only turn the failure into a TestTimeoutError 30 s later.

Fix: --pattern-byte 1, so the data is never all zeros. The other rbd bench calls in test_rbd.py (test_disk_usage, the rollback test) only check the image they wrote to, which accounts zero-filled writes too, so they're unaffected.

Backports: --pattern-byte (13a5927) is on tentacle and umbrella, so this applies there as-is. squid doesn't have it and has the same 1-in-256 behaviour, so a squid backport would need another way to write non-zero data.

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)

@djgalloway

djgalloway commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@idryomov would you be an appropriate person to review this?

EDIT: The ceph dashboard tests have been failing for months. The Check's not red because of this PR.

test_copy writes 5M into an image with `rbd bench`, copies it, and
expects the copy's disk_usage to equal the source's.  It fails now and
then with

  AssertionError: 0 != 67108864

because rbd bench fills its single write buffer with one byte chosen by
rand() & 0xff (seeded from the clock), so in about 1 run of 256 every
byte written is 0x00.  The source image still accounts the written
objects, but librbd's copy skips all-zero extents, so the copy is
correctly sparse and reports a disk_usage of 0.  It is not a timing
race: waiting for the copy's usage to catch up (as tried in
ceph#68904) would only turn the failure
into a timeout.

Pass --pattern-byte 1 so the data written is never all zeros.

Fixes: https://tracker.ceph.com/issues/68544
Assisted-by: Claude Opus 5.5
Signed-off-by: David Galloway <[email protected]>
@djgalloway
djgalloway force-pushed the wip-68544-test-copy-zero-pattern branch from 0bbce81 to 5b64d8d Compare October 22, 2026 16:46
@djgalloway

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-project-automation github-project-automation Bot moved this from New to Reviewer approved in Ceph-Dashboard Oct 26, 2026
@idryomov
idryomov merged commit c4e5869 into ceph:main Oct 26, 2026
15 of 17 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Oct 26, 2026
@github-actions

Copy link
Copy Markdown

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

I found one or more Fixes: tags in the commit messages in

git log c4e5869ff4f5110cd9f0e1add16509105383dd51^..c4e5869ff4f5110cd9f0e1add16509105383dd51

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

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

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants