Skip to content

os/bluestore: rebuild all pextents of a shared blob in fsck repair - #72812

Merged
aclamk merged 2 commits into
ceph:mainfrom
ming1:wip-81432-shared-blob-repair-pextents
Nov 3, 2026
Merged

aclamk merged 2 commits into
ceph:mainfrom
ming1:wip-81432-shared-blob-repair-pextents

Conversation

@ming1

@ming1 ming1 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

fsck repair rebuilds the ref_map of a broken shared blob, but takes only the first valid pextent of each blob. For a blob with more pextents the rewritten record misses the others. The same repair run then sees those extents as leaked and releases them although the head and the clone still use them, and removing the clone later aborts with "put on missing extent".

Reference every valid pextent, as fsck counts them. The unit test breaks the record of a two-pextent shared blob, repairs, checks the ref_map and fsck, and removes the clone and the head.

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

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)

@ming1
ming1 requested a review from a team as a code owner October 19, 2026 02:39
@ming1
ming1 requested a review from ifed01 October 19, 2026 02:41
@ming1 ming1 added the bug-fix label Oct 19, 2026
Comment thread src/os/bluestore/BlueStore.cc Outdated
if(it == refs_map.end()) {
return true;
}
// every valid pextent holds a reference, as counted by fsck

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.

Nit: cut ", as counted by fsck".
It is not fsck that determines that all extents are tracked in shared blobs, just agreed metadata structure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

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

Excellent catch!

Comment thread src/test/objectstore/store_test.cc Outdated
ghobject_t hoid2 = make_object("Object 2", pool);

bufferlist bl;
bl.append(string(block_size, 1));

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.

Very minor:
string(block_size, 1) is
basic_string( size_type count, CharT ch);
So the value 1 is a char. It is easy to mix, so its better to provide visual hint, like '\001', char(1) or switch to other character 'x'.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

This PR has been added to wip-jaya-bs-testing-10-27-2026.

ming1 added 2 commits October 29, 2026 04:30
_fsck_repair_shared_blobs() rebuilds the ref_map of a broken shared
blob, but only takes the first valid pextent of each blob. The rewritten
record misses the other extents, so the same repair run releases them as
leaked although objects still use them, and removing such an object
later aborts with "put on missing extent".

Reference every valid pextent, as fsck counts them.

Fixes: https://tracker.ceph.com/issues/81432
Signed-off-by: Ming Lei <[email protected]>
@ming1
ming1 force-pushed the wip-81432-shared-blob-repair-pextents branch from 20e60ae to fcb7a39 Compare October 29, 2026 09:33
@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

jenkins test make check

@aclamk
aclamk merged commit b5b3a26 into ceph:main Nov 3, 2026
16 checks passed
@github-actions

github-actions Bot commented Nov 3, 2026

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/41658353440

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.

3 participants