]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: use (robust) helper for setting exists or clearing whiteout 4016/head
authorSage Weil <sage@redhat.com>
Tue, 17 Mar 2015 17:26:13 +0000 (10:26 -0700)
committerSage Weil <sage@redhat.com>
Tue, 17 Mar 2015 17:26:13 +0000 (10:26 -0700)
commit1c2041752b3aa9a807173da557f1166ee0959ef9
tree79ca80256c048c55d0cccbbae6e0a4f8a43aad1e
parent53cc492bee3e66d69264cef9f2f3895c4a92d360
osd: use (robust) helper for setting exists or clearing whiteout

The current blanket check in prepare_transaction() will trigger only when
there is a net obs.exists change from the commited obs to new_obs.
However, this misses the case where the first osd_op is a delete and then a
subsequent osd_op recreates the object.  Changing the whiteout check to
look only at new_obs does not work because it fails to understand when
_delete_oid sets the whiteout and will simply clear it again.

In order to support sequences of delete + create in general, we need to do
the whiteout flag clearing when the actual create happens (to match the
fact that we set it when we process the delete osd_op).  Use a helper to
do this and consolidate most other obs.exists = true code to use it.

Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h