Commit Graph

33568 Commits

Author SHA1 Message Date
Sage Weil
63d92ab096 mon/OSDMonitor: force op resend when pool overlay changes
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>
2014-05-10 09:12:26 -07:00
Sage Weil
45e79a17a9 osd: discard client ops sent before last_force_op_resend
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>
2014-05-10 09:12:26 -07:00
Sage Weil
dd700bdf71 osdc/Objecter: resend ops in the last_force_op_resend epoch
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>
2014-05-10 09:12:26 -07:00
Danny Al-Gaaf
b3203e54ec rbd.cc: remove used parameter from set_pool_image_name()
Removed unused 'orig_pool' parameter from set_pool_image_name().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-10 11:51:41 +02:00
Danny Al-Gaaf
fe75075574 test_librbd.cc: fix sizeof() in malloc call
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>
2014-05-10 10:58:56 +02:00
Danny Al-Gaaf
eb2def87f8 CrushWrapper.cc: fix sizeof() call in calloc
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>
2014-05-10 10:50:32 +02:00
Sage Weil
11e5eef331 client: fix whitespace in stat relpath
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-10 11:50:09 +08:00
Sage Weil
cdbe6cfb72 client: use __func__ instead of incorrect function name in insert_readdir_results
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-10 11:50:09 +08:00
Sage Weil
3eb2a77442 client: make less noise when unlinking during readdir
Skip, but do not talk about, NULL dentries.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-10 11:50:09 +08:00
Sage Weil
d1c872d880 client: invalidate dentry leases when unlinking
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>
2014-05-10 11:50:09 +08:00
Sage Weil
d852a69fba client: audit unlink() callers
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>
2014-05-10 11:50:00 +08:00
Josh Durgin
bc8d5f42be Merge pull request #1781 from ceph/wip-8269
Wip 8269

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-05-09 14:44:25 -07:00
Greg Farnum
3b867d319b TrackedOp: create an "initiated" event on construction
This ensures we always have an event for state_string().

Signed-off-by: Greg Farnum <greg@inktank.com>
2014-05-09 14:09:30 -07:00
Guang Yang
bdee119076 msg: Fix inconsistent message sequence negotiation during connection reset
Backport: firefly, emperor, dumpling

Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
Reviewed-by: Greg Farnum <greg@inktank.com>
2014-05-09 11:04:29 -07:00
Sage Weil
76dcf2d149 Merge pull request #1796 from daniel-j-h/missing_initializers
Fixed missing initializers issues

Reviewed-by: Sage Weil <sage@inktank.com>
2014-05-09 11:03:06 -07:00
Sage Weil
f302b60aad Merge pull request #1797 from ceph/wip-7588
osd/ReplicatedPG: carry CopyOpRef in copy_from completion

Reviewed-by: Samuel Just <sam.just@inktank.com>
2014-05-09 11:01:46 -07:00
Sage Weil
d903895441 v0.80
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTaOuwAAoJEH6/3V0X7TFtMQgP/1UWkr94SrxwHwToD5TsLug4
 aeR923MnBn5qyPCDNyqpftWtxskfPSdDxJlkpc6qsFYlupECIb593z4F7tFejzVh
 LN0fkdHmut9g7EDpd9kgNeqgTb8tqxj/Nq4jih1fXWeznNEaQWkk5dVA8UsopCyv
 0FvSllxmTwD/jNtaloXb8jSI/wtjIlQzhucjJb80OjdIl7LfmtsA3DAAweTjX7c0
 Wv8daBnj2clgSe+gjYHvXOopzNszB9/+K5kWgLS5Cvs4ngHeYh03O7hVoFluHRbc
 hnzLQHMs/Pfs6HR2+eybc7z3UYxfVKZkcHpCqVzM5+lCwKQc61MZeJrJg7RWcTgP
 SNFBPYMMgPZABpdhNi3qEJpvZ65pD/gfShXdzQwMnXRCIF0714LWKYdsuSRCr9Lf
 3pkZ+zPHaID2OWWOXDOe6WY1Wg1YiVt8uss9ZRsOCkKDnc8JzPhx5Z7f4+f74bOU
 Cm7xLQH8EJtrxqQjGz2HO3OucI253OceVHWh2L9nHbRRNM3LMxW8fbd/dEbIfHiG
 g6Qh+NbyuRtiYLq7pRChKirE67dqXNoauE0Co0M6C6x1hqou41YQMD0gwjPdj5Iy
 1tScKXS+onPzt9KR/ZA8RNOLCCnLdOSn4G0qRD0xJIdyDPB562u6FNv9b4X7xgry
 kxpFEPCfRGSNNH2hNb0X
 =sTfQ
 -----END PGP SIGNATURE-----

Merge tag 'v0.80'

v0.80

Conflicts:
	src/osd/PG.cc
	src/osd/ReplicatedPG.cc
2014-05-09 10:58:35 -07:00
Sage Weil
47f5dc0676 Merge pull request #1798 from ceph/wip-8319
osd: fix race during shutdown

