bucket_id is now string: <global instance id>.<num> where
num is increasing monotonically within the current rgw
instance.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
ObjectContext::lock is used only for implementing read_lock and
write_lock. PG::lock is used to protect the ObjectContexts
belonging to a pg.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
If the first write that creates an object includes a truncate_seq and
truncate_size, we were taking the truncte patch and doing a truncate op
in our transaction prior to the write, and then setting the object_info
size appropriately. However, if the object doesn't exist, the truncate
op fails even though the oi.size gets set.
Later, this turns up as a scrub error (see #2080).
Fix this by skipping the truncate if it is a new object. Instead, we
should just initialize our truncate_{seq,size} metadata so that we're all
up to date for any later writes.
Alternatively, we could touch the object and then truncate it (up) to the
large size, but this is sort of a waste; data beyond a short object eof is
defined to be zeros, so all we would accomplish is making recovery work
harder by copying zeros around.
Fixes: #2080
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
This breaks because:
- we don't have the head or current snapset
- get_object_context() creates a new snapset, which is wrong
We probably can only do this if we are certain we can construct/modify
the old snapset and end up with the correct one.
Signed-off-by: Sage Weil <sage@newdream.net>
We specifically want to use this during recovery to avoid loading the obc
or ssc for a previous version of the object and populating the watchers.
We know we won't have any existing obc here because it is missing (old or
dne).
For the snapset context, we provide it explicitly when we recover the head
or snapset object (which we always do first). For clones, we re-use the
existing get_snapset_context(), which will either have the ssc open or
can load it from the head/snapset object.
Signed-off-by: Sage Weil <sage@newdream.net>
_make_clone (called from make_writeable) and _rollback_to included
attr reads from head or a clone. In that case, an ondisk read
lock would be necessary. Now, clone also handles xattrs, so the
attr read should not be necessary.
Signed-off-by: Samuel Just <sam.just@dreamhost.com>
We set degraded if we don't have enough "active" replicas, which excludes
the backfill target. We need to recheck that when we finish recovery and
the backfill target is now complete.
Fixes: #2160
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>