]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: Fix multisite Synchronization failed when read and write delete at the same... 20814/head
authorNiu Pengju <pengju.niu@xtaotech.com>
Sun, 8 Apr 2018 03:08:04 +0000 (11:08 +0800)
committerNiu Pengju <pengju.niu@xtaotech.com>
Sun, 8 Apr 2018 03:08:04 +0000 (11:08 +0800)
commita8fd508915a0acf7768fe6ba7f7414e71813f1d7
tree031f400cd5bd22746b079a8ee2d941c8a0a7fc64
parent21146f9e4d9f36ab1186adeb69b9bfa0b62b86f3
rgw: Fix multisite Synchronization failed when read and write delete at the same time

This case is first write objA,then write and delete objA at the same
time,write early than delete.
When del objA, use information which stat  of first write objA, so the
op should del the first write data.However when try to del objA, objA
header is second write, so osd "do_xattr_cmp_str" has found idtag change
and return -125(canceled),after rgw client receive the ret -125 , it
will still do "complete_del", then do cls_obj_complete_del to write
bilog。"complete_op" in cls_rgw module  will  write bilog with second
write mtime and second ".ver.epoch". Finally, del op append behind the
second write in bilog. And the slave rgw will merge write op and del op
as del op, and del data,but master rgw complete second write and cancel
del.
This logic is problematic,  so bilog recording the del op should use
cancel op. And squash_map should skip the cancel op.

Fixes: http://tracker.ceph.com/issues/22804
Signed-off-by: Niu Pengju <pengju.niu@xtaotech.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc