]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: Using BlockGuard control overlap ops order when flush to osd.
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 29 Nov 2021 07:16:21 +0000 (15:16 +0800)
committerDeepika Upadhyay <dupadhya@redhat.com>
Fri, 10 Dec 2021 07:18:54 +0000 (12:48 +0530)
commit247dad9b7f283f813b305729f971351c0095f8e6
treee3d6322d02f0b4cd02377b5992c6ca35c37f173c
parentb5e9235f0a03e37b79f1aa88baeafc7df8ddfd2c
librbd/cache/pwl: Using BlockGuard control overlap ops  order when flush to osd.

In process of tests, we met some inconsistent-data problem. Test case
mainly use write,then discard to detect data consistent.
W/o pwl, write/discard are synchronous ops. After write, data already
located into osd. But w/ pwl, we use asynchronous api to send ops to
osd.
Although we mare sure send order. But send-order don't makre sure
complete order. This mean pwl keep order of write/discard. But it
don't keep the same semantics which use synchronous api. W/ pwl, it make
synchronous to asynchronous. For normal ops, it's not problem. But if
connected-commands w/ overlap, it make data inconsistent.
So we use BlockGuard to solve this issue.

Fixes: https://tracker.ceph.com/issues/49876
Fixes: https://tracker.ceph.com/issues/53108
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit 8e8f3ef516e98da011f3086f8e78a2fa261293ed)
src/librbd/cache/pwl/AbstractWriteLog.cc
src/librbd/cache/pwl/AbstractWriteLog.h
src/librbd/cache/pwl/LogEntry.h
src/librbd/cache/pwl/rwl/WriteLog.cc
src/librbd/cache/pwl/ssd/WriteLog.cc