Reviewed-by: Samuel Just <sam.just@inktank.com>
2014-05-09 10:45:42 -07:00
John Wilkins
4ef7fa9f30 Merge pull request #1731 from dynamike67/patch-2
doc: Changed the java code example
2014-05-09 10:33:33 -07:00
Sage Weil
b5e4cd13c0 osd: fix MOSDMarkMeDown name
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-09 10:31:15 -07:00
John Wilkins
bb614e5055 Merge pull request #1792 from nereocystis/Ceph-osd-is-daemon
:doc Ceph OSD is standard name
2014-05-09 10:28:52 -07:00
John Wilkins
0d0c209263 Merge pull request #1786 from nereocystis/quick-common
doc: Common graph used in 2 quick start files
2014-05-09 10:27:53 -07:00
John Wilkins
49033e8cd5 Merge pull request #1732 from dynamike67/master
doc: Added Java Example
2014-05-09 10:22:15 -07:00
Sage Weil
6b858be067 osd: handle race between osdmap and prepare_to_stop
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>
2014-05-09 09:20:34 -07:00
Sage Weil
b640301084 osd: fix state method whitespace
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-09 09:12:42 -07:00
Daniel J. Hofmann
ba014459ed Fixed missing initializers issues
Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
2014-05-09 17:25:07 +02:00
Sage Weil
edb14affd8 Merge pull request #1795 from daniel-j-h/extra_semicolons
Removed extra semicolons

Reviewed-by: Sage Weil <sage@inktank.com>
2014-05-09 06:49:28 -07:00
Daniel J. Hofmann
60b1071d64 Removed extra semicolons
Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
2014-05-09 15:07:15 +02:00
Josh Durgin
d34cc1e7cd Merge pull request #1772 from ceph/wip-8169
rgw: calculate user manifest

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-05-08 15:35:45 -07:00
Kevin Dalley
5986f746dc :doc Ceph OSD is standard name
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>
2014-05-08 14:58:02 -07:00
Yehuda Sadeh
ddc2e1a8e3 rgw: calculate user manifest
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>
2014-05-08 14:29:12 -07:00
Sage Weil
589b639af7 osd/ReplicatedPG: carry CopyOpRef in copy_from completion
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>
2014-05-08 14:19:22 -07:00
Samuel Just
aff119ace6 Merge pull request #1791 from ceph/wip-8011
ReplicatedPG: block scrub on blocked object contexts

Reviewed-by: Sage Weil <sage@inktank.com>
2014-05-08 13:50:19 -07:00
Samuel Just
db4ccb0481 ReplicatedPG: block scrub on blocked object contexts
Fixes: #8011
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-05-08 12:41:28 -07:00
Sage Weil
3152faf79f osd/osd_types: add last_force_op_resend to pg_pool_t
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-08 10:52:33 -07:00
Alfredo Deza
fc263c3fc2 Merge pull request #1778 from ceph/wip-7157
ceph-disk: fix list for encrypted or corrupt volume

Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-05-08 12:13:58 -04:00
Sage Weil
c3e3a13238 Merge pull request #1789 from ceph/wip-jcsp-clang
misc. cleanups from clang warnings

Reviewed-by: Sage Weil <sage@inktank.com>
2014-05-08 09:07:28 -07:00
Alfredo Deza
fbeb298de2 Merge pull request #1777 from ceph/wip-6966
ceph-disk: partprobe before settle when preparing dev

Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-05-08 12:00:28 -04:00
Sage Weil
0f196265f0 ceph-disk: partprobe before settle when preparing dev
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>
2014-05-08 08:52:51 -07:00
Sage Weil
2e530771a8 Merge pull request #1788 from ceph/wip-da-sca-20140507
Fix some issues from SCA
2014-05-08 08:47:05 -07:00
Sage Weil
df94b8de57 Merge pull request #1790 from ceph/wip-krbd-fixes
Two minor krbd fixes

Reviewed-by: Sage Weil <sage@inktank.com>
2014-05-08 08:33:54 -07:00
Danny Al-Gaaf
569023202b rbd-fuse.c: remove ridiculous linebreak
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 17:08:32 +02:00
Danny Al-Gaaf
7a3724b037 rbd-fuse.c: fix indentation
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 17:05:48 +02:00
Danny Al-Gaaf
8101f980da rbd-fuse.c: fix -Wmissing-field-initializers
Init image_name with NULL to fix:

rbd_fuse/rbd-fuse.c:57:63: warning: missing field 'image_name' initializer
 [-Wmissing-field-initializers]
 struct rbd_options rbd_options = {"/etc/ceph/ceph.conf", "rbd"};

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 16:59:45 +02:00
Ilya Dryomov
65ca867e4f krbd: fix sysfs path in the comment
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>
2014-05-08 18:17:48 +04:00
Ilya Dryomov
f1d953e08f krbd: match new with delete, not free()
struct krbd_ctx is allocated with new, use delete to get rid of it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-05-08 18:17:48 +04:00
Danny Al-Gaaf
082367e8b2 rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized
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>
2014-05-08 16:09:07 +02:00
Danny Al-Gaaf
0d01563f8b rbd-fuse.c: init 'rbd' in open_rbd_image()
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>
2014-05-08 16:04:18 +02:00
Danny Al-Gaaf
cfc885fa56 ObjectCacher::_wait_for_write(): init 'bool done'
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>
2014-05-08 15:54:24 +02:00
Danny Al-Gaaf
8322878c22 Objecter::calc_target(): init best_locality with 0
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>
2014-05-08 15:47:08 +02:00