]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/bluestore/bluefs: Fix data corruption in truncate()
authorAdam Kupczyk <akupczyk@redhat.com>
Tue, 2 Nov 2021 15:57:32 +0000 (16:57 +0100)
committerAdam Kupczyk <akupczyk@redhat.com>
Wed, 3 Nov 2021 06:49:33 +0000 (07:49 +0100)
commit49b7b44b3b5c94ee401562e603999e2b3bd8f9a2
tree095631cdeb40eac553d7fc8ba199ef85a9e0637e
parent1f7771d4a77ebb271b939b3893d7607d964796f0
os/bluestore/bluefs: Fix data corruption in truncate()

It is possible to create condition in which a BlueFS contains file that is corrupted.
It can happen when BlueFS replay log is on device A and we just wrote to device B and truncated file.

Scenario:
1) write to file h1 on SLOW device
2) flush h1 (initiate transfer, but no fdatasync yet)
3) truncate h1
4) write to file h2 on DB
5) fsync h2 (forces replay log to be written, after fdatasync to DB)
6) poweroff

Fixes: https://tracker.ceph.com/issues/53129
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/os/bluestore/BlueFS.cc
src/test/objectstore/test_bluefs.cc