]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: fix deep-scrub operation againest disk silent errors 23629/head
authorXiaoguang Wang <xiaoguang.wang@easystack.cn>
Thu, 30 Aug 2018 02:26:41 +0000 (10:26 +0800)
committerXiaoguang Wang <xiaoguang.wang@easystack.cn>
Fri, 31 Aug 2018 06:11:18 +0000 (14:11 +0800)
commita7f1af25dd2ba88a322ed21828f073a277b09d02
treef82f63ddc047d4db4ed73edc07d6f3d58c2041d1
parent2c862ce6e92bd28ef9e71fdf6a1f88a6e0173043
os/bluestore: fix deep-scrub operation againest disk silent errors

Say a object who has data caches, but in a while later, caches' underlying
physical device has silent disk erros accidentally, then caches and physical
data are not same. In such case, deep-scrub operation still tries to read
caches firstly and won't do crc checksum, then deep-scrub won't find such
data corruptions timely.

Here introduce a new flag 'CEPH_OSD_OP_FLAG_BYPASS_CLEAN_CACHE' which tells
deep-scrub to bypass object caches. Note that we only bypass cache who is in
STATE_CLEAN state. For STATE_WRITING caches, currently they are not written
to physical device, so deep-scrub operation can not read physical device and
can read these dirty caches safely. Once they are in STATE_CLEAN state(or not
added to bluestore cache), next round deep-scurb can check them correctly.

As to above discussions, I refactor BlueStore::BufferSpace::read sightly,
adding a new 'flags' argument, whose value will be 0 or:
     enum {
       BYPASS_CLEAN_CACHE = 0x1,     // bypass clean cache
     };

flags 0: normal read, do not bypass clean or dirty cache
flags BYPASS_CLEAN_CACHE: bypass clean cache, currently only for deep-scrube
                        operation

Test:
   I deliberately corrupt a object with cache, with this patch, deep-scrub
   can find data error very timely.

Signed-off-by: Xiaoguang Wang <xiaoguang.wang@easystack.cn>
src/include/rados.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/osd/ReplicatedBackend.cc
src/osd/osd_types.cc