]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: fix reorder when flush cache-data to osd. 43127/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 1 Nov 2021 01:25:52 +0000 (09:25 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 1 Nov 2021 01:25:52 +0000 (09:25 +0800)
commit1fc3be248097eb6087560c22374c1f924bfe0735
tree7673b2e4fcdecb28fba266cacb716743121fbba1
parentf94abe64f328ade02878bb10e72c9b33ff1e7428
librbd/cache/pwl: fix reorder when flush cache-data to osd.

Consider the following workload:
writeA(0, 4096)
writeB(0, 512).
pwl can makre sure writeA persist to cache before writeB.
But when flush to osd, it use async-read to read data from cache and in
the callback function they issue write to osd.
So although we by order issue aio-read(4096), aio-read(512). But we
can't make sure the return order.
If aio-read(512) firstly return, the write order to next layer is
writeB(0, 512)
writeA(0, 4096).
This is wrong from the user point.

To avoid this occur, we should firstly read all data from cache. And
then send write by order.

Fiexs: https://tracker.ceph.com/issues/52511

Tested-by: Feng Hualong <hualong.feng@intel.com>
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/librbd/cache/pwl/AbstractWriteLog.cc
src/librbd/cache/pwl/AbstractWriteLog.h
src/librbd/cache/pwl/rwl/WriteLog.cc
src/librbd/cache/pwl/rwl/WriteLog.h
src/librbd/cache/pwl/ssd/WriteLog.cc
src/librbd/cache/pwl/ssd/WriteLog.h