Repository navigation
umbrella: os/bluestore: Re-introduce truncation in BlueRocksWritableFile.Close() - #71925
Merged
Merged
Conversation
`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)
Fixes: https://tracker.ceph.com/issues/80188 Signed-off-by: Igor Fedotov <[email protected]> (cherry picked from commit 481ebbd)
Contributor
Author
|
@aclamk hi Adam, could you help review this change? |
ifed01
approved these changes
Sep 20, 2026
Contributor
|
This PR has been added to wip-bharath27-testing-20260924.224940-umbrella. |
Contributor
Contributor
Author
|
@batrick could you help review this change? |
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.
backport tracker: https://tracker.ceph.com/issues/80493
backport of #71479
parent tracker: https://tracker.ceph.com/issues/76256
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh