Whamcloud - gitweb
LU-1453 scrub: auto trigger OI scrub more flexible 38/12738/10
authorFan Yong <fan.yong@intel.com>
Sat, 13 Sep 2014 20:22:41 +0000 (04:22 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 3 Dec 2014 02:29:21 +0000 (02:29 +0000)
commit2c5b57ca3aaf1d27a24bce028220355a005dde3d
tree507cffc8354e56dd8eb96da1faeb7f5a4489b771
parent9ce1fdd9b79bca5cd4dbeb4740fbc889c573d5fc
LU-1453 scrub: auto trigger OI scrub more flexible

Generally, scanning the whole device for OI scrub routine check may
takes some long time. If the whole system only contains several bad
OI mappings, then it is not worth to trigger OI scrub automatically
with full speed when some bad OI mapping is auto-detected. Instead,
we can make the OI scrub to fix the found bad OI mappings only, and
if more and more bad OI mappings are found as to exceeds some given
threshold that can be adjusted via some proc interface, then the OI
scrub will run with full speed to scan whole device.

Currently, we offer two kinds of thresholds for triggering OI scrub
to scan the whole device:

1) "the total OI mappings count" vs "the bad OI mappings count".
   If such ratio is low than the given threshold that can be set
   via the proc interface "full_scrub_ratio", then trigger urgent
   mode OI scrub.

2) "the speed of found the bad OI mappings". If the speed exceeds
   the given threshold that can be adjusted via the proc interface
   "full_scrub_speed", then trigger urgent mode OI scrub.

Test-Parameters: mdsfilesystemtype=ldiskfs mdtfilesystemtype=ldiskfs \
ostfilesystemtype=ldiskfs envdefinitions=ONLY=4 testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ibc4592fef1da11994ec30eb348d20576be5ae54b
Reviewed-on: http://review.whamcloud.com/12738
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-ldiskfs/osd_scrub.c
lustre/osd-ldiskfs/osd_scrub.h
lustre/tests/sanity-scrub.sh