Whamcloud - gitweb
LU-7585 zfs: OI scrub for ZFS 09/30909/2
authorFan Yong <fan.yong@intel.com>
Thu, 18 Jan 2018 01:34:50 +0000 (09:34 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 31 Jan 2018 05:51:54 +0000 (05:51 +0000)
commit89ead218ebe99a955afc0bc7f6aba83ef35019fb
tree3c1171103725a2ee3d3c35acfe27b39653ba5d80
parentd9e57a765e73e1bc3046124433eb6e2186f7e07c
LU-7585 zfs: OI scrub for ZFS

The ZFS backend OI scrub is used for verifying OI mappings
consistency. ZFS has some mechanism to maintion the data
integrity, but there is still possible data corruption,
especially consider the data migration from other backend,
such as ldiskfs, or server side data backup and restore.
The OI scrub can check OI mappings consistency and rebuild
them when needed.

The ZFS backend OI scrub shares the same control interface
as ldiskfs backend. It can be triggered manually via the
lctl command:
lctl lfsck_start -M $device -t scrub

It also can be triggered automatically when inconsistency
detected if you do not disable 'auto_scrub' that can be
controlled via:
lct set_param -n osd-zfs.*.auto_scrub_interval=xxx

You can check the OI scrub status similar as you do for
ldiskfs backend:
lctl get_param -n osd-zfs.*.oi_scrub

Test-Parameters: envdefinitions=SLOW=yes testlist=sanity-scrub mdtfilesystemtype=zfs ostfilesystemtype=zfs mdscount=2 mdtcount=4
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I59ae3142ecd7b27f48b14f2a2d1d110d9c8296e3
Reviewed-on: https://review.whamcloud.com/30909
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
14 files changed:
lustre/include/obd_support.h
lustre/lfsck/lfsck_lib.c
lustre/mgs/mgs_handler.c
lustre/ofd/ofd_dev.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/Makefile.in
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_lproc.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_oi.c
lustre/osd-zfs/osd_scrub.c [new file with mode: 0644]
lustre/tests/sanity-scrub.sh