Skip to content

tentacle: os/bluestore: Re-introduce truncation in BlueRocksWritableFile.Close() - #71855

Merged
batrick merged 3 commits into
ceph:tentaclefrom
tchaikov:wip-80492-tentacle
Sep 30, 2026
Merged

batrick merged 3 commits into
ceph:tentaclefrom
tchaikov:wip-80492-tentacle

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

viliam-durina and others added 3 commits September 17, 2026 14:33
`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 17, 2026 06:33
@tchaikov tchaikov added this to the tentacle milestone Sep 17, 2026
@github-actions github-actions Bot added build/ops core tests releng-audit-pass Release engineering: passed backport verification audit. labels Sep 17, 2026
@tchaikov

Copy link
Copy Markdown
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?

@tchaikov
tchaikov requested a review from aclamk September 20, 2026 04:48
@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-bharath19-testing-20260922.090258-tentacle.

@NitzanMordhai

Copy link
Copy Markdown
Contributor

@tchaikov
tchaikov requested a review from batrick September 28, 2026 00:45
@tchaikov

Copy link
Copy Markdown
Contributor Author

@batrick hi Patrick, could you review this backport?

@gr-as

gr-as commented Sep 28, 2026

Copy link
Copy Markdown

Hi Ceph folks - this is causing us some pain in a recently upgraded Reef to Tentacle cluster.

We are running 20.2.4-1jammy on Ubuntu 22.04, kernel 5.15.0-177-generic

Is there any possibility this change would make the 20.2.5 milestone release?

Thanks

@batrick batrick modified the milestones: tentacle, v20.2.5 Sep 30, 2026
@batrick
batrick merged commit 5a9537e into ceph:tentacle Sep 30, 2026
21 checks passed
@tchaikov
tchaikov deleted the wip-80492-tentacle branch September 30, 2026 13:10
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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants