Repository navigation
os/bluestore: Re-introduce truncation in BlueRocksWritableFile.Close() - #71479
Conversation
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
Requested here: ceph#71479 (comment)
7ebf504 to
1cc64e9
Compare
Requested here: ceph#71479 (comment)
1cc64e9 to
5b003a3
Compare
5b003a3 to
01f111d
Compare
01f111d to
3e911b8
Compare
Requested here: ceph#71479 (comment) Signed-off-by: Viliam Durina <[email protected]>
`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]>
Requested here: ceph#71479 (comment) Signed-off-by: Viliam Durina <[email protected]>
3e911b8 to
481ebbd
Compare
|
This PR has been added to wip-bharath12-testing-20260907.061609-main. |
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are:
Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
rocksdb::WritableFileassumes that whatever was allocated usingAllocate(), and was not actually written to, is released when the file is closed (cf.PosixWritableFile::Close()). This used to work up to PR #62224 (released in 20.1.0, a tentacle RC), which removed the truncation fromclosesince it assumed thattruncateis called (see comment to commit d1703dc), which is not the case.This PR adds the truncation back to
BlueRocksWritableFile::Close(). We cannot bring back the exact pre-62224 code, as it relies onh->pos. Instead we flush the file and usefnode.size, which contains the on-disk size, including the envelope.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 file with 70MB allocation; in the sharded case the unreleased file tails still exist, but are much smaller.
The PR adds two tests:
truncate_unused_allocations()methodI also deleted
BlueStoreWritableFile::UseDirectIO(), as it is unused (it doesn't override superclass method), and can cause confusion.Fixes: https://tracker.ceph.com/issues/76256
Includes: #71483
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.