Repository navigation
os/bluestore: Revival no.2 of _deferred_replay fix - #69961
Merged
ifed01 merged 9 commits intoNov 3, 2026
Merged
Conversation
ifed01
reviewed
Jul 6, 2026
aclamk
force-pushed
the
wip-aclamk-more-deferred-overwrite-fix-redo
branch
from
July 7, 2026 08:41
3b9a42d to
0e9468d
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Signed-off-by: Adam Kupczyk <[email protected]>
Added debug hooks for: - init_alloc - deferred start/stop/operation This created framework for specific unit tests. These functions are as name suggests debug level, only for unittests. Signed-off-by: Adam Kupczyk <[email protected]>
Two possible cases of deferred write related corruption are replicated. 1. The case when L entries remain. 2. The case when deferred overwrites newly created BlueFS files Provides unittest for: https://tracker.ceph.com/issues/68060 Signed-off-by: Adam Kupczyk <[email protected]>
Modify _deferred_replay to execute it directly, without involving BlueStore state machine. In result, kv-sync thread is not necessary. RocksDB L entries (deferred writes) are removed directly. Fixes: https://tracker.ceph.com/issues/68060, part responsible for stale L entries. Signed-off-by: Adam Kupczyk <[email protected]>
Modify _deferred_replay to separate: - applying IO to the disk - DB transaction to remove keys Changed _open_db_and_around. It now calls _deferred_replay. Adapted callers, including fsck. Fixed: https://tracker.ceph.com/issues/68060, original report. Signed-off-by: Adam Kupczyk <[email protected]>
Add code to print times; this is for make check arm64. Signed-off-by: Adam Kupczyk <[email protected]>
Signed-off-by: Adam Kupczyk <[email protected]>
This fixes wierd key revalval after deletion. Signed-off-by: Adam Kupczyk <[email protected]>
aclamk
force-pushed
the
wip-aclamk-more-deferred-overwrite-fix-redo
branch
from
September 11, 2026 10:10
0e9468d to
3b489c0
Compare
ifed01
reviewed
Sep 14, 2026
| _post_init_alloc(); | ||
| } | ||
|
|
||
| if (remove_deferred && !keys_to_remove.empty()) { |
Contributor
There was a problem hiding this comment.
IMO check for remove_deferred is redundant here
| // This is the place where we can apply deferred writes | ||
| // without risk of some interaction with RocksDB allocating. | ||
| if (apply_deferred) { | ||
| _deferred_replay(remove_deferred ? &keys_to_remove : nullptr); |
Contributor
There was a problem hiding this comment.
One can collect keys_to_remove directly into DB transaction here. No need in intermediated vector.
| } | ||
| dout(1) << __func__ << " opened " << kv_backend | ||
| << " path " << kv_dir_fn << " options " << options << dendl; | ||
| KeyValueDB::Iterator it = db->get_iterator(PREFIX_DEFERRED); |
Contributor
There was a problem hiding this comment.
IMO all this enumerating/printing stuff worth putting under if (cct->_conf->subsys.should_gather<ceph_subsys_bluestore, 10>())
Contributor
Author
Also considered adding replaying deferred to fsck(read-only), but dropped it. |
Changes: - For mount_readonly perform replay of deferred writes, no L keys deletion. This is to make sure ceph-objectstore-tool pg-export returns proper object data. - mount_readonly() / umount_readonly() no longer init/close kv_sync_thread. - Simplify _open_db_and_around(). Two arguments apply_deferred, remove_deferred -> single replay_deferred. Signed-off-by: Adam Kupczyk <[email protected]>
aclamk
force-pushed
the
wip-aclamk-more-deferred-overwrite-fix-redo
branch
from
September 25, 2026 13:35
434c69b to
75f5654
Compare
dcasier
added a commit
to dcasier/ceph
that referenced
this pull request
Oct 24, 2026
_deferred_replay() drops the parts of a deferred transaction that overlap BlueFS (_eliminate_outdated_deferred). When all of them are dropped, the record's key stays in the DB and is evaluated again at every mount. Once BlueFS has released that space and BlueStore has allocated it to an object, the stale record is replayed over object data (bad crc32c, read_error on deep-scrub). Remove the keys of fully dropped records once the replay IO has drained. Their data is stale: BlueFS only takes free space. This is a fallback for PR ceph#69961, which replays deferred writes before the DB is opened read-write and makes this change unnecessary: revert it if that PR lands. Not covered: BlueFS allocations during the replay, and records left by earlier mounts. Refs: https://tracker.ceph.com/issues/68060 Refs: ceph#69961 Signed-off-by: David Casier <[email protected]> Assisted-by: Claude Code
dcasier
added a commit
to dcasier/ceph
that referenced
this pull request
Oct 24, 2026
_deferred_replay() drops the parts of a deferred transaction that overlap BlueFS (_eliminate_outdated_deferred). When all of them are dropped, the record's key stays in the DB and is evaluated again at every mount. Once BlueFS has released that space and BlueStore has allocated it to an object, the stale record is replayed over object data (bad crc32c, read_error on deep-scrub). Remove the keys of fully dropped records once the replay IO has drained. Their data is stale: BlueFS only takes free space. This is a fallback for PR ceph#69961, which replays deferred writes before the DB is opened read-write and makes this change unnecessary: revert it if that PR lands. Not covered: BlueFS allocations during the replay, and records left by earlier mounts. Fixes: https://tracker.ceph.com/issues/68060 Fixes: 2afb951 Signed-off-by: David Casier <[email protected]> Assisted-by: Claude Code
dcasier
added a commit
to dcasier/ceph
that referenced
this pull request
Oct 24, 2026
_deferred_replay() drops the parts of a deferred transaction that overlap BlueFS (_eliminate_outdated_deferred). When all of them are dropped, the record's key stays in the DB and is evaluated again at every mount. Once BlueFS has released that space and BlueStore has allocated it to an object, the stale record is replayed over object data (bad crc32c, read_error on deep-scrub). Remove the keys of fully dropped records once the replay IO has drained. Their data is stale: BlueFS only takes free space. Use rmkey(), not rm_single_key(): deferred_seq restarts at 0 on each start, so a key that survived earlier mounts may have been set again, and rm_single_key() is undefined on a key set more than once. This is a fallback for PR ceph#69961, which replays deferred writes before the DB is opened read-write and makes this change unnecessary: revert it if that PR lands. Not covered: BlueFS allocations during the replay, and records left by earlier mounts. Fixes: https://tracker.ceph.com/issues/68060 Fixes: 2afb951 Signed-off-by: David Casier <[email protected]> Assisted-by: Claude Code
4 of 14 tasks
5 of 14 tasks
Contributor
|
This PR has been added to wip-jaya-bs-testing-10-27-2026. |
ifed01
approved these changes
Nov 3, 2026
4 of 14 tasks
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a revival of #62412
The difference is that previously elusive problem with RocksDB data revival is now solved.
Fixes known problems with deferred write replay.
Based on unittest for deferred writes #60732
Fixes: https://tracker.ceph.com/issues/68060
Includes observation from https://tracker.ceph.com/issues/70581
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.