Whamcloud - gitweb
b=17485 Don't reset the lov_objid to last_id sent by OST
authorJohann Lombardi <johann@sun.com>
Fri, 25 Jun 2010 14:06:07 +0000 (16:06 +0200)
committerJohann Lombardi <johann@sun.com>
Fri, 25 Jun 2010 14:06:07 +0000 (16:06 +0200)
commit54b044966dda10e86d6d2a72b681421b1f570906
treea35bd4ac02b6ba0402213469d48afc721bd1a08a
parent5bb7dc0fd7e5d0480a2317c91515a3d45e80519a
b=17485 Don't reset the lov_objid to last_id sent by OST

i=andrew
i=hongchao

Resetting the lov_objid values to last_id reported by
the OST in mds_lov_get_objid() unconditionally is just wrong and can cause
the same object to be allocated twice by the MDS.

The SKIP_ORPHAN feature is supposed to work as follows:
* during orphan recovery, the MDS must supply to the OST the lov_objid
  value;
* on the OST side:
  - if MDS's lov_objid > OST's last_id, the OST recreates the missing objects
    up to lov_objid and packs this value in the reply;
  - if OST's last_id > MDS's lov_objid, the OST destroys orphan objects from
    lov_objid + 1 up to last_id and does *not* change last_id. The OST packs
    in the reply the value of last_id which is from where the MDS should
    restart allocations if it does not want to reuse orphans.
* the MDS sets next_id to the value reported by the OST in the orphan recovery
  request.

If we always discard the lov_objid values as done currently in mds_lov_get_objid(),
orphan recovery is just a noop and neither clears orphans nor recreates missing
objects.
lustre/mds/mds_lov.c
lustre/obdfilter/filter.c
lustre/osc/osc_create.c