Whamcloud - gitweb
LU-8562 osp: fix precreate_cleanup_orphans/precreate_reserve race 11/22211/7
authorSergey Cheremencev <sergey.cheremencev@seagate.com>
Thu, 10 Nov 2016 15:30:53 +0000 (23:30 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 23 Dec 2016 05:04:38 +0000 (05:04 +0000)
commitd295847d946276ab7ebae7811498fbdb1289e6e7
treea51f8ade64c8055939149352edd2956f2b1f44f8
parent2ce0d5b0640e3e440822080e407eee1ce1cafd75
LU-8562 osp: fix precreate_cleanup_orphans/precreate_reserve race

osp_statfs_interpret can clear error in opd_pre_status despite of the
fact that osp_precreate_cleanup_orphans got error and doesn't know
exactly OST object last_id. Example:
1. mdt sends req "create objects x..y"
2. objects created. mdt gets OK
3. MDT->OST reconnection
4. MDT sends cleanup_orphans last_used_fid=x
5. OST removes x..y and sends reply OK and last_id=x
6. MDT->OST connection aborted. cleanup_orphans exits with EIO
7. osp_statfs_interpret changes opd_pre_status from EIO to 0
8. osp_precreate_reserve reserves object and changes last_used_id from x to x+1
9. connection restored. MDT sends cleanup_orphans last_id=x+1
In fine OST has a gap - object x was removed by cleanup_orphans.

So don't clear opd_pre_recovering until we get last_id from OST.

Change-Id: I1647053fdab9a0c9bf59a048b0814e7b2dec52f2
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@seagate.com>
Seagate-bug-id: MRP-3693
Reviewed-on: https://review.whamcloud.com/22211
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_precreate.c
lustre/tests/conf-sanity.sh