Yehuda Sadeh [Thu, 8 Jan 2015 01:04:36 +0000 (17:04 -0800)]
rgw: fix setting of versioned epoch when removing object instance
Beforehand if rgwx-versioned-epoch was passed, we ended up always
creating a delete marker. We don't do that now if rgwx-version-id is not
specified, which allows the system user to remove an object instance and
set the epoch appropriately.
Yehuda Sadeh [Wed, 7 Jan 2015 00:23:47 +0000 (16:23 -0800)]
rgw: add bucket index log flags, use these for marking versioned ops
We want to mark operations as versioned. This is needed by the sync
agent, so that we know how to handle bucket index log entries. We only
want to apply link-olh and unlink-instance operations when it's
versioned.
Yehuda Sadeh [Tue, 23 Dec 2014 22:02:16 +0000 (14:02 -0800)]
rgw: only retry on ECANCELED before doing the operation
After we did the operation (e.g., link olh, remove) we don't need to
retry. We got ECANCELED, therefore the operation has already been
applied by another user.
Yehuda Sadeh [Tue, 23 Dec 2014 20:11:33 +0000 (12:11 -0800)]
rgw: fix olh guarding scheme
is_olh() will return false if object is not yet an olh, although we
started the process into turning it into one. We should use the
existence of the olh tag instead.
Yehuda Sadeh [Tue, 23 Dec 2014 00:39:15 +0000 (16:39 -0800)]
rgw: multi object delete sends delete marker info
The api requires that we send information about whether the operation
was on a delete marker (either created or removed), and what was the
corresponding version id.
Yehuda Sadeh [Mon, 22 Dec 2014 23:03:04 +0000 (15:03 -0800)]
cls/rgw: when removing delete marker, clean up instance entry
Since we create the instance entry at the bucket index, we should also
remove it. Otherwise we end up with objects that have bucket index
entries, but don't have olh. In these cases we'll be failin operations
on these objects, as their bucket index olh tag will always mismatch the
actual object olh tag.
Yehuda Sadeh [Fri, 19 Dec 2014 23:29:27 +0000 (15:29 -0800)]
rgw, cls_rgw: clean up olh artifacts when dropping last version
This is still missing one piece, however, it works like this:
1. bucket index log reflects last version was removed (already did that)
2. olh entry is marked as 'pending removal'
- any new versions coming in now to the olh entry will clear pending
state
3. rgw conditionally removes olh object (still missing condition check)
- condition checks should verify olh tag & version, and no pending
modifications
4. if (2) is successful, rgw sends 'clear olh' request to bucket index
5. bucket index, if still 'pending removal' clears olh and plain entry
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.