Whamcloud - gitweb
LU-4609 ofd: auto resume LFSCK after the recovery 10/10010/10
authorFan Yong <fan.yong@intel.com>
Sat, 5 Apr 2014 02:29:33 +0000 (10:29 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 9 May 2014 14:37:51 +0000 (14:37 +0000)
commit46e82c4644108eac92ac7c813c16bd7dd3283a56
tree2d1a40ca427d4de6d6aefc0260395f16aa317e63
parent08e888a20ec87b3e9dfccbae34cc2cfe98f848e6
LU-4609 ofd: auto resume LFSCK after the recovery

To prevent the LFSCK to recreate some objects which should be done
via some replayable RPCs, we will postpone the LFSCK auto assuming
after the server restart until the recovery finished.

Such serialization also avoid some race between LFSCK and recovery
to misguide the LFSCK to regard the system as inconsistent.

Another fix is that:
During the OST recovery, the client write RPC may create the missed
OST-object which will cause the real last_id to be greater than the
last_id value stored in the LAST_ID file temporarily. Normally, the
LAST_ID file will be synced between MDT and OST during the recovery,
but we should not assume that the MDT-OST recovery will succeed. If
it failed, then subsequent LFSCK on the OST may regard such LAST_ID
file as crashed, then it will mark the OST as read-only and rebuild
the LAST_ID files.

To avoid such case, before the write RPC to create the lost object,
it needs to update the LAST_ID file firstly.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I963f3c1b70c7cad0c943f2485417d2e783768bf1
Reviewed-on: http://review.whamcloud.com/10010
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/mdt/mdt_handler.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c
lustre/ofd/ofd_obd.c
lustre/ofd/ofd_objects.c
lustre/tests/sanity-lfsck.sh