Skip to content

umbrella: os/bluestore: Re-introduce truncation in BlueRocksWritableFile.Close() - #71925

Merged
batrick merged 3 commits into
ceph:umbrellafrom
tchaikov:wip-80493-umbrella
Oct 28, 2026
Merged

batrick merged 3 commits into
ceph:umbrellafrom
tchaikov:wip-80493-umbrella

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

viliam-durina and others added 3 commits September 20, 2026 12:53
`rocksdb::WritableFile` assumes that whatever was allocated using `Allocate()`, and was not actually written to, is released when the file is closed (cf. `PosixWritableFile::Close()`). This used to work up to PR ceph#62224 (released in 20.1.0, a tentacle RC), which removed the truncation from `close` and it assumed that `truncate` is called.

This PR adds the truncation back to `BlueRocksWritableFile::Close()`. We cannot bring back the exact pre-62224 code, as it relies on `h->pos`. Instead we flush the file and use `fnode.size`, which contains the on-disk size, including the envelope.

This should fix https://tracker.ceph.com/issues/76256.

I'm not sure why this issue excessively affected clusters with no sharding. From the logs attached to the issue, in the non-sharded case there are many files with only a few kB payload in a 70MB file; in the sharded case the unreleased file tails still exist, but are much smaller.

The new test case unit-tests the new `truncate_unused_allocations()` method, overall correctness of BlueFS operation is covered by other tests already. We also delete `BlueStoreWritableFile::UseDirectIO()`, as it is unused (it doesn't override superclass method).

Fixes: https://tracker.ceph.com/issues/76256
Signed-off-by: Viliam Durina <[email protected]>
(cherry picked from commit 88dca29)
Requested here: ceph#71479 (comment)

Signed-off-by: Viliam Durina <[email protected]>
(cherry picked from commit aa054f8)
@tchaikov
tchaikov requested a review from a team as a code owner September 20, 2026 04:53
@tchaikov tchaikov added this to the umbrella milestone Sep 20, 2026
@github-actions github-actions Bot added build/ops core tests releng-audit-pass Release engineering: passed backport verification audit. labels Sep 20, 2026
@tchaikov
tchaikov requested a review from aclamk September 20, 2026 05:24
@tchaikov

Copy link
Copy Markdown
Contributor Author

@aclamk hi Adam, could you help review this change?

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath27-testing-20260924.224940-umbrella.

@ronen-fr

Copy link
Copy Markdown
Contributor

@tchaikov

Copy link
Copy Markdown
Contributor Author

@batrick could you help review this change?

@batrick batrick modified the milestones: umbrella, v21.2.1 Oct 28, 2026
@batrick
batrick merged commit 047b342 into ceph:umbrella Oct 28, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bluestore build/ops core Rados-Tested releng-audit-pass Release engineering: passed backport verification audit. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants