Whamcloud - gitweb
LU-1129 obdfilter: handle race condition of recreating objects
authorYu Jian <yujian@whamcloud.com>
Fri, 13 Jul 2012 09:45:53 +0000 (17:45 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jul 2012 04:08:07 +0000 (00:08 -0400)
commitd42fdb3fa8965ce2c5223bec7caec9b202e5fe22
treee3af52dd2b6dc814328516a3dbb5855c390320c3
parent68cdeeb2f587f5cf16a87b14644d6366b1ccb9d9
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: If486bc8221cf4b9d53b6de53e8ec14a4f3174b45
Reviewed-on: http://review.whamcloud.com/3391
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdfilter/filter.c