If a client is sending a sequence of ops (say, a, b, c, d) and partway
through that sequence it receives an OSDMap update that changes the
overlay, the ops will get send to different pools, and the replies will
come back completely out of order.
To fix this, force a resend of all outstanding ops any time the overlay
changes.
Fixes: #8305
Signed-off-by: Sage Weil <sage@inktank.com>
If an op is sent before last_force_op_resend, and the client's feature is
present, drop the op because we know they will resend.
Signed-off-by: Sage Weil <sage@inktank.com>
If we are a client, and process a map that sets last_force_op_resend to
the current epoch, force a resend of this op.
If the OSD expects us to do this, it will discard our previous op. If the
OSD is old, it will process the old one, this will appear as a dup, and we
are no worse off than before.
Signed-off-by: Sage Weil <sage@inktank.com>
Use 'char' instead of 'char *'.
228 names = (char *) malloc(sizeof(char *) * 1024);
Result of 'malloc' is converted to a pointer of type 'char',
which is incompatible with sizeof operand type 'char *'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use __u32 instead of __s32 due to type of bucket->parm to fix:
1028 bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__s32));
Result of 'calloc' is converted to a pointer of type '__u32',
which is incompatible with sizeof operand type '__s32'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
In many case when we are unlinking inodes we also need to invalidate the
dentry lease, as we are not promised that the dentry is NULL. Be a bit
over-conservative here for good measure.
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Basically, always keep the dentry and dir, unless we are pruning.
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
If we get a MOSDMarkMeDown message and set service.state == STOPPING, we
kick the prepare_to_stop() thread. Normally, it will wake up and then
set osd.state == STOPPING, and when we process the map message next we
will not warn. However, if dispatch() takes the lock instead and processes
the map, it will fail the preparing_to_stop check and issue a spurious
warning.
Fix by checking for either preparing_to_stop or stopping.
Fixes: #8319
Backport: firefly, emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
This is a method of standardizing the usage of OSD so that "Ceph OSD"
is the daemon, and OSD maintains its industry standard usage of Object
Storage Device.
Signed-off-by: Kevin Dalley <kevin@kelphead.org>
Fixes: #8169
Backport: firefly
We didn't calculate the user manifest's object etag at all. The etag
needs to be the md5 of the contantenation of all the parts' etags.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
There is a race with copy_from cancellation. The internal Objecter
completion decodes a bunch of data and copies it into pointers provided
when the op is queued. When we cancel, we need to ensure that we can cope
until control passes back to our provided completion.
Once we *do* get into the (ReplicatedPG) callbacks, we will bail out
because the tid in the CopyOp or FlushOp no longer matches.
Fix this by carrying a ref to keep the copy-from targets alive, and
clearing out the tids that we cancel.
Note that previously, the trigger for this was that the tid changes when
we handle a redirect, which made the op_cancel() call fail. With the
coming Objecter changes, this will no longer be the case. However, there
are also locking and threading changes that will make cancellation racy,
so we will not be able to rely on it always preventing the callback.
Either way, this will avoid the problem.
Fixes: #7588
Signed-off-by: Sage Weil <sage@inktank.com>
Two users have reported this fixes a problem with using --dmcrypt.
Fixes: #6966
Tested-by: Eric Eastman <eric0e@aol.com>
Signed-off-by: Sage Weil <sage@inktank.com>
It's "/sys/bus/rbd/devices/<id>", but libudev works with devices and
not busses, so it's really "/sys/devices/rbd/<id>/".
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Init 'snap_protected' with false to fix:
rbd.cc:544:35: warning: variable 'snap_protected' may be uninitialized
when used here [-Wconditional-uninitialized]
f->dump_string("protected", snap_protected ? "true" : "false");
^~~~~~~~~~~~~~
rbd.cc:482:22: note: initialize the variable 'snap_protected' to silence
this warning
bool snap_protected;
^
= false
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:
rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
when used here [-Wconditional-uninitialized]
int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
this warning
struct rbd_openimage *rbd;
^
= NULL
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Init 'bool done' with 'false' to fix:
osdc/Objecter.h:915:27: warning: implicit conversion los: variable 'done'
may be uninitialized when used here [-Wconditional-uninitialized]
while (!done)
^~~~
osdc/ObjectCacher.cc:1399:14: note: initialize the variable 'done' to
silence this warning
bool done;
^
= false
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Init best_locality to fix:
osdc/Objecter.cc:1519:26: warning: variable 'best_locality' may be
uninitialized when used here [-Wconditional-uninitialized]
(locality >= 0 && best_locality >= 0 &&
^~~~~~~~~~~~~
osdc/Objecter.cc:1511:19: note: initialize the variable 'best_locality'
to silence this warning
int best_locality;
^
= 0
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>