Whamcloud - gitweb
LU-1129 obdfilter: handle race condition of recreating objects
authorYu Jian <yujian@whamcloud.com>
Tue, 3 Jul 2012 14:22:48 +0000 (22:22 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jul 2012 23:17:14 +0000 (19:17 -0400)
commit99006dde10b38835e1d641de96a6c3840b4cce60
tree56857f329751faec96f1176b2b34aee61cde6da8
parent1022d6e057669ac243e7517ffa555176775c9197
LU-1129 obdfilter: handle race condition of recreating objects

During OST recovery, a race can happen while handling replayed
OST_WRITE request during the MDS->OST orphan recovery period to
recreate missing objects, which can trigger ASSERTION(diff >= 0)
failure.

This patch handles the above issue by adding obd->obd_recovering
into the assertion to check whether the OST is in recovery or not.
If it's in recovery and diff < 0, then no assertion failure occurs,
the object has been recreated. If the OST is not in recovery and
diff < 0, then the assertion failure occurs.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Id62970067b3507e832fb65b3ff623e6e67f3becc
Reviewed-on: http://review.whamcloud.com/3264
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdfilter/filter.c