]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agorbd: check for watchers before trimming an image on 'rbd rm' 1411/head
Ilya Dryomov [Wed, 29 Jan 2014 14:12:01 +0000 (16:12 +0200)]
rbd: check for watchers before trimming an image on 'rbd rm'

Check for watchers before trimming image data to try to avoid getting
into the following situation:

  - user does 'rbd rm' on a mapped image with an fs mounted from it
  - 'rbd rm' trims (removes) all image data, only header is left
  - 'rbd rm' tries to remove a header and fails because krbd has a
    watcher registered on the header
  - at this point image cannot be unmapped because of the mounted fs
  - fs cannot be unmounted because all its data and metadata is gone

Unfortunately, this fix doesn't make it impossible to happen (the
required atomicity isn't there), but it's a big improvement over the
status quo.

Fixes: http://tracker.ceph.com/issues/7076
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
(cherry picked from commit 0a553cfa81b06e75585ab3c39927e307ec0f4cb6)

11 years agoMerge pull request #1407 from dachary/wip-7188-dumpling
Sage Weil [Sun, 9 Mar 2014 17:56:31 +0000 (10:56 -0700)]
Merge pull request #1407 from dachary/wip-7188-dumpling

common: ping existing admin socket before unlink (dumpling)

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agocommon: ping existing admin socket before unlink 1407/head
Loic Dachary [Sat, 15 Feb 2014 10:43:13 +0000 (11:43 +0100)]
common: ping existing admin socket before unlink

When a daemon initializes it tries to create an admin socket and unlinks
any pre-existing file, regardless. If such a file is in use, it causes
the existing daemon to loose its admin socket.

The AdminSocketClient::ping is implemented to probe an existing socket,
using the "0" message. The AdminSocket::bind_and_listen function is
modified to call ping() on when it finds existing file. It unlinks the
file only if the ping fails.

http://tracker.ceph.com/issues/7188 fixes: #7188

Backport: emperor, dumpling
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 45600789f1ca399dddc5870254e5db883fb29b38)

11 years agoMerge pull request #1366 from ceph/wip-6820.dumpling
Sage Weil [Wed, 5 Mar 2014 22:19:31 +0000 (14:19 -0800)]
Merge pull request #1366 from ceph/wip-6820.dumpling

mon: OSDMonitor: don't crash if formatter is invalid during osd crush dump

11 years agoMerge pull request #1377 from ceph/wip-7584
Josh Durgin [Wed, 5 Mar 2014 20:45:57 +0000 (12:45 -0800)]
Merge pull request #1377 from ceph/wip-7584

qa/workunit/rados/test-upgrade-firely.sh

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoqa/workunit/rados/test-upgrade-firely.sh 1377/head
Sage Weil [Wed, 5 Mar 2014 20:37:10 +0000 (12:37 -0800)]
qa/workunit/rados/test-upgrade-firely.sh

Skip the tests that don't pass when run against firefly OSDs.

Fixes: #7584
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1357 from ceph/wip-dumpling-removewq
Samuel Just [Tue, 4 Mar 2014 15:28:44 +0000 (07:28 -0800)]
Merge pull request #1357 from ceph/wip-dumpling-removewq

OSD: ping tphandle during pg removal

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agomon: OSDMonitor: don't crash if formatter is invalid during osd crush dump 1366/head
Joao Eduardo Luis [Fri, 22 Nov 2013 02:17:16 +0000 (02:17 +0000)]
mon: OSDMonitor: don't crash if formatter is invalid during osd crush dump

Code would assume a formatter would always be defined. If a 'plain'
formatter or even an invalid formatter were to be supplied, the monitor
would crash and burn in poor style.

Fixes: 6820
Backport: emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 49d2fb71422fe4edfe5795c001104fb5bc8c98c3)

11 years agoOSD: ping tphandle during pg removal 1357/head
Samuel Just [Tue, 15 Oct 2013 20:11:29 +0000 (13:11 -0700)]
OSD: ping tphandle during pg removal

Fixes: #6528
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c658258d9e2f590054a30c0dee14a579a51bda8c)

Conflicts:
src/osd/OSD.cc

11 years agoMerge pull request #1316 from ceph/dumpling-6922
Samuel Just [Tue, 25 Feb 2014 23:47:05 +0000 (15:47 -0800)]
Merge pull request #1316 from ceph/dumpling-6922

Dumpling: Prevent extreme PG split multipliers

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1315 from ceph/dumpling-hashpspool
Samuel Just [Tue, 25 Feb 2014 23:45:45 +0000 (15:45 -0800)]
Merge pull request #1315 from ceph/dumpling-hashpspool

mon: OSDMonitor: allow (un)setting 'hashpspool' flag via 'osd pool set'

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1314 from ceph/dumpling-osd-pgstatsack
Samuel Just [Tue, 25 Feb 2014 23:44:39 +0000 (15:44 -0800)]
Merge pull request #1314 from ceph/dumpling-osd-pgstatsack

Dumpling osd pgstatsack

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agomon: OSDMonitor: allow (un)setting 'hashpspool' flag via 'osd pool set' 1315/head
Joao Eduardo Luis [Fri, 11 Oct 2013 00:43:48 +0000 (17:43 -0700)]
mon: OSDMonitor: allow (un)setting 'hashpspool' flag via 'osd pool set'

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 1c2886964a0c005545abab0cf8feae7e06ac02a8)

Conflicts:

src/mon/MonCommands.h
src/mon/OSDMonitor.cc

mon: ceph hashpspool false clears the flag
instead of toggling it.
Signed-off-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Christophe Courtaut <christophe.courtaut@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 589e2fa485b94244c79079f249428d4d545fca18

Replace some of the infrastructure required by this command that
was not present in Dumpling with single-use code.
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSDMonitor: use a different approach to prevent extreme multipliers on PG splits 1316/head
Greg Farnum [Tue, 3 Dec 2013 18:57:09 +0000 (10:57 -0800)]
OSDMonitor: use a different approach to prevent extreme multipliers on PG splits

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d8ccd73968fbd0753ca08916ebf1062cdb4d5ac1)

Conflicts:

src/mon/OSDMonitor.cc

11 years agoOSDMonitor: prevent extreme multipliers on PG splits
Greg Farnum [Mon, 2 Dec 2013 23:13:40 +0000 (15:13 -0800)]
OSDMonitor: prevent extreme multipliers on PG splits

Fixes: #6922
Backport: emperor

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit f57dad6461171c903e8b5255eaed300374b00e74)

Conflicts:

src/mon/OSDMonitor.cc

11 years agoOSD: disable the PGStatsAck timeout when we are reconnecting to a monitor 1314/head
Greg Farnum [Wed, 12 Feb 2014 19:30:15 +0000 (11:30 -0800)]
OSD: disable the PGStatsAck timeout when we are reconnecting to a monitor

Previously, the timeout counter started as soon as we issued the reopen,
but if the reconnect process itself took a while, we might time out and
issue another reopen just as we get to the point where it's possible to
get work done. Since the mon client has its own reconnect timeouts (that is,
the OSD doesn't need to trigger those), we instead disable our timeouts
while the reconnect is happening, and then turn them back on again starting
from when we get the reconnect callback.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 64cedf6fa3ee309cc96554286bfb805e4ca89439)

Conflicts:

src/osd/OSD.cc

11 years agomonc: backoff the timeout period when reconnecting
Greg Farnum [Wed, 12 Feb 2014 21:51:48 +0000 (13:51 -0800)]
monc: backoff the timeout period when reconnecting

If the monitors are systematically slowing down, we don't want to spam
them with reconnect attempts every three seconds. Instead, every time
we issue a reconnect, multiply our timeout period by a configurable; when
we complete the connection, reduce that multipler by 50%. This should let
us respond to monitor load.
Of course, we don't want to do that for initial startup in the case of a
couple down monitors, so don't apply the backoff until we've successfully
connected to a monitor at least once.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 794c86fd289bd62a35ed14368fa096c46736e9a2)

11 years agomonc: set "hunting" to true when we reopen the mon session
Greg Farnum [Wed, 12 Feb 2014 21:37:50 +0000 (13:37 -0800)]
monc: set "hunting" to true when we reopen the mon session

If we don't have a connecton to a monitor, we want to retry to another
monitor regardless of whether it's the first time or not.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 60da8abe0ebf17ce818d6fcc6391401878123bb7)

11 years agomonc: let users specify a callback when they reopen their monitor session
Greg Farnum [Wed, 12 Feb 2014 01:53:56 +0000 (17:53 -0800)]
monc: let users specify a callback when they reopen their monitor session

Then the callback is triggered when a new session is established, and the
daemon can do whatever it likes. There are no guarantees about how long it
might take to trigger, though. In particular we call the provided callback
while not holding our own lock in order to avoid deadlock. This could lead
to some funny ordering from the user's perspective if they call
reopen_session() again before getting the callback, but there's no way around
that, so they just have to use it appropriately.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 1a8c43474bf36bfcf2a94bf9b7e756a2a99f33fd)

11 years agorgw: multi object delete should be idempotent
Yehuda Sadeh [Wed, 12 Feb 2014 00:54:05 +0000 (16:54 -0800)]
rgw: multi object delete should be idempotent

Fixes: #7346
When doing a multi object delete, if an object does not exist then we
should return a success code for that object.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 8ca3d95bf633ea9616852cec74f02285a03071d5)

Conflicts:
src/rgw/rgw_op.cc

11 years agov0.67.7 v0.67.7
Ken Dreyer [Wed, 19 Feb 2014 18:09:39 +0000 (18:09 +0000)]
v0.67.7

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
11 years agoradosgw-admin: fix object policy read op
Yehuda Sadeh [Mon, 6 Jan 2014 20:53:58 +0000 (12:53 -0800)]
radosgw-admin: fix object policy read op

Fixes: #7083
This was broken when we fixed #6940. We use the same function to both
read the bucket policy and the object policy. However, each needed to be
treated differently. Restore old behavior for objects.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit b1976dd00f5b29c01791272f63a18250319f2edb)

11 years agoMerge pull request #1243 from dachary/wip-ceph-disk-dumpling
Sage Weil [Sun, 16 Feb 2014 06:20:45 +0000 (22:20 -0800)]
Merge pull request #1243 from dachary/wip-ceph-disk-dumpling

ceph-disk: unit tests (dumpling)

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoadd autotools-generated files to .gitignore
Ken Dreyer [Fri, 3 Jan 2014 23:38:25 +0000 (16:38 -0700)]
add autotools-generated files to .gitignore

When running "make check", Automake generates test-suite.log, along with
various *.log and *.trs files in the tree. Add these files to
.gitignore.

(It looks like this feature arrived in Automake 1.13.)

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
(cherry picked from commit bb8b7503b03fac5830fb71b9723963fdc803ca90)

11 years agoceph-disk: unit tests 1243/head
Loic Dachary [Sat, 15 Feb 2014 17:34:04 +0000 (18:34 +0100)]
ceph-disk: unit tests

src/test/ceph-disk.sh replaces src/test/cli/ceph-disk/data-dir.t

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agoceph-disk: cannot run unit tests
Loic Dachary [Thu, 2 Jan 2014 21:42:17 +0000 (22:42 +0100)]
ceph-disk: cannot run unit tests

Because ceph-disk relies on hardcoded paths. The corresponding test will
be added back when ceph-disk can run from sources.

Fixes: #7085
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 2ba6930d62263a39f150ab43bf8cd860b9245188)

11 years agoRevert "librbd: remove limit on number of objects in the cache"
Sage Weil [Sat, 15 Feb 2014 07:52:06 +0000 (23:52 -0800)]
Revert "librbd: remove limit on number of objects in the cache"

This reverts commit 367cf1bbf86233eb20ff2304e7d6caab77b84fcc.

Removing the limit on objects means we leak memory, since Objects without
any buffers can exist in the cache.

11 years agoos/FileStore: fix ENOENT error code for getattrs()
Sage Weil [Mon, 7 Oct 2013 12:22:20 +0000 (05:22 -0700)]
os/FileStore: fix ENOENT error code for getattrs()

In commit dc0dfb9e01d593afdd430ca776cf4da2c2240a20 the omap xattrs code
moved up a block and r was no longer local to the block.  Translate
ENOENT -> 0 to compensate.

Fix the same error in _rmattrs().

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 6da4b91c07878e07f23eee563cf1d2422f348c2f)

11 years agotest/filestore/run_seed_to.sh: avoid obsolete --filestore-xattr-use-omap
Sage Weil [Tue, 15 Oct 2013 23:00:26 +0000 (16:00 -0700)]
test/filestore/run_seed_to.sh: avoid obsolete --filestore-xattr-use-omap

This option no longer exists.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 1d4f501a015727a7ff4b2f9b20dc91f2bbd9707b)

11 years agorelease build 67.6 v0.67.6
Alfredo Deza [Thu, 13 Feb 2014 20:20:42 +0000 (20:20 +0000)]
release build 67.6

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
11 years agoMerge pull request #1232 from ceph/dumpling-7334
Sage Weil [Thu, 13 Feb 2014 14:55:37 +0000 (06:55 -0800)]
Merge pull request #1232 from ceph/dumpling-7334

backport ceph-disk improvements to dumpling

http://pulpito.ceph.com/ubuntu-2014-02-12_16:52:33-ceph-deploy-dumpling-7334-testing-basic-plana/

11 years agocommon,os: Remove filestore_xattr_use_omap option 1226/head
David Zafman [Fri, 27 Sep 2013 23:23:09 +0000 (16:23 -0700)]
common,os: Remove filestore_xattr_use_omap option

Now we operate just like when this was set to true

Fixes: #6143
Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit dc0dfb9e01d593afdd430ca776cf4da2c2240a20)

11 years agoadd support for absence of PATH 1232/head
Alfredo Deza [Wed, 12 Feb 2014 21:43:59 +0000 (16:43 -0500)]
add support for absence of PATH

Note that this commit is actually bisecting the changes from
Loic Dachary that touch ceph-disk only (ad515bf). As that changeset
also touches other files it causes conflicts that are not resolvable
for backporting it to dumpling.

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
11 years agoceph-disk: make initial journal files 0 bytes
Sage Weil [Tue, 10 Sep 2013 05:27:23 +0000 (22:27 -0700)]
ceph-disk: make initial journal files 0 bytes

The ceph-osd will resize journal files up and properly fallocate() them
so that the blocks are preallocated and (hopefully) contiguous.  We
don't need to do it here too, and getting fallocate() to work from
python is a pain in the butt.

Fixes: #5981
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a786ad773cd33880075f1deb3691528d1afd03ec)

11 years agoalert the user about error messages from partx
Alfredo Deza [Mon, 10 Feb 2014 20:07:55 +0000 (15:07 -0500)]
alert the user about error messages from partx

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e)

11 years agouse partx for red hat or centos instead of partprobe
Alfredo Deza [Fri, 7 Feb 2014 16:55:01 +0000 (11:55 -0500)]
use partx for red hat or centos instead of partprobe

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 42900ff9da9f5adcac239a84ebf4d2e407c29699)

11 years agoceph-disk: run the right executables from udev
Josh Durgin [Wed, 29 Jan 2014 01:26:58 +0000 (17:26 -0800)]
ceph-disk: run the right executables from udev

When run by the udev rules, PATH is not defined. Thus,
ceph-disk-activate relies on its which() function to locate the
correct executable.  The which() function used os.defpath if none was
set, and this worked for anything using it.

ad6b4b4b08b6ef7ae8086f2be3a9ef521adaa88c added a new default value to
PATH, so only /usr/bin was checked by callers that did not use
which(). This resulted in the mount command not being found when
ceph-disk-activate was run by udev, and thus osds failing to start
after being prepared by ceph-deploy.

Make ceph-disk consistently use the existing helpers (command() and
command_check_call()) that use which(), so lack of PATH does not
matter. Simplify _check_output() to use command(),
another wrapper around subprocess.Popen.

Fixes: #7258
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit d7b0c7faafd37e4ae8a1680edfa60c22b419cbd8)

11 years agoceph-disk: implement --sysconfdir as /etc/ceph
Loic Dachary [Fri, 3 Jan 2014 15:06:55 +0000 (16:06 +0100)]
ceph-disk: implement --sysconfdir as /etc/ceph

Replace hardcoded /etc/ceph with the SYSCONFDIR global variable and
implement the --sysconfdir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit a71025d33621257b6fd6632516cfed2849ff1637)

11 years agoceph-disk: implement --statedir as /var/lib/ceph
Loic Dachary [Fri, 3 Jan 2014 15:03:09 +0000 (16:03 +0100)]
ceph-disk: implement --statedir as /var/lib/ceph

Replace hardcoded /var/lib/ceph with the STATEDIR global variable and
implement the --statedir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit ca713f48ae7a1fece2869f1a1c97d23ab33fb441)

11 years agoceph-disk: add copyright notice
Loic Dachary [Wed, 1 Jan 2014 21:05:03 +0000 (22:05 +0100)]
ceph-disk: add copyright notice

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 51ee3c04777aaf6b9609dde9bc318b5c66c70787)

11 years agoceph-disk: create the data directory if it does not exist
Loic Dachary [Wed, 1 Jan 2014 21:11:30 +0000 (22:11 +0100)]
ceph-disk: create the data directory if it does not exist

Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 306b099ab093bfac466d68fe1cb87367bc01e577)

11 years agoceph-disk: run ceph-osd when --mark-init=none
Loic Dachary [Mon, 30 Dec 2013 23:03:42 +0000 (00:03 +0100)]
ceph-disk: run ceph-osd when --mark-init=none

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 0fcc081858fae4febbb6a613a93cfbbcedd5a320)

11 years agoceph-disk: implement --mark-init=none
Loic Dachary [Mon, 30 Dec 2013 22:57:39 +0000 (23:57 +0100)]
ceph-disk: implement --mark-init=none

It is meant to be used when preparing and activating a directory that is
not to be used with init. No file is created to identify the init
system, no symbolic link is made to the directory in /var/lib/ceph
and the init scripts are not called.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit e773b68f4c89ac56b425c710d7dcdc3d74a92926)

11 years agoceph-disk: fsid is a known configuration option
Loic Dachary [Wed, 1 Jan 2014 21:07:57 +0000 (22:07 +0100)]
ceph-disk: fsid is a known configuration option

Use get_conf_with_default instead of get_conf because fsid is a known
ceph configuration option. It allows overriding via CEPH_ARGS which is
convenient for testing. Only options that are not found in config_opts.h
are fetch via get_conf.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit b65eb377f5e93ea85644e4c0939365fd7ac36072)

11 years agoceph-disk: use CalledProcessError.returncode
Loic Dachary [Wed, 1 Jan 2014 21:06:29 +0000 (22:06 +0100)]
ceph-disk: use CalledProcessError.returncode

CalledProcessError has no errno data member

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 97f516a1ddfb2d014e1f7e762c4155e4b9bcb90b)

11 years agoceph-disk: display the command output on OSD creation failure
Loic Dachary [Wed, 1 Jan 2014 21:13:15 +0000 (22:13 +0100)]
ceph-disk: display the command output on OSD creation failure

The string form of a CalledProcessError instance does not include the
output datamember. Add it to the Error exception for debug purposes.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit d09af0fa50f322c9e59765f3badd497f5ca184d4)

11 years agoceph-disk: which() uses PATH first
Loic Dachary [Mon, 30 Dec 2013 22:07:27 +0000 (23:07 +0100)]
ceph-disk: which() uses PATH first

Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 2b935bbf60bafb6dd488c0eb30f156fce1b9d197)

11 years agoceph-disk: add --prepend-to-path to control execution
Loic Dachary [Mon, 30 Dec 2013 21:48:46 +0000 (22:48 +0100)]
ceph-disk: add --prepend-to-path to control execution

/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.

The hardcoded path cannot be removed altogether because it will most
likely lead to unexpected and difficult to diagnose problems for
existing installations where the PATH finds the program elsewhere.

The --prepend-to-path flag is added and defaults to /usr/bin : it prepends
to the PATH environment variable. The hardcoded path is removed
and the PATH will be used: since /usr/bin is searched first, the
legacy behavior will not change.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit ad6b4b4b08b6ef7ae8086f2be3a9ef521adaa88c)

11 years agoceph-disk: make exception handling terse in main_activate_journal
Loic Dachary [Mon, 30 Dec 2013 16:15:29 +0000 (17:15 +0100)]
ceph-disk: make exception handling terse in main_activate_journal

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 908348b8047e8577ecf9133f2683f91423694416)

11 years agoceph-disk: do not hide main_activate() exceptions
Loic Dachary [Mon, 30 Dec 2013 16:13:47 +0000 (17:13 +0100)]
ceph-disk: do not hide main_activate() exceptions

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 55ca7bb2da73f1be1293710a635cfea42abd7682)

11 years agoceph-disk: fix activate() indent
Loic Dachary [Mon, 30 Dec 2013 16:11:30 +0000 (17:11 +0100)]
ceph-disk: fix activate() indent

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 324804a81c37ff89f2488e2ba106033c0e6e119e)

11 years agoceph-disk: remove noop try:
Loic Dachary [Mon, 30 Dec 2013 16:09:35 +0000 (17:09 +0100)]
ceph-disk: remove noop try:

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit de0050596b5f56863c3486c1cd5e7ffea62e3d00)

11 years agoceph-disk: fix Error() messages formatting
Loic Dachary [Mon, 30 Dec 2013 15:57:36 +0000 (16:57 +0100)]
ceph-disk: fix Error() messages formatting

Mainly using % instead of ,

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit b82ccfbfa786cd5436b48ec38276c5a48028ce1d)

11 years agoceph-disk: prepare --data-dir must not override files
Loic Dachary [Mon, 30 Dec 2013 11:26:20 +0000 (12:26 +0100)]
ceph-disk: prepare --data-dir must not override files

ceph-disk does nothing when given a device that is already prepared. If
given a directory that already contains a successfully prepared OSD, it
will however override it.

Instead of overriding the files in the osd data directory, return
immediately if the magic file exists. Make it so the magic file is
created last to accurately reflect the success of the OSD preparation.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 7dfe550ce18623cde4ae43a2416e31ef81381ab9)

11 years agoceph-disk: zap needs at least one device
Loic Dachary [Sun, 15 Dec 2013 14:34:17 +0000 (15:34 +0100)]
ceph-disk: zap needs at least one device

If given no argument, ceph-disk zap should display the usage instead of
silently doing nothing. Silence can be confused with "I zapped all the
disks".

http://tracker.ceph.com/issues/6981 fixes #6981

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 07888ef3fd4440332c8287d0faa9f23a32cf141c)

11 years agouse the new get_command helper in check_call
Alfredo Deza [Fri, 13 Dec 2013 17:06:25 +0000 (12:06 -0500)]
use the new get_command helper in check_call

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 897dfc113fe3b86f3dda53172933bfd4f8089869)

11 years agouse the absolute path for executables if found
Alfredo Deza [Thu, 12 Dec 2013 16:16:38 +0000 (11:16 -0500)]
use the absolute path for executables if found

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit a9334a1c8c6681305e76b361377864d0dd1e3d34)

11 years agoremove trailing semicolon
Alfredo Deza [Thu, 12 Dec 2013 15:26:05 +0000 (10:26 -0500)]
remove trailing semicolon

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 43561f791607f5fd6f03d5421e1f30a29fb4194e)

11 years agoreplace sgdisk subprocess calls with a helper
Alfredo Deza [Wed, 11 Dec 2013 20:41:45 +0000 (15:41 -0500)]
replace sgdisk subprocess calls with a helper

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit e19e38012bc4579054f63865e682c8c3a7829c7b)

11 years agoCall --mbrtogpt on journal run of sgdisk should the drive require a GPT table.
Jonathan Davies [Tue, 3 Dec 2013 21:26:43 +0000 (21:26 +0000)]
Call --mbrtogpt on journal run of sgdisk should the drive require a GPT table.

Signed-off-by: Jonathan Davies <jonathan.davies@canonical.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 35011e0b01d65e4c001876882d597451f2028345)

11 years agoceph-disk: blacklist /dev/fd0
Loic Dachary [Thu, 21 Nov 2013 12:21:22 +0000 (13:21 +0100)]
ceph-disk: blacklist /dev/fd0

blkid -s TYPE /dev/fd0 has been verified to hang forever on a
H8DMR-82 supermicro motherboard running

3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013
x86_64

It is unlikely that ceph will ever be used on floppy disks, they
can be blacklisted.

http://tracker.ceph.com/issues/6827 fixes: #6827

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 65701978715237ff5a4c68573c0696fd9d438e4f)

11 years agoMake fsid comparison case-insensitive
git-harry [Thu, 3 Oct 2013 09:32:50 +0000 (10:32 +0100)]
Make fsid comparison case-insensitive

get_fsid and find_cluster_by_uuid are modified so ceph-disk activate and
ceph-disk activate-all will work if the fsid uses uppercase characters.

Signed-off-by: Harry Harrington <git-harry@live.co.uk>
(cherry picked from commit 22f8325dbfce7ef2e97bf015c0f8bba53e75dfe9)

11 years agolibrbd: remove limit on number of objects in the cache
Josh Durgin [Tue, 11 Feb 2014 18:14:36 +0000 (10:14 -0800)]
librbd: remove limit on number of objects in the cache

The number of objects is not a significant indicated of when data
should be written out for rbd. Use the highest possible value for
number of objects and just rely on the dirty data limits to trigger
flushing. When the number of objects is low, and many start being
flushed before they accumulate many requests, it hurts average request
size and performance for many concurrent sequential writes.

Fixes: #7385
Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 0559d31db29ea83bdb6cec72b830d16b44e3cd35)

11 years agoObjectCacher: use uint64_t for target and max values
Josh Durgin [Tue, 11 Feb 2014 19:53:00 +0000 (11:53 -0800)]
ObjectCacher: use uint64_t for target and max values

All the options are uint64_t, but the ObjectCacher was converting them
to int64_t. There's never any reason for these to be negative, so
change the type.

Adjust a few conditionals so that they only convert known-positive
signed values to uint64_t before comparing with the target and max
values. Leave the actual stats accounting as loff_t for now, since
bugs in accounting will have bad effects if negative values wrap
around.

Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit db034acf546a72739ff6543241543f3bd651f3ae)

11 years agoObjectCacher: remove max_bytes and max_ob arguments to trim()
Josh Durgin [Tue, 11 Feb 2014 18:35:14 +0000 (10:35 -0800)]
ObjectCacher: remove max_bytes and max_ob arguments to trim()

These are never passed, so replace them with the defaults.

Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit bf8cf2d6d21a204a099347f3dcd5b48100b8c445)

11 years agoMerge pull request #1210 from dachary/dumpling
Sage Weil [Tue, 11 Feb 2014 16:32:37 +0000 (08:32 -0800)]
Merge pull request #1210 from dachary/dumpling

common: admin socket fallback to json-pretty format (dumpling)

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agocommon: admin socket fallback to json-pretty format 1210/head
Loic Dachary [Mon, 10 Feb 2014 22:42:38 +0000 (23:42 +0100)]
common: admin socket fallback to json-pretty format

If the format argument to a command sent to the admin socket is not
among the supported formats ( json, json-pretty, xml, xml-pretty ) the
new_formatter function will return null and the AdminSocketHook::call
function must fall back to a sensible default.

The CephContextHook::call and HelpHook::call failed to do that and a
malformed format argument would cause the mon to crash. A check is added
to each of them and fallback to json-pretty if the format is not
recognized.

To further protect AdminSocketHook::call implementations from similar
problems the format argument is checked immediately after accepting the
command in AdminSocket::do_accept and replaced with json-pretty if it is
not known.

A test case is added for both CephContextHook::call and HelpHook::call
to demonstrate the problem exists and is fixed by the patch.

Three other instances of unsafe calls to new_formatter were found and
a fallback to json-pretty was added. All other calls have been audited
and appear to be safe.

http://tracker.ceph.com/issues/7378 fixes #7378

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 165e76d4d03ffcc490fd3c2ba60fb37372990d0a)

11 years agoqa: add script for testing rados client timeout options
Josh Durgin [Thu, 6 Feb 2014 01:26:02 +0000 (17:26 -0800)]
qa: add script for testing rados client timeout options

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 9e62beb80b6c92a97ec36c0db5ea39e417661b35)

11 years agorados: check return values for commands that can now fail
Josh Durgin [Thu, 6 Feb 2014 01:25:24 +0000 (17:25 -0800)]
rados: check return values for commands that can now fail

A few places were not checking the return values of commands, since
they could not fail before timeouts were added.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 79c1874346ff55e2dc74ef860db16ce70242fd00)

11 years agolibrados: check and return on error so timeouts work
Josh Durgin [Thu, 6 Feb 2014 01:24:16 +0000 (17:24 -0800)]
librados: check and return on error so timeouts work

Some functions could not previously return errors, but they had an
int return value, which can now receive ETIMEDOUT.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 8e9459e897b1bc2f97d52ee07701fd22069efcf3)

11 years agomsg/Pipe: add option to restrict delay injection to specific msg type
Josh Durgin [Thu, 6 Feb 2014 01:22:14 +0000 (17:22 -0800)]
msg/Pipe: add option to restrict delay injection to specific msg type

This makes it possible to test timeouts reliably by delaying certain
messages effectively forever, but still being able to e.g. connect and
authenticate to the monitors.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit d389e617c1019e44848330bf9570138ac7b0e5d4)

11 years agoMonClient: add a timeout on commands for librados
Josh Durgin [Tue, 4 Feb 2014 02:30:00 +0000 (18:30 -0800)]
MonClient: add a timeout on commands for librados

Just use the conf option directly, since librados is the only caller.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 671a76d64bc50e4f15f4c2804d99887e22dcdb69)

11 years agoObjecter: implement mon and osd operation timeouts
Josh Durgin [Tue, 4 Feb 2014 01:59:21 +0000 (17:59 -0800)]
Objecter: implement mon and osd operation timeouts

This captures almost all operations from librados other than mon_commands().

Get the values for the timeouts from the Objecter constructor, so only
librados uses them.

Add C_Cancel_*_Op, finish_*_op(), and *_op_cancel() for each type of
operation, to mirror those for Op. Create a callback and schedule it
in the existing timer thread if the timeouts are specified.

Fixes: #6507
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3e1f7bbb4217d322f4e0ece16e676cd30ee42a20)

Conflicts:
src/osd/OSD.cc
src/osd/ReplicatedPG.cc
src/osdc/Objecter.cc
src/osdc/Objecter.h

11 years agolibrados: add timeout to wait_for_osdmap()
Josh Durgin [Mon, 3 Feb 2014 20:53:15 +0000 (12:53 -0800)]
librados: add timeout to wait_for_osdmap()

This is used by several pool operations independent of the objecter,
including rados_ioctx_create() to look up the pool id in the first
osdmap.

Unfortunately we can't just rely on WaitInterval returning ETIMEDOUT,
since it may also get interrupted by a signal, so we can't avoid
keeping track of time explicitly here.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 1829d2c9fd13f2cbae4e192c9feb553047dad42c)

Conflicts:
src/librados/RadosClient.cc

11 years agoconf: add options for librados timeouts
Josh Durgin [Mon, 3 Feb 2014 20:09:34 +0000 (12:09 -0800)]
conf: add options for librados timeouts

These will be implemented in subsequent patches.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 0dcceff1378d85ca6d81d102d201890b8a71af6b)

11 years agotest_striper: fix warning
Sage Weil [Mon, 10 Feb 2014 04:53:00 +0000 (20:53 -0800)]
test_striper: fix warning

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocrushtool: add cli test for off-by-one tries vs retries bug
Sage Weil [Sat, 8 Feb 2014 20:21:26 +0000 (12:21 -0800)]
crushtool: add cli test for off-by-one tries vs retries bug

See bug #7370.  This passes on dumpling and breaks prior to the #7370 fix.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit ed32c4002fb5cb1dd546331651eaf7de1a017471)

11 years agoclient: use 64-bit value in sync read eof logic
Sage Weil [Mon, 3 Feb 2014 16:54:14 +0000 (08:54 -0800)]
client: use 64-bit value in sync read eof logic

The file size can jump to a value that is very much larger than our current
position (for example, it could be a disk image file that gets a sparse
write at a large offset).  Use a 64-bit value so that 'some' doesn't
overflow.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: John Spray <john.spray@inktank.com>
(cherry picked from commit 7ff2b541c24d1c81c3bcfbcb347694c2097993d7)

11 years agoosd: do not send peering messages during init
Sage Weil [Sun, 5 Jan 2014 06:39:35 +0000 (22:39 -0800)]
osd: do not send peering messages during init

Do not send any peering messages while we are still working our way
through init().

Fixes: #7093
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 35da8f9d80e0c6c33fb6c6e00f0bf38f1eb87d0e)
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSDMap: fix deepish_copy_from
Sage Weil [Wed, 29 Jan 2014 02:46:37 +0000 (18:46 -0800)]
OSDMap: fix deepish_copy_from

Start with a shallow copy!

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d0f13f54146694a197535795da15b8832ef4b56f)

Conflicts:

src/osd/OSDMap.h

11 years agorgw: fix listing of multipart upload parts
Yehuda Sadeh [Thu, 23 Jan 2014 21:48:28 +0000 (13:48 -0800)]
rgw: fix listing of multipart upload parts

Fixes: #7169
There are two issues here. One is that we may return more entries than
we should (as specified by max_parts). Second issue is that the
NextPartNumberMarker is set incorrectly. Both of these issues mainly
affect uploads with > 1000 parts, although can be triggered with less
than that.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: initialize RGWUserAdminOpState::system_specified
Yehuda Sadeh [Thu, 21 Nov 2013 14:52:48 +0000 (06:52 -0800)]
rgw: initialize RGWUserAdminOpState::system_specified

Fixes: #6829
Backport: dumpling, emperor
We didn't init this member variable, which might cause that when
modifying user info that has this flag set the 'system' flag might
inadvertently reset.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 561e7b0b287e65e90b80699e45a52ae44e94684f)

11 years agorgw: Fix CORS allow-headers validation
Robin H. Johnson [Sun, 15 Dec 2013 20:26:19 +0000 (12:26 -0800)]
rgw: Fix CORS allow-headers validation

This fix is needed because Ceph presently validates CORS headers in a
case-sensitive manner. Keeps a local cache of lowercased allowed headers
to avoid converting the allowed headers to lowercase each time.

CORS 6.2.6: If any of the header field-names is not a ASCII
case-insensitive match for any of the values in list of headers do not
set any additional headers and terminate this set of steps.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 31b60bfd9347a386ff12b4e4f1812d664bcfff01)

11 years agorgw: Clarify naming of case-change functions
Robin H. Johnson [Sun, 15 Dec 2013 19:40:31 +0000 (11:40 -0800)]
rgw: Clarify naming of case-change functions

It is not clear that the lowercase_http_attr & uppercase_http_attr
functions replace dashes with underscores. Rename them to match the
pattern established by the camelcase_dash_http_attr function in
preperation for more case-change functions as needed by later fixes.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 6a7edab2673423c53c6a422a10cb65fe07f9b235)

11 years agorgw: Look at correct header about headers for CORS
Robin H. Johnson [Sun, 15 Dec 2013 19:27:49 +0000 (11:27 -0800)]
rgw: Look at correct header about headers for CORS

The CORS standard dictates that preflight requests are made with the
Access-Control-Request-Headers header containing the headers of the
author request. The Access-Control-Allow-Headers header is sent in the
response.

The present code looks for Access-Control-Allow-Headers in request, so
fix it to look at Access-Control-Request-Headers instead.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 2abacd9678ae04cefac457882ba718a454948915)

11 years agorgw: fix reading bucket policy in RGWBucket::get_policy()
Yehuda Sadeh [Fri, 6 Dec 2013 19:07:09 +0000 (11:07 -0800)]
rgw: fix reading bucket policy in RGWBucket::get_policy()

Fixes: 6940
Backport: dumpling, emperor

We changed the way we keep the bucket policy, and we shouldn't try to
access the bucket object directly. This had changed when we added the
bucket instance object around dumpling.

Reported-by: Gao, Wei M <wei.m.gao@intel.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 7a9a088d82d04f6105d72f6347673724ac16c9f8)

11 years agorgw: handle racing object puts when object doesn't exist
Yehuda Sadeh [Thu, 16 Jan 2014 19:45:27 +0000 (11:45 -0800)]
rgw: handle racing object puts when object doesn't exist

If the object didn't exist before and now we have multiple puts coming
in concurrently, we need to make sure that we behave correctly. Only one
needs to win, the other one can fail silently. We do that by setting
exclusive flag on the object creation and handling the error correctly.
Note that we still want to return -EEXIST in some cases (when the
exclusive flag is passed to put_obj_meta(), e.g., on bucket creation).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 86c15480fc3e33b9a3b84d0af68d8398fc732bae)

11 years agorgw: don't return -ENOENT in put_obj_meta()
Yehuda Sadeh [Thu, 16 Jan 2014 19:33:49 +0000 (11:33 -0800)]
rgw: don't return -ENOENT in put_obj_meta()

Fixes: #7168
An object put may race with the same object's delete. In this case just
ignore the error, same behavior as if object was created and then
removed.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 5c24a7ea905587fd4077e3b0cfc0f5ad2b178c29)

11 years agorgw: Use correct secret key for POST authn
Robin H. Johnson [Sun, 19 Jan 2014 02:01:20 +0000 (18:01 -0800)]
rgw: Use correct secret key for POST authn

The POST authentication by signature validation looked up a user based
on the access key, then used the first secret key for the user. If the
access key used was not the first access key, then the expected
signature would be wrong, and the POST would be rejected.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
(cherry picked from commit 586ad1f69e6260ef298805647911b3b49f8be7cf)

11 years agoosd: OSDMonitor: ignore pgtemps from removed pool
Joao Eduardo Luis [Tue, 28 Jan 2014 15:54:33 +0000 (15:54 +0000)]
osd: OSDMonitor: ignore pgtemps from removed pool

There's a window in-between receiving an MOSDPGTemp message from an OSD
and actually handling it that may lead to the pool the pg temps refer to
no longer existing. This may happen if the MOSDPGTemp message is queued
pending dispatching due to an on-going proposal (maybe even the pool
removal).

This patch fixes such behavior in two steps:

1. Check if the pool exists in the osdmap upon preprocessing
 - if pool does not exist in the osdmap, then the pool must have been
   removed prior to handling the message, but after the osd sent it.
 - safe to ignore the pg update
2. If all pg updates in the message have been ignored, ignore the whole
   message.  Otherwise, let prepare handle the rest.

3. Recheck if pool exists in the osdmap upon prepare
 - We may have ignored this pg back in preprocess, but other pgs in the
   message may have led the message to be passed on to prepare; ignore
   pg update once more.
4. Check if pool is pending removal and ignore pg update if so.

We delegate checking the pending value to prepare_pgtemp() because in this
case we should only ignore the update IFF the pending value is in fact
committed.  Otherwise we should retry the message.  prepare_pgtemp() is
the appropriate place to do so.

Fixes: 7116
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit f513f66f48383a07c70ca18a4dba6c2449ea9860)

11 years agoOSDMonitor: use deepish_copy_from for remove_down_pg_temp
Sage Weil [Tue, 28 Jan 2014 19:00:34 +0000 (11:00 -0800)]
OSDMonitor: use deepish_copy_from for remove_down_pg_temp

This is a backport of 368852f6c0a884b8fdc80a5cd6f9ab72e814d412.

Make a deep copy of the OSDMap to avoid clobbering the in-memory copy with
the call to apply_incremental.

Fixes: #7060
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoOSDMap: deepish_copy_from()
Sage Weil [Fri, 24 Jan 2014 19:03:26 +0000 (11:03 -0800)]
OSDMap: deepish_copy_from()

Make a deep(ish) copy of another OSDMap.  Unfortunatley we can't make the
compiler-generated copy operator/constructors private until c++11.  :(

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit bd54b9841b9255406e56cdc7269bddb419453304)

11 years agobuffer: make 0-length splice() a no-op
Sage Weil [Tue, 28 Jan 2014 18:26:12 +0000 (10:26 -0800)]
buffer: make 0-length splice() a no-op

This was causing a problem in the Striper, but fixing it here will avoid
corner cases all over the tree.  Note that we have to bail out before
the end-of-buffer check to avoid hitting that check when the bufferlist is
also empty.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit ff5abfbdae07ae8a56fa83ebaa92000896f793c2)

11 years agoosdc/Striper: test zero-length add_partial_result
Sage Weil [Tue, 28 Jan 2014 18:09:17 +0000 (10:09 -0800)]
osdc/Striper: test zero-length add_partial_result

If we add a partial result that is 0-length, we used to hit an assert in
buffer::list::splice().  Add a unit test to verify the fix.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 28c7388d320a47657c2e12c46907f1bf40672b08)

11 years agopackaging: apply udev hack rule to RHEL
Derek Yarnell [Mon, 27 Jan 2014 19:27:51 +0000 (12:27 -0700)]
packaging: apply udev hack rule to RHEL

In the RPM spec file there is a test to deploy the uuid hack udev rules
for older udev operating systems. This includes CentOS and RHEL, but the
check currently only is for CentOS, causing RHEL clients to get a bogus
osd rules file.

Adjust the conditional to apply to RHEL as well as CentOS. (The %{rhel}
macro is defined in both platforms' redhat-rpm-config package.)

Fixes http://tracker.ceph.com/issues/7245

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
(cherry picked from commit 64a0b4fa563795bc22753940aa3a4a2946113109)

11 years agoMerge pull request #1129 from ceph/wip-dumpling-backport-6620
Sage Weil [Thu, 23 Jan 2014 15:12:37 +0000 (07:12 -0800)]
Merge pull request #1129 from ceph/wip-dumpling-backport-6620

mds: MDSMap: adjust buffer size for uint64 values with more than 5 chars

11 years agomds: MDSMap: adjust buffer size for uint64 values with more than 5 chars 1129/head
Joao Eduardo Luis [Thu, 23 Jan 2014 11:36:16 +0000 (11:36 +0000)]
mds: MDSMap: adjust buffer size for uint64 values with more than 5 chars

Fixes: #6620
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 0e8182edd850f061421777988974efbaa3575b9f)

11 years agomon/MDSMonitor: do not generate mdsmaps from already-laggy mds
Sage Weil [Tue, 21 Jan 2014 19:29:56 +0000 (11:29 -0800)]
mon/MDSMonitor: do not generate mdsmaps from already-laggy mds

There is one path where a mds that is not sending its beacon (e.g.,
because it is not running at all) will lead to proposal of new mdsmaps.
Fix it.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 584c2dd6bea3fe1a3c7f306874c054ce0cf0d2b5)

11 years agoFix #7187: Include all summary items in JSON health output
John Spray [Mon, 20 Jan 2014 11:08:27 +0000 (11:08 +0000)]
Fix #7187: Include all summary items in JSON health output

Signed-off-by: John Spray <john.spray@inktank.com>
(cherry picked from commit fdf3b5520d150f14d90bdfc569b70c07b0579b38)

11 years agorgw: convert bucket info if needed
Yehuda Sadeh [Tue, 7 Jan 2014 02:32:42 +0000 (18:32 -0800)]
rgw: convert bucket info if needed

Fixes: #7110
In dumpling, the bucket info was separated into bucket entry point and
bucket instance objects. When setting bucket attrs we only ended up
updating the bucket instance object. However, pre-dumpling buckets still
keep everything at the entry-point object, so acl changes didn't affect
anything (because we never updated the entry point). This change just
converts the bucket info into the new format.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit a5f8cc7ec9ec8bef4fbc656066b4d3a08e5b215b)