I hate this; it makes it impossible to see that there was an error message.
We made this same change a while back with rbd.
Signed-off-by: Sage Weil <sage@inktank.com>
Treat the second encoded bool as bits 9-16 of a (now) 16-bit flags field,
and use bit 9 (what used to be set by the use_tmap bool) as FLAG_USES_TMAP.
No encoding compatibility change.
Signed-off-by: Sage Weil <sage@inktank.com>
In each case, we treat the whiteout as if we got an ENOENT.
We do not change the semantics of bool exists to avoid breaking lots of
potentially fragile code. We are only interested in changing the
user-visible behavior of the object, not the way it is internally stored
or managed.
This will likely be refined as we grow acutal users for whiteoutes in the
pool caching code.
Signed-off-by: Sage Weil <sage@inktank.com>
This is more generic. We could also fold uses_tmap flag into here,
but the encoding change for that is non-trivial.
Signed-off-by: Sage Weil <sage@inktank.com>
We don't necessarily want to respond to clients with a failure if
a copy got an error code. Instead, conditionally execute the success
path and always launch back into execute_ctx() when the copy has
stopped (either due to completion or failure).
Update the COPY_FROM section so it returns the CopyOp::rval (instead
of always zero) and only launches finish_copy() on success.
Signed-off-by: Greg Farnum <greg@inktank.com>
The obs.oi.size needs to updated in the middle so that we actually
change the stats -- this got set backwards by mistake during one
of the refactors to support large objects!
(See 4e29e362e7)
Signed-off-by: Greg Farnum <greg@inktank.com>
C_OSD_SendMessageOnConn doesn't need to lock the pg.
Canceling it resulted in a leaked message.
Fixes: 6443
Signed-off-by: Samuel Just <sam.just@inktank.com>
While analyzing a log from Mike Dawson I saw a long stall while librbd's
objectcacher was starting lots (many hundreds) of IOs. Limit the amount of
time we spend doing this at a time to allow IO replies to be processed so
that the cache remains responsive.
I'm not sure this warrants a tunable (which we would need to add for both
libcephfs and librbd).
Signed-off-by: Sage Weil <sage@inktank.com>
Fixes: #6123
We don't want to know about failing to read region map info
if it's not found, only if failed on some other error. In
any case it's just a warning.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
The cancel_copy() method removes the entry from copy_ops. Move the
iterator forward before calling.
Fixes segfault when thrashing osds with a copy-from workload.
Signed-off-by: Sage Weil <sage@inktank.com>
Treat "need 1, got 0" as a special case, and change the message to
"missing required parameter <x>". Also, when failing for that reason,
print the command concise description and its helptext.
Fixes: #6384
Signed-off-by: Dan Mick <dan.mick@inktank.com>
The device could only be set to rw(default) when mapping
now. This patch only handle the user space, because the
kernel part has been completed.
Signed-off-by: Guangliang Zhao <guangliang@unitedstack.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Fixes: #6444
Backport: dumpling
If pool creation fails (e.g., due to -EEXIST) then we leak the
completion object. Earlier we couldn't just drop the reference, as
librados have already removed the internal completion object. This fix
drop the completion reference even if got an error, which is now
possible.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Backport: dumpling
The pool async delete / create function used to delete the internal
completion object. However, caller still holds the allocated completion
object, which it can't drop a reference to (as it'd try to deallocate
the already freed internal object). This fix removes the internal object
deletion, a following commit will fix a related leak (#6444) by having
the application (radosgw) drop the reference even if got an error.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
We have an iterator pointing at the element we want; no need to search
the map again in order to grab the element or remove it.
Signed-off-by: Greg Farnum <greg@inktank.com>
Backport: dumpling
Fixes: #6445
handler->get() returns a newly allocated obj, need to delete it when
done.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
When set to false, we do not redirect based on the cache_pool data
in the OSDMap. We'll use this so the OSDs can actually fetch data
into the cache pools on promotion!
Signed-off-by: Greg Farnum <greg@inktank.com>
There was a bunch of situations in which we would have a proper error to
propagate to user-space but we would always return '1' (EXIT_FAILURE).
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit 7e722245a7)