]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: add preliminary support for sync update policies on metadata sync
authorGreg Farnum <greg@inktank.com>
Tue, 16 Jul 2013 19:23:13 +0000 (12:23 -0700)
committerGreg Farnum <greg@inktank.com>
Thu, 25 Jul 2013 22:59:24 +0000 (15:59 -0700)
commit4f9855e4705ede5d937b6e533ce9f116dec793a8
treefe4b16b485028ad4942a6455ad9a7ec10786769f
parent934ad8814211e9b05deadb70438d6ab5d7bea7d8
rgw: add preliminary support for sync update policies on metadata sync

We want to be able to conditionally apply new updates:
1) if we already have a newer version than the sync is applying for some
reason (replay of logs?), we don't want to go back in time.
2) If both zones were active at the same time, then we'd like to be
able to do a merge based on timestamps.

In order to support this, we add a sync_type flag to the implementations of
RGWMetadataHandler::put, and then check the version or the mtime of the
incoming put to what we have on disk, and refuse the update if needed.
We return the 204 NoContent success code when refusing sync; for the
moment the conversion is automatic but we're going to pull it out in
the next couple commits.

This commit does not complete the feature: we don't provide an interface
for specifying a different sync protocol.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_common.h
src/rgw/rgw_http_errors.h
src/rgw/rgw_metadata.cc
src/rgw/rgw_metadata.h
src/rgw/rgw_user.cc