rgw: grab the old mtime when doing a user metadata put

We're about to use this to enable (ick) a timestamp-based update
decision tree, to help in resolving disastrous double-active conflicts.

Signed-off-by: Greg Farnum <greg@inktank.com>
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

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>
rgw: move sync checks into the RGWMetadataHandler base class

The code duplication was foolish.

Signed-off-by: Greg Farnum <greg@inktank.com>
rgw: pass the sync mode into the RGWMetadataManager::put() calls.

Signed-off-by: Greg Farnum <greg@inktank.com>
rgw: add sync state parsing code and REST interface

Specify the param "sync-type" as one of "always", "update-by-version",
"update-by-timestamp". It defaults to always.

Signed-off-by: Greg Farnum <greg@inktank.com>
rgw: RGWOp_Metadata_Put should not reset the http_ret code.

It's already being set to what the meta_mgr->put() returned; we don't
want to clear it to zero in case the metadata handlers have actually
passed some data back.

Signed-off-by: Greg Farnum <greg@inktank.com>
rgw: return status codes from metadata puts based on the result of the op

If the op resulted in an update, it returns 201 Created. If the op was
valid but the sync mode resulted in not applying the data, it returns
202 Accepted.

Signed-off-by: Greg Farnum <greg@inktank.com>
wip