Skip to content

tentacle: bluefs: assert in append_try_flush aborts OSDs on 16K page-size hosts - #72073

Open
ming1 wants to merge 2 commits into
ceph:tentaclefrom
ming1:wip-80554-tentacle
Open

ming1 wants to merge 2 commits into
ceph:tentaclefrom
ming1:wip-80554-tentacle

Conversation

@ming1

@ming1 ming1 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Backport tracker: https://tracker.ceph.com/issues/80554


backport of #71004
parent tracker: https://tracker.ceph.com/issues/79141

On hosts whose VM page size exceeds the BlueFS block size (16K Apple Silicon,
64K aarch64 kernels), OSDs with WAL v2 envelope mode enabled (the default)
abort at startup:

FAILED ceph_assert(p2aligned(pos1 ^ pos2, ceph::_page_size))

The regression shipped in v20.2.3, so tentacle needs the fix.

Backport notes

Both commits cherry-picked with -x, no conflicts. The only context drift is
that tentacle's FileWriter takes super_block_size as a constructor
parameter rather than storing it as a member; the fix hunk is semantically
identical.

Tested on this branch (RelWithDebInfo, x86_64):

  • ceph_test_bluefs --gtest_filter='*16k_page_size*': 2/2 pass
  • full ceph_test_bluefs: 47/47 pass
  • with the fix commit reverted, the new tests abort on the assert above

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)

The envelope-header assert in append_try_flush() requires the memory
address of a new header to mirror its file position modulo
CEPH_PAGE_SIZE. CEPH_PAGE_SIZE is the host VM page size resolved at
runtime, but the write path only keeps the two positions congruent at
the smaller of the page size and the BlueFS block size: envelope
flushes pad the on-disk stream to super.block_size, while fresh
appender chunks are page-aligned allocations.

On hosts whose page size exceeds the BlueFS block size (16K Apple
Silicon, 64K aarch64 kernels) a block-aligned WAL position is usually
not page-aligned, so the assert fires on ordinary RocksDB WAL writes
and every OSD aborts at startup. Direct I/O only requires block-size
memory alignment (see KernelDevice's
rebuild_aligned_size_and_memory), so assert the congruence the code
actually maintains: modulo min(CEPH_PAGE_SIZE, super.block_size).

Also round up instead of truncating in the FileWriter appender sizing:
with bluefs_alloc_size at or below the page size (e.g. 4K alloc on a
16K-page host) min_pages integer-truncated to 0, making refill()
allocate nothing so append_hole() fell back to an unaligned buffer -
the assert would then fire even at block-size granularity.

Introduced by 4c03bbe ("os/bluestore/bluefs: Add assert if write
buffer is not page aligned"); first released in v20.2.3.

Fixes: https://tracker.ceph.com/issues/79141
Signed-off-by: Ming Lei <[email protected]>
(cherry picked from commit 0479d49)
Override ceph::_page_size (plus mask/shift) to simulate a host whose
VM page size exceeds the BlueFS block size, then run the envelope-mode
small-writes workload; a second case repeats it with bluefs_alloc_size
below the simulated page size to cover the appender min_pages
truncation. Before the previous commit both cases reproduced,
deterministically and on any architecture, the startup abort from
https://tracker.ceph.com/issues/79141:

  BlueFS.cc: FAILED ceph_assert(p2aligned(pos1 ^ pos2, ceph::_page_size))

Related-to: https://tracker.ceph.com/issues/79141
Signed-off-by: Ming Lei <[email protected]>
(cherry picked from commit c653476)
@ming1
ming1 requested a review from a team as a code owner September 25, 2026 00:02
@github-actions github-actions Bot added this to the tentacle milestone Sep 25, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ceph Release Engineering Audit Report

Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Missing PR Link: Backport tracker #80554 has no 'Pull Request ID' field set. Please link it to PR #72073.

Commit Parity Visualizer

BACKPORT PR #72073 SOURCE PR SOURCE STATUS
d80bcff os/bluestore/BlueFS: fix envelope header alignment for non-4K page hosts PR #71004 0479d49 os/bluestore/BlueFS: fix envelope header alignment for non-4K page hosts
d83146e test/bluefs: exercise wal v2 envelope mode under a 16K page size c653476 test/bluefs: exercise wal v2 envelope mode under a 16K page size

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 25, 2026
@ming1

ming1 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ifed01

Can you help to set 'pull requset ID' in https://tracker.ceph.com/issues/80554 for moving on?

Thanks,

OriginCode added a commit to pve-loong64-port/ceph that referenced this pull request Nov 3, 2026
@MaartenUreel

Copy link
Copy Markdown

Any progress on this PR?

@ming1

ming1 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Cc @ifed01

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath31-testing-20261114.234838-tentacle.

@ronen-fr

Copy link
Copy Markdown
Contributor

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

Labels

bluestore core needs-qa releng-audit-fail Release engineering: failed backport verification audit. tests wip-bharath31-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants