Yehuda Sadeh [Thu, 18 Dec 2014 06:52:01 +0000 (22:52 -0800)]
rgw: fix get_system_obj() caching
Originally this was get_obj(), but in the cleanup work this was changed
to get_system_obj() with somewhat different params. Updated cache to use
new interface.
Yehuda Sadeh [Thu, 18 Dec 2014 00:04:10 +0000 (16:04 -0800)]
rgw: allow setting of explicit object version on non-versioned bucket
If system user has set explicit olh version and/or object instance id,
treat it as the bucket was versioned anyway. This can happen with a
racing bucket metadata vs. data sync.
Yehuda Sadeh [Wed, 17 Dec 2014 21:51:24 +0000 (13:51 -0800)]
cls_rgw: don't increase epoch when converting plain entry
Plain entries that are getting converted gets epoch 1, as these are non
versioned ones, and every entry following these will be versioned. Don't
increase the epoch for the operation.
Yehuda Sadeh [Thu, 11 Dec 2014 23:43:17 +0000 (15:43 -0800)]
rgw: fix a few regressions
- need to increase olh epoch if converting plain entry, otherwise
ordering is skewed
- if entry is olh (e.g., colocated data + olh), need to make sure we
write olh idtag xattr
- completely revalidate obj state after writing it, otherwise attrs
won't have idtag, and later check to verify if it's olh will fail
Yehuda Sadeh [Thu, 11 Dec 2014 18:58:23 +0000 (10:58 -0800)]
rgw: move versioning handling to Object::Write::write_meta()
Instead of having to call set_olh() after calling write_meta(), do it
inside that method. This way we (mostly) don't need to care about
versioning outside of it. This required moving bucket info around
instead of just passing the bucket owner.
Yehuda Sadeh [Fri, 21 Nov 2014 21:17:25 +0000 (13:17 -0800)]
rgw, cls_rgw: provide optional version id, versioned epoch to olh ops
Let system users specify optional params: rgwx-version-id,
rgwx-versioned-epoch. These will apply to object modification operations
(put object, copy object, delete object), and provide the mechanism that
the sync agent will use to apply remote object changes.
Copy operation hasn't been done yet.
Yehuda Sadeh [Wed, 19 Nov 2014 21:15:26 +0000 (13:15 -0800)]
cls_rgw: link, unlink olh ops can get epoch
If epoch is specified, we need to handle updates differently, only
update the olh itself if passed epoch is newer than the olh current
epoch. Otherwise this is a replay of an older operation that doesn't
affect the olh (or the "current" property).
Yehuda Sadeh [Tue, 18 Nov 2014 20:07:15 +0000 (12:07 -0800)]
rgw: reduce use of Object::get_obj()
We should avoid using this one, as it's not going to point at the object
instance in case it's an olh. Only kept the use in
Object::Delete, as we make explicit checks before using it.
Separate the versioned epoch from the object entry version, since in the
case of null instane entries the object version actually contains
meaningful data that can be overwritten.
Keep separate instance entries for null versioned object and delete
marker, since the two can coexist for a period of time. With suspended
versioning bucket, when deleting a null versioned object we create an
delete marker, and set the olh log to remove the object instance, which
will make the gateway send a removal request. Had we kept the same
entry it'll remove the wrong entry.
Yehuda Sadeh [Tue, 4 Nov 2014 01:04:46 +0000 (17:04 -0800)]
rgw, cls_rgw: improve olh atomicity
Add olh_tag attr to olh object, and use it instead of obj_tag as object
data may be colocated with the olh. Use the olh_tag to guard various
operations.
Yehuda Sadeh [Fri, 31 Oct 2014 00:00:02 +0000 (17:00 -0700)]
rgw: send x-amz-version-id and x-amz-delete_marker header fields
send these fields on obj delete as defined by the api. This required
adding an index read so that we can identify whether an instance is
actually a delete marker.
Yehuda Sadeh [Thu, 30 Oct 2014 21:14:53 +0000 (14:14 -0700)]
cls_rgw: add missing cls_cxx_create()
This was found during code read, not necessarily a real issue, however,
we counted on the object being created implicitly by setting xattrs on
it. Instead make sure the object is created.
Yehuda Sadeh [Sat, 18 Oct 2014 00:08:19 +0000 (17:08 -0700)]
cls_rgw: keep null-versioned object as versioned object
when olh is created. Mark the object as such, so that we'll know to
handle it correctly. This is needed so that we could handle the 'null'
version as required.
Still doesn't work correctly.
Yehuda Sadeh [Fri, 3 Oct 2014 23:59:26 +0000 (16:59 -0700)]
rgw: pass around object context refrences, remove unused code
We want to make it clear that the object context is required for
non-system objects, pass it by reference (rather than by pointer). Make
the put processors get it as a constructor param and keep it on the
object.
Still haven't updated everything, as some stuff is going to change
anyway.
Remove the plain put processor, as it is not used anymore.
Yehuda Sadeh [Fri, 3 Oct 2014 22:55:23 +0000 (15:55 -0700)]
rgw: start reorganizing RGWRados
Need to reduce the various states of the different operations. The aim
is to separate the system objects operations from the data objects
operations, and compartmentalize the various systems.
rgw, cls_rgw: cls_bucket_list returns raw key in map
This is needed so that we dump the objects in the required order (from
newest to oldest versions for each object). While we're at it, revert to
the original encoding of rgw_bucket_dir, which will be better for
backward compatibility.
We need to update the previous key entry that it's no longer the latest,
need to use the list entry, not the data entry (which only serves as a
pointer to the list entry).