split out new parent info into separate retrieval methods;
structure packing on rbd_image_info_t was becoming a problem.
Deprecate old parent fields in favor of new ones.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
This creates a separate reference to an existing connection, for
use when a client holding IoCtx needs to consult another (say,
for rbd cloning)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
These check that removing an image still works if an rbd rm
command was interrupted partway through.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This lets us get a more useful error, like -ENOENT, instead
of a failure to decode the empty output buffer.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Now it's not the caller's responsibility to specify the format,
and we can eliminate a job from the qa suite.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Since we only use the new interface with new format images,
old clients won't be able to list them.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
These hide the structure of the directory from clients, and provide
mappings from id to name and name to id. These mappings aren't needed
for old format images, but with layering, they're useful to show
the user e.g. the name of an image's parent instead of its id.
This also makes the directory more efficient for new-style images, since
it uses omap instead of tmap.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This adds a new rbd_id.$name object that contains the id of an image.
Rename the header in new-format images to rbd_header.$id, so that
it doesn't need to change when an image is renamed - the rbd_id.$name
object is copied to a new object instead.
With layering, this becomes more important because many child images
could be depending on the header object of a parent image.
This is another change to the new format, but since no one uses it yet,
we don't need to worry about backwards compatibility.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
These will be used on a new rbd id object to provide a level of
indirection so that header objects don't need to move when
an image is renamed.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
We marked a request as complete in the callback, however
it might be that we're still inside S3_runall_request_context()
which means that request is not really complete yet.
Possibly fixes bug #2652.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
The date format now is "YYYY-MM-DD[ hh:mm:ss]". Got rid of
the --time param for the old ops log stuff.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
The linger_send() method was doing this, but it is problematic because the
new Op doesn't get its pgid or acting vector set correctly. The result is
that the request goes to the right OSD, but has the wrong pgid, and makes
the OSD complain about misdirected requests and drop it on the floor. It
didn't affect the test results because we weren't testing whether the
watch was working in that case.
Instead, we'll just recalculate and get the same value the parent linger
op did. Which is fine, and goes through all the usual code paths so
nothing is missed.
Also, increment num_homeless_ops before we recalc_op_target(), so that we
don't (harmlessly, but confusingly) underflow.
Fixes: #2022
Signed-off-by: Sage Weil <sage@inktank.com>
The linger_send() method was doing this, but it is problematic because the
new Op doesn't get its pgid or acting vector set correctly. The result is
that the request goes to the right OSD, but has the wrong pgid, and makes
the OSD complain about misdirected requests and drop it on the floor. It
didn't affect the test results because we weren't testing whether the
watch was working in that case.
Instead, we'll just recalculate and get the same value the parent linger
op did. Which is fine, and goes through all the usual code paths so
nothing is missed.
Also, increment num_homeless_ops before we recalc_op_target(), so that we
don't (harmlessly, but confusingly) underflow.
Fixes: #2022
Signed-off-by: Sage Weil <sage@inktank.com>
These asserts were useful for ensuring that pool is passed
in in the correct places, but they prevent the encoder
testing from working.
Signed-off-by: Samuel Just <sam.just@inktank.com>
It is probably unlikely that someone will expand the mon cluster with a
mixed feature set, but we know the quorum features here, so we should use
them.
Signed-off-by: Sage Weil <sage@inktank.com>
If the quorum does not yet all have the MONENC feature, stick to the old
encoding.
It might be more polite to require a super-quorum before switching over,
and take note so that thereafter we can stick to the new encoding, but
that has more moving parts and I'm not sure it's worth the complexity.
Signed-off-by: Sage Weil <sage@inktank.com>
When we form a quorum, also note the intersection of the quorum members'
feature bits. This will inform decisions about what encodings we use.
This is an imperfect strategy because the quorum may change, and we may
have a mon with old code join in and not understand what is going on.
However, it does ensure that a majority of the members run new code, so in
the absence of other failures we can make progress.
Signed-off-by: Sage Weil <sage@inktank.com>