Skip to content

squid: os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock - #71592

Open
ifed01 wants to merge 5 commits into
ceph:squidfrom
ifed01:wip-79068-bluefs-extend-log-seq-race-squi
Open

ifed01 wants to merge 5 commits into
ceph:squidfrom
ifed01:wip-79068-bluefs-extend-log-seq-race-squi

Conversation

@ifed01

@ifed01 ifed01 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Parent tracker: https://tracker.ceph.com/issues/79068
Backport tracker: https://tracker.ceph.com/issues/79833
Backports: 09fd806 This is an additional commit backport which originally lacks proper ticket but still worth having in squid. Plus not having it causes a backporting conflict . Hence bringing it in here.
Backports: #70892

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.

@ifed01
ifed01 requested review from aclamk and ming1 September 7, 2026 15:56
@ifed01
ifed01 requested a review from a team as a code owner September 7, 2026 15:56
@github-actions github-actions Bot added this to the squid milestone Sep 7, 2026
@ifed01 ifed01 changed the title Wip 79068 bluefs extend log seq race squi squis: os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock Sep 7, 2026
@ifed01 ifed01 changed the title squis: os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock squid: os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock Sep 7, 2026
github-actions[bot]

This comment was marked as outdated.

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

ifed01 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@ming1

ming1 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

a5f86cd7's conflict note says "trivial, extra empty line", but the resolution also turned four context lines into additions — the dirty.pending_release clearing loop in umount(). That's the payload of 09fd806 ("os/bluestore/bluefs: Clear pending releases", Adam Kupczyk), which is in main/tentacle but not squid, so it lands here with no tracker and with its author's sign-off dropped. It looks like a genuine fix, so probably worth cherry-picking as its own commit rather than dropping the hunk. (Tentacle #71593 is content-identical to #70892 with a clean audit, consistent with this being squid-only.)

Both CI failures look environmental, same missing boost 1.82 in the build container — make check: file STRINGS file "/opt/ceph/include/boost/version.hpp" cannot be read → Could NOT find Boost: Found unsuitable version "0.0.0"; API tests: ceph-conf: error while loading shared libraries: libboost_thread.so.1.82.0 failing vstart in the dashboard suite.

@ming1 ming1 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.

I'd suggest to pull commit 09fd806 ("os/bluestore/bluefs: Clear pending releases", Adam Kupczyk) in as prep-commit, so that conflict can be avoided.

@ifed01
ifed01 force-pushed the wip-79068-bluefs-extend-log-seq-race-squi branch from c9eb0c5 to a35c80d Compare September 11, 2026 16:58
@ifed01

ifed01 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

I'd suggest to pull commit 09fd806 ("os/bluestore/bluefs: Clear pending releases", Adam Kupczyk) in as prep-commit, so that conflict can be avoided.

Yeah, makes sense indeed. Thanks for pointing out!

@ifed01

ifed01 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@ifed01

ifed01 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath26-testing-20260924.011509-squid.

@Naveenaidu

Copy link
Copy Markdown
Contributor

@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Oct 20, 2026
@github-actions github-actions Bot removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-fail Release engineering: failed backport verification audit. labels Oct 20, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 20, 2026
@batrick

batrick commented Oct 27, 2026

Copy link
Copy Markdown
Member
image

??

aclamk and others added 2 commits November 9, 2026 16:00
If we happen to shutdown with dirty.pending_releases, after mount
we will most likely want to free them. And its an error - they will
already be free.

Signed-off-by: Adam Kupczyk <[email protected]>
(cherry picked from commit 09fd806)
…irty.lock

_extend_log() bumps dirty.seq_live after _flush_and_sync_log_LD() has
already released dirty.lock. A file that a concurrent
_signal_dirty_to_log_D() registers under the pre-bump seq_live is
stranded: _consume_dirty() does an exact find(seq) and never visits
that bucket, and _clear_dirty_set_stable_D() later erases it while
marking the file clean. The file's op_file_update_inc never reaches
the journal even though fsync() returned success; after a restart,
replay reconstructs a stale fnode and RocksDB reports 'Corruption:
file is too short ... to be an sstable'.

Introduced by e97aa85 ("os/bluestore: fix bluefs log runway
enospc"), first released in v19.0.0; Reef is unaffected.

Fix by keeping all seq_live updates under dirty.lock:

- split _maybe_extend_log() into _need_extend_log() and _extend_log();
- _flush_and_sync_log_LD() reserves a dedicated seq for the extension
  transaction atomically with its own seq advance, so no fsync can
  ever register a file under it; _extend_log() only steps log.t.seq;
- the async-compaction site no longer extends the log itself; if the
  runway is short it flushes the log first, which extends it as a
  side effect.

Fixes: https://tracker.ceph.com/issues/79068
Signed-off-by: Ming Lei <[email protected]>
(cherry picked from commit 2499b4a)
ming1 and others added 3 commits November 9, 2026 16:00
_extend_log() waits out log_forbidden_to_expand after its caller has
already advanced/reserved log seqs. The wait releases log.lock, so a
concurrent flusher can enter and trip the log.t.seq == log.seq_live
assert in _log_advance_seq(); without that assert it would flush the
shared log.t under later seqs and the parked seqs would be appended
out of order, which replay silently treats as end-of-log.

Restore the wait-before-reservation design of 08cf6d0
("os/bluestore/bluefs: Split single bluefs lock into multiple smaller
locks"): _flush_and_sync_log_LD() composes log.t first and, only when
the transaction needs to extend the log while expansion is forbidden,
parks on log_cond with no seq reserved, re-evaluating from scratch on
wakeup - re-consuming is safe because already-consumed files re-encode
as empty deltas. _extend_log()'s wait becomes an assert: the flag is
only set under log.lock, which the caller now holds from the check
onward. Flushers that fit the runway never wait, so flush vs async
compaction concurrency is unchanged.

_flush_and_sync_log_LD() now holds log.lock through a single
unique_lock: the wait uses the predicate form of
condition_variable::wait(), and the early return and the post-flush
release fall out of RAII instead of explicit unlock calls.

Fixes: e97aa85 ("os/bluestore: fix bluefs log runway enospc")
Signed-off-by: Ming Lei <[email protected]>
(cherry picked from commit adf1141)
Signed-off-by: Igor Fedotov <[email protected]>
(cherry picked from commit aa95664)
@ifed01
ifed01 force-pushed the wip-79068-bluefs-extend-log-seq-race-squi branch from a35c80d to 0d14d50 Compare November 9, 2026 13:15
@ifed01 ifed01 removed the releng-audit-fail Release engineering: failed backport verification audit. label Nov 9, 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:

  • Orphaned Main PR: Could not find a Redmine tracker for main PR #62224. Please create a ticket, set its 'Pull Request ID', populate the 'Backport' field, and ensure it is in the 'Pending Backport' state.

Automated Backport Parity Review

⚠️ Multiple Original PRs Detected: PR #62224, PR #70892

Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.


Commit Parity Visualizer

BACKPORT PR #71592 SOURCE PR SOURCE STATUS
<<<< MISSING IN BACKPORT >>>> PR #62224 18968bc os/bluestore: Introduce custom format of BlueFS file - WAL
<<<< MISSING IN BACKPORT >>>> 90bf207 os/bluestore: test bluefs wal v2
<<<< MISSING IN BACKPORT >>>> 35c1d4a buffer.h: Add empty constructor to contigous_filler
<<<< MISSING IN BACKPORT >>>> d1703dc os/bluestore: Refactor of WAL-v2 BlueFS
<<<< MISSING IN BACKPORT >>>> 167bba6 include/encoding.h: Remove unused FILLER macros
<<<< MISSING IN BACKPORT >>>> 8cdf4fb os/bluestore: Get rid of unused FileReader's "random"
<<<< MISSING IN BACKPORT >>>> db452e6 test/unittest_bluefs: Bunch of tests for wal_v2
595e18a os/bluestore/bluefs: Clear pending releases 09fd806 os/bluestore/bluefs: Clear pending releases
<<<< MISSING IN BACKPORT >>>> f6ef7b5 test/objectstore: Fix unittest for truncation
<<<< MISSING IN BACKPORT >>>> f0b0526 os/bluestore: bluestore tool downgrade-wal-to-v1 command
<<<< MISSING IN BACKPORT >>>> 7265bde os/bluestore: document downgrade-wal-to-v1
<<<< MISSING IN BACKPORT >>>> 4fb2e03 os/bluestore: Simplify downgrade-wal-to-v1
<<<< MISSING IN BACKPORT >>>> 24ec5c7 os/bluestore: Make wal_v2 selection more robust
<<<< MISSING IN BACKPORT >>>> c065abc test/bluefs: Disable check_wal_v2 feature on jenkins
<<<< MISSING IN BACKPORT >>>> 613ff6c os/bluestore: Generalize WAL_v2 => envelope_mode
<<<< MISSING IN BACKPORT >>>> 7631716 tests/objectstore/bluefs_tests: Adapted to transition "WALv2"=>envelope_mode
<<<< MISSING IN BACKPORT >>>> 11f9a67 common/denc.h: Introduce DENC_START_UNCHECKED
<<<< MISSING IN BACKPORT >>>> 014528d os/bluestore: Rename downgrade_wal_to_v1 => revert_wal_to_plain
9c6a1f7 os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock PR #70892 2499b4a os/bluestore/BlueFS: reserve the log-extension seq before releasing dirty.lock
ac32152 os/bluestore: wait out log compaction before reserving BlueFS log seqs adf1141 os/bluestore: wait out log compaction before reserving BlueFS log seqs
bc89aaa os/bluestore: cleanup bluefs_transaction_t data member manipulations e8914db os/bluestore: cleanup bluefs_transaction_t data member manipulations
0d14d50 os/bluestore: cleanup around BlueFS log sequence manipulation aa95664 os/bluestore: cleanup around BlueFS log sequence manipulation

🛟 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 Nov 9, 2026
@ifed01

ifed01 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author
image ??

Yeah, this missed commit from PR #70892 is wrong indeed. Should be fine now.
Other missing #62224 commits are expected as we don't want WALv2 feature backport but simple pending releases fix only.

@batrick batrick modified the milestones: squid, v19.2.8 Nov 9, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ Audit Override Applied by @batrick.

View workflow run

@aclamk aclamk 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.

Looks good, but its big. Needs testing.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants