Repository navigation
tentacle: os/bluestore: Re-introduce truncation in BlueRocksWritableFile.Close() - #71855
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
|
@yuriw hi Yuri, i believe this is an urgent blocker. as we have user suffering large amount of metadata in OSD. after upgrading to tentacle, one of their OSDs managed to generate 250GiB of metadata within 5 days. could you please include this patchset in your next batch? |
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-bharath19-testing-20260922.090258-tentacle. |
Contributor
Author
|
@batrick hi Patrick, could you review this backport? |
|
Hi Ceph folks - this is causing us some pain in a recently upgraded Reef to Tentacle cluster. We are running Is there any possibility this change would make the 20.2.5 milestone release? Thanks |
ProxBot
pushed a commit
to proxmox/ceph
that referenced
this pull request
Oct 13, 2026
BlueFS reserves space for each RocksDB file. Since 20.1.0, a tentacle RC, it does not free the reserved but unused part when the file is closed (PR #62224). That space stays in use until compaction deletes the file. For the user this means an OSD uses more space than its data needs. In bad cases a 70MB file holds only a few kB of data. Clusters without RocksDB sharding are affected most. If DB and block are on the same device, the free space of a pool goes up and down, while the stored data does not change (https://tracker.ceph.com/issues/76256). The fix is merged for main (ceph/ceph#71479), but its tentacle backport (ceph/ceph#71855) is still open, so no point release has it yet. Pick up its three commits (most recent last): * 8e68cb4b9bf0941fe3a2f20678844a0721de9904 * 21c357d88278eceb0beb9c69c837ad68517e2df4 * efe2e8d1bf0be327118da6e9e62f6132e6335c9e They are the fix, a small cleanup asked for in review, and a missing file lock in BlueFS::truncate() (https://tracker.ceph.com/issues/80188). They drop out on the next rebase. Signed-off-by: Kefu Chai <[email protected]> Link: https://lore.proxmox.com/[email protected]
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/80492
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