]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agorgw/rgw_rados.cc: use empty() instead of checking for size() > 0 bobtail 18054/head
Danny Al-Gaaf [Fri, 12 Jul 2013 10:08:52 +0000 (12:08 +0200)]
rgw/rgw_rados.cc: use empty() instead of checking for size() > 0

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 22e0dbbd0e6b6a0fc3b49018d0a5d91ce54aca1b)

11 years agorgw: fix get_obj() with zero sized obj
Yehuda Sadeh [Thu, 18 Apr 2013 20:30:45 +0000 (13:30 -0700)]
rgw: fix get_obj() with zero sized obj

Now that even zero sized objs have manifest a
test had to be modified.

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

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 agorgw: fix authenticated users acl group check
Yehuda Sadeh [Tue, 15 Oct 2013 17:20:48 +0000 (10:20 -0700)]
rgw: fix authenticated users acl group check

Fixes: #6553
Backport: bobtail, cuttlefish, dumpling
Authenticated users group acl bit was not working correctly. Check to
test whether user is anonymous was wrong.

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

11 years agorgw: don't call list::size() in ObjectCache
Yehuda Sadeh [Thu, 12 Sep 2013 05:30:12 +0000 (22:30 -0700)]
rgw: don't call list::size() in ObjectCache

Fixes: #6286
Use an external counter instead of calling list::size()

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 31e3a51e933429d286104fe077e98ea883437ad6)

11 years agorgw: drain pending requests before completing write
Yehuda Sadeh [Tue, 10 Sep 2013 19:18:55 +0000 (12:18 -0700)]
rgw: drain pending requests before completing write

Fixes: #6268
When doing aio write of objects (either regular or multipart parts) we
need to drain pending aio requests. Otherwise if gateway goes down then
object might end up corrupted.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: check object name after rebuilding it in S3 POST
Yehuda Sadeh [Tue, 27 Aug 2013 02:46:43 +0000 (19:46 -0700)]
rgw: check object name after rebuilding it in S3 POST

Fixes: #6088
Backport: bobtail, cuttlefish, dumpling

When posting an object it is possible to provide a key
name that refers to the original filename, however we
need to verify that in the end we don't end up with an
empty object name.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit c8ec532fadc0df36e4b265fe20a2ff3e35319744)

11 years agoupstart: handle upper case in cluster name and id
Alexandre Marangone [Fri, 31 May 2013 19:33:11 +0000 (12:33 -0700)]
upstart: handle upper case in cluster name and id

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
(cherry picked from commit 851619ab6645967e5d7659d9b0eea63d5c402b15)

11 years agov0.56.7 v0.56.7
Gary Lowell [Tue, 27 Aug 2013 17:44:32 +0000 (10:44 -0700)]
v0.56.7

11 years agoobjecter: resend unfinished lingers when osdmap is no longer paused
Josh Durgin [Wed, 21 Aug 2013 21:28:49 +0000 (14:28 -0700)]
objecter: resend unfinished lingers when osdmap is no longer paused

Plain Ops that haven't finished yet need to be resent if the osdmap
transitions from full or paused to unpaused.  If these Ops are
triggered by LingerOps, they will be cancelled instead (since
should_resend = false), but the LingerOps that triggered them will not
be resent.

Fix this by checking the registered flag for all linger ops, and
resending any of them that aren't paused anymore.

Fixes: #6070
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
(cherry picked from commit 38a0ca66a79af4b541e6322467ae3a8a4483cc72)

11 years agolibrados: fix async aio completion wakeup
Sage Weil [Tue, 13 Aug 2013 19:52:41 +0000 (12:52 -0700)]
librados: fix async aio completion wakeup

For aio flush, we register a wait on the most recent write.  The write
completion code, however, was *only* waking the waiter if they were waiting
on that write, without regard to previous writes (completed or not).
For example, we might have 6 and 7 outstanding and wait on 7.  If they
finish in order all is well, but if 7 finishes first we do the flush
completion early.  Similarly, if we

 - start 6
 - start 7
 - finish 7
 - flush; wait on 7
 - finish 6

we can hang forever.

Fix by doing any completions that are prior to the oldest pending write in
the aio write completion handler.

Refs: #5919

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Tested-by: Oliver Francke <Oliver.Francke@filoo.de>
(cherry picked from commit 16ed0b9af8bc08c7dabead1c1a7c1a22b1fb02fb)

11 years agolibrados: fix locking for AioCompletionImpl refcounting
Josh Durgin [Tue, 13 Aug 2013 02:17:09 +0000 (19:17 -0700)]
librados: fix locking for AioCompletionImpl refcounting

Add an already-locked helper so that C_Aio{Safe,Complete} can
increment the reference count when their caller holds the
lock. C_AioCompleteAndSafe's caller is not holding the lock, so call
regular get() to ensure no racing updates can occur.

This eliminates all direct manipulations of AioCompletionImpl->ref,
and makes the necessary locking clear.

The only place C_AioCompleteAndSafe is used is in handling
aio_flush_async(). This could cause a missing completion.

Refs: #5919
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Tested-by: Oliver Francke <Oliver.Francke@filoo.de>
(cherry picked from commit 7a52e2ff5025754f3040eff3fc52d4893cafc389)

12 years agorgw: fix multi delete
Yehuda Sadeh [Mon, 12 Aug 2013 17:05:44 +0000 (10:05 -0700)]
rgw: fix multi delete

Fixes: #5931
Backport: bobtail, cuttlefish

Fix a bad check, where we compare the wrong field. Instead of
comparing the ret code to 0, we compare the string value to 0
which generates implicit casting, hence the crash.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit f9f1c48ad799da2b4be0077bf9d61ae116da33d7)

Conflicts:
src/rgw/rgw_rest_s3.cc

12 years agoceph-fuse: create finisher threads after fork()
Sage Weil [Mon, 3 Jun 2013 04:21:09 +0000 (21:21 -0700)]
ceph-fuse: create finisher threads after fork()

The ObjectCacher and MonClient classes both instantiate Finisher
threads.  We need to make sure they are created *after* the fork(2)
or else the process will fail to join() them on shutdown, and the
threads will not exist while fuse is doing useful work.

Put CephFuse on the heap and move all this initalization into the child
block, and make sure errors are passed back to the parent.

Fix-proposed-by: Alexandre Marangone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodebian: update postinst, prerm hooks
Sage Weil [Fri, 21 Jun 2013 23:22:08 +0000 (16:22 -0700)]
debian: update postinst, prerm hooks

This syncs up the hooks with the latest master versions.  In particular,
do not blindly stop/restart daemons on package upgrade!

Fixes: #5414
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoos/FileStore: use fdatasync(2) instead of sync_file_range(2)
Sage Weil [Wed, 19 Jun 2013 04:33:09 +0000 (21:33 -0700)]
os/FileStore: use fdatasync(2) instead of sync_file_range(2)

This fixes data corruption on XFS.  Backported from
ffade3c85dfffa13a16edd9630a52d99eb8a413d.

Fixes: #4976
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agochmod +x iogen.sh
Sage Weil [Tue, 18 Jun 2013 03:06:59 +0000 (20:06 -0700)]
chmod +x iogen.sh

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: escape prefix correctly when listing objects
Yehuda Sadeh [Fri, 14 Jun 2013 21:53:54 +0000 (14:53 -0700)]
rgw: escape prefix correctly when listing objects

Fixes: #5362
When listing objects prefix needs to be escaped correctly (the
same as with the marker). Otherwise listing objects with prefix
that starts with underscore doesn't work.
Backport: bobtail, cuttlefish

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agorgw: translate object marker to raw format
Yehuda Sadeh [Sun, 31 Mar 2013 07:02:15 +0000 (00:02 -0700)]
rgw: translate object marker to raw format

Fixes: #4600
Object marker should be treated as an object, so that name is formatted
correctly when getting the raw oid.

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

12 years agoadding iogen.sh
tamil [Thu, 13 Jun 2013 20:50:56 +0000 (13:50 -0700)]
adding iogen.sh

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoosd: do not include logbl in scrub map
Sage Weil [Thu, 6 Jun 2013 23:35:54 +0000 (16:35 -0700)]
osd: do not include logbl in scrub map

This is a potentially use object/file, usually prefixed by a zeroed region
on disk, that is not used by scrub at all.  It dates back to
f51348dc8bdd5071b7baaf3f0e4d2e0496618f08 (2008) and the original version of
scrub.

This *might* fix #4179.  It is not a leak per se, but I observed 1GB
scrub messages going over the write.  Maybe the allocations are causing
fragmentation, or the sub_op queues are growing.

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

12 years agorgw: handle deep uri resources
Yehuda Sadeh [Fri, 7 Jun 2013 04:53:00 +0000 (21:53 -0700)]
rgw: handle deep uri resources

In case of deep uri resources (ones created beyond a single level
of hierarchy, e.g. auth/v1.0) we want to create a new empty
handlers for the path if no handlers exists. E.g., for
auth/v1.0 we need to have a handler for 'auth', otherwise
the default S3 handler will be used, which we don't want.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit ad3934e335399f7844e45fcfd17f7802800d2cb3)

12 years agorgw: fix get_resource_mgr() to correctly identify resource
Yehuda Sadeh [Fri, 7 Jun 2013 04:47:21 +0000 (21:47 -0700)]
rgw: fix get_resource_mgr() to correctly identify resource

Fixes: #5262
The original test was not comparing the correct string, ended up
with the effect of just checking the substring of the uri to match
the resource.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 8d55b87f95d59dbfcfd0799c4601ca37ebb025f5)

12 years agoPG: don't write out pg map epoch every handle_activate_map
Samuel Just [Mon, 15 Apr 2013 23:33:48 +0000 (16:33 -0700)]
PG: don't write out pg map epoch every handle_activate_map

We don't actually need to write out the pg map epoch on every
activate_map as long as:
a) the osd does not trim past the oldest pg map persisted
b) the pg does update the persisted map epoch from time
to time.

To that end, we now keep a reference to the last map persisted.
The OSD already does not trim past the oldest live OSDMapRef.
Second, handle_activate_map will trim if the difference between
the current map and the last_persisted_map is large enough.

Fixes: #4731
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agorgw: only append prefetched data if reading from head
Yehuda Sadeh [Thu, 30 May 2013 19:58:11 +0000 (12:58 -0700)]
rgw: only append prefetched data if reading from head

Fixes: #5209
Backport: bobtail, cuttlefish
If the head object wrongfully contains data, but according to the
manifest we don't read from the head, we shouldn't copy the prefetched
data. Also fix the length calculation for that data.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit c5fc52ae0fc851444226abd54a202af227d7cf17)

12 years agorgw: don't copy object idtag when copying object
Yehuda Sadeh [Thu, 30 May 2013 16:34:21 +0000 (09:34 -0700)]
rgw: don't copy object idtag when copying object

Fixes: #5204
When copying object we ended up also copying the original
object idtag which overrode the newly generated one. When
refcount put is called with the wrong idtag the count
does't go down.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit b1312f94edc016e604f1d05ccfe2c788677f51d1)

12 years agoosd: initialize new_state field when we use it
Sage Weil [Wed, 29 May 2013 23:50:04 +0000 (16:50 -0700)]
osd: initialize new_state field when we use it

If we use operator[] on a new int field its value is undefined; avoid
reading it or using |= et al until we initialize it.

Fixes: #4967
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 50ac8917f175d1b107c18ecb025af1a7b103d634)

12 years agoHashIndex: sync top directory during start_split,merge,col_split
Samuel Just [Tue, 28 May 2013 18:10:05 +0000 (11:10 -0700)]
HashIndex: sync top directory during start_split,merge,col_split

Otherwise, the links might be ordered after the in progress
operation tag write.  We need the in progress operation tag to
correctly recover from an interrupted merge, split, or col_split.

Fixes: #5180
Backport: cuttlefish, bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 5bca9c38ef5187c7a97916970a7fa73b342755ac)

12 years agoMerge remote-tracking branch 'upstream/wip_scrub_tphandle_bobtail' into bobtail
Samuel Just [Fri, 24 May 2013 02:29:06 +0000 (19:29 -0700)]
Merge remote-tracking branch 'upstream/wip_scrub_tphandle_bobtail' into bobtail

Fixes: #5159
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: ping tphandle during omap loop as well
Samuel Just [Fri, 24 May 2013 00:40:44 +0000 (17:40 -0700)]
PG: ping tphandle during omap loop as well

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: reset timeout in _scan_list for each object, read chunk
Samuel Just [Thu, 23 May 2013 22:24:39 +0000 (15:24 -0700)]
PG: reset timeout in _scan_list for each object, read chunk

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD,PG: pass tphandle down to _scan_list
Samuel Just [Thu, 23 May 2013 22:23:05 +0000 (15:23 -0700)]
OSD,PG: pass tphandle down to _scan_list

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agorgw: iterate usage entries from correct entry
Yehuda Sadeh [Thu, 23 May 2013 04:34:52 +0000 (21:34 -0700)]
rgw: iterate usage entries from correct entry

Fixes: #5152
When iterating through usage entries, and when user id was
provided, we started at the user's first entry and not from
the entry indexed by the request start time.
This commit fixes the issue.

Backport: bobtail

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 8b3a04dec8be13559716667d4b16cde9e9543feb)

12 years agomon: be a bit more verbose about osd mark down events
Sage Weil [Wed, 22 May 2013 19:45:27 +0000 (12:45 -0700)]
mon: be a bit more verbose about osd mark down events

Put these in the cluster log; they are interesting.

This is a backport of 87767fb1fb9a52d11b11f0b641cebbd9998f089e.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: protect ops log socket formatter
Yehuda Sadeh [Fri, 3 May 2013 19:57:00 +0000 (12:57 -0700)]
rgw: protect ops log socket formatter

Fixes: #4905
Ops log (through the unix domain socket) uses a formatter, which wasn't
protected.

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

12 years agolibrbd: make image creation defaults configurable
Josh Durgin [Thu, 16 May 2013 22:28:40 +0000 (15:28 -0700)]
librbd: make image creation defaults configurable

Programs using older versions of the image creation functions can't
set newer parameters like image format and fancier striping.

Setting these options lets them use all the new functionality without
being patched and recompiled to use e.g. rbd_create3().
This is particularly useful for things like qemu-img, which does not
know how to create format 2 images yet.

Refs: #5067
backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit aacc9adc4e9ca90bbe73ac153cc754a3a5b2c0a1)

12 years agorbd.py: fix stripe_unit() and stripe_count()
Josh Durgin [Thu, 16 May 2013 22:21:24 +0000 (15:21 -0700)]
rbd.py: fix stripe_unit() and stripe_count()

These matched older versions of the functions, but would segfault
using the current versions.

backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 53ee6f965e8f06c7256848210ad3c4f89d0cb5a0)

12 years agocls_rbd: make sure stripe_unit is not larger than object size
Josh Durgin [Thu, 16 May 2013 22:19:46 +0000 (15:19 -0700)]
cls_rbd: make sure stripe_unit is not larger than object size

Test a few other cases too.

backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 810306a2a76eec1c232fd28ec9c351e827fa3031)

12 years agomon: fix validatation of mds ids in mon commands
Sage Weil [Sat, 11 May 2013 05:14:05 +0000 (22:14 -0700)]
mon: fix validatation of mds ids in mon commands

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

Conflicts:

src/mon/MDSMonitor.cc

12 years agov0.56.6 v0.56.6
Gary Lowell [Fri, 3 May 2013 19:53:00 +0000 (12:53 -0700)]
v0.56.6

12 years agoceph.spec.in: Fix platform dependecies
Gary Lowell [Fri, 3 May 2013 19:45:24 +0000 (12:45 -0700)]
ceph.spec.in:  Fix platform dependecies

Picked up an incorrect dependency merging the rbd udev rules update.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agorgw: don't send tail to gc if copying object to itself
Yehuda Sadeh [Mon, 22 Apr 2013 19:48:56 +0000 (12:48 -0700)]
rgw: don't send tail to gc if copying object to itself

Fixes: #4776
Backport: bobtail
Need to make sure that when copying an object into itself we don't
send the tail to the garbage collection.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit de5d1da810732ee48f41e8be18257053d862301b)

12 years agoceph_common.sh: re-sync get_name_list with master
Sage Weil [Fri, 3 May 2013 19:24:21 +0000 (12:24 -0700)]
ceph_common.sh: re-sync get_name_list with master

We backported various items but didn't catch all the changes!  :(

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agov0.56.5 v0.56.5
Gary Lowell [Fri, 3 May 2013 01:08:06 +0000 (18:08 -0700)]
v0.56.5

12 years agoceph.spec.in: fix udev rules.d files handling
Danny Al-Gaaf [Thu, 4 Apr 2013 16:23:40 +0000 (18:23 +0200)]
ceph.spec.in: fix udev rules.d files handling

Move 50-rbd.rules into the ceph base package since the related
ceph-rbdnamer binary is part of this package. Use correct install
pattern.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agodebian: only start/stop upstart jobs if upstart is present
Sage Weil [Tue, 30 Apr 2013 00:01:55 +0000 (17:01 -0700)]
debian: only start/stop upstart jobs if upstart is present

This avoids errors on non-upstart distros (like wheezy).

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

Conflicts:
debian/ceph-mds.postinst

12 years agodebian: stop ceph-mds before uninstalling ceph-mds
Sage Weil [Tue, 12 Mar 2013 00:09:37 +0000 (17:09 -0700)]
debian: stop ceph-mds before uninstalling ceph-mds

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

12 years agoMakefile.am: Add -lpthread to fix build on newer ld in Raring Ringtail
Dan Mick [Thu, 25 Apr 2013 22:53:51 +0000 (15:53 -0700)]
Makefile.am: Add -lpthread to fix build on newer ld in Raring Ringtail

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 98f532e8000af281fa03b24da9ad2fda81755270)

Conflicts:
src/Makefile.am

12 years agoMerge remote-tracking branch 'gh/bobtail-deploy' into bobtail-next
Sage Weil [Wed, 1 May 2013 19:57:43 +0000 (12:57 -0700)]
Merge remote-tracking branch 'gh/bobtail-deploy' into bobtail-next

12 years agoinit-ceph: use remote config when starting daemons on remote nodes (-a)
Sage Weil [Thu, 25 Apr 2013 18:13:33 +0000 (11:13 -0700)]
init-ceph: use remote config when starting daemons on remote nodes (-a)

If you use -a to start a remote daemon, assume the remote config is present
instead of pushing the local config.  This makes more sense and simplifies
things.

Note that this means that -a in concert with -c foo means that foo must
also be present on the remote node in the same path.  That, however, is a
use case that I don't particularly care about right now.  :)

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit cd7e52cc76878eed0f084f7b9a6cf7c792b716c6)

12 years agoPG: call check_recovery_sources in remove_down_peer_info
Samuel Just [Wed, 24 Apr 2013 19:20:17 +0000 (12:20 -0700)]
PG: call check_recovery_sources in remove_down_peer_info

If we transition out of peering due to affected
prior set, we won't trigger start_peering_interval
and check_recovery_sources won't get called.  This
will leave an entry in missing_loc_sources without
a matching missing set.  We always want to
check_recovery_sources with remove_down_peer_info.

Fixes: 4805
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 81a6165c13c533e9c1c6684ab7beac09d52ca6b5)

12 years agoPG: clear want_acting when we leave Primary
Samuel Just [Thu, 25 Apr 2013 21:08:57 +0000 (14:08 -0700)]
PG: clear want_acting when we leave Primary

This is somewhat annoying actually.  Intuitively we want to
clear_primary_state when we leave primary, but when we restart
peering due to a change in prior set status, we can't afford
to forget most of our peering state.  want_acting, on the
other hand, should never persist across peering attempts.
In fact, in the future, want_acting should be pulled into
the Primary state structure.

Fixes: #3904
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit a5cade1fe7338602fb2bbfa867433d825f337c87)

12 years agomon: communicate the quorum_features properly when declaring victory.
Greg Farnum [Wed, 1 May 2013 01:12:10 +0000 (18:12 -0700)]
mon: communicate the quorum_features properly when declaring victory.

Fixes #4747.

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

12 years agoelector: trigger a mon reset whenever we bump the epoch
Greg Farnum [Tue, 30 Apr 2013 18:01:54 +0000 (11:01 -0700)]
elector: trigger a mon reset whenever we bump the epoch

We need to call reset during every election cycle; luckily we
can call it more than once. bump_epoch is (by definition!) only called
once per cycle, and it's called at the beginning, so we put it there.

Fixes #4858.

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

Conflicts:

src/mon/Elector.cc

12 years agoFix journal partition creation
Alexandre Marangone [Fri, 19 Apr 2013 22:09:28 +0000 (15:09 -0700)]
Fix journal partition creation

With OSD sharing data and journal, the previous code created the
journal partiton from the end of the device. A uint32_t is
used in sgdisk to get the last sector, with large HD, uint32_t
is too small.
The journal partition will be created backwards from the
a sector in the midlle of the disk leaving space before
and after it. The data partition will use whichever of
these spaces is greater. The remaining will not be used.

This patch creates the journal partition from the start as a workaround.

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
(cherry picked from commit 56619ab91732bd2eacbef388311954f4e0230a30)

12 years agoceph.spec.in: put ceph-disk-* et al in correct sbindir
Sage Weil [Fri, 26 Apr 2013 22:37:21 +0000 (15:37 -0700)]
ceph.spec.in: put ceph-disk-* et al in correct sbindir

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodebian: fix ceph.install
Sage Weil [Fri, 26 Apr 2013 22:29:12 +0000 (15:29 -0700)]
debian: fix ceph.install

This got out of sync somewhere in cherry-picking all of these patches.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMakefile.am: install ceph-* python scripts to /usr/bin directly
Danny Al-Gaaf [Thu, 4 Apr 2013 13:54:31 +0000 (15:54 +0200)]
Makefile.am: install ceph-* python scripts to /usr/bin directly

Install ceph-* scripts directly to $(prefix)$(sbindir) (which
normaly would be /usr/sbin) instead of moving it around after
installation in SPEC file or debian files.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 4d16f38f48e276497190c8bc03abc55c40e18eed)

12 years agoceph-disk: CalledProcessError has no output keyword on 2.6
Gary Lowell [Tue, 2 Apr 2013 19:11:10 +0000 (12:11 -0700)]
ceph-disk:  CalledProcessError has no output keyword on 2.6

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
(cherry picked from commit a793853850ee135de14b9237f7023cadcdb8575c)

12 years agoceph-disk: fix some (local) variable names
Danny Al-Gaaf [Tue, 2 Apr 2013 15:54:53 +0000 (17:54 +0200)]
ceph-disk: fix some (local) variable names

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit c4eb7e6ddd593cd45ab8343da01355be7382723e)

12 years agoceph-disk: fix naming of local variable in is_mounted()
Danny Al-Gaaf [Tue, 2 Apr 2013 15:36:37 +0000 (17:36 +0200)]
ceph-disk: fix naming of local variable in is_mounted()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 3dd8b461219e64bb0f7a210dba5a9ab7c644f014)

12 years agoceph-disk: merge twice defined function is_mounted(dev)
Danny Al-Gaaf [Tue, 2 Apr 2013 15:33:08 +0000 (17:33 +0200)]
ceph-disk: merge twice defined function is_mounted(dev)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit eaf31bf9f90ba9709a57a6870dbafa21142dae2c)

12 years agoceph-disk: define exception type
Danny Al-Gaaf [Tue, 2 Apr 2013 15:26:12 +0000 (17:26 +0200)]
ceph-disk: define exception type

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 4c6d6442a89adc5b56e99cb4d2ed572f2ad192c9)

12 years agoceph-disk: fix Redefining name 'uuid' from outer scope
Danny Al-Gaaf [Tue, 2 Apr 2013 15:17:38 +0000 (17:17 +0200)]
ceph-disk: fix Redefining name 'uuid' from outer scope

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 058eb923c5b7dab611901fdd1724ce2a7c180827)

12 years agoceph-disk: add missing space after comma
Danny Al-Gaaf [Tue, 2 Apr 2013 15:14:23 +0000 (17:14 +0200)]
ceph-disk: add missing space after comma

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 0080d1df7c7950e051840a543fc4bdabe6cc53e5)

12 years agoceph-disk list: say 'unknown cluster $UUID' when cluster is unknown
Sage Weil [Sat, 30 Mar 2013 00:30:28 +0000 (17:30 -0700)]
ceph-disk list: say 'unknown cluster $UUID' when cluster is unknown

This makes it clearer that an old osd is in fact old.

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

12 years agoceph-disk: handle missing journal_uuid field gracefully
Sage Weil [Fri, 29 Mar 2013 20:59:04 +0000 (13:59 -0700)]
ceph-disk: handle missing journal_uuid field gracefully

Only lower if we know it's not None.

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

12 years agoceph-disk: implement 'list'
Sage Weil [Fri, 29 Mar 2013 03:49:24 +0000 (20:49 -0700)]
ceph-disk: implement 'list'

This is based on Sandon's initial patch, but much-modified.

Mounts ceph data volumes temporarily to see what is inside.  Attempts to
associated journals with osds.

Resolves: #3120
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 6a65b9131c444041d16b880c6a7f332776063a78)

12 years agoceph-disk: reimplement list_all_partitions
Sage Weil [Thu, 28 Mar 2013 01:44:32 +0000 (18:44 -0700)]
ceph-disk: reimplement list_all_partitions

Use /dev/disk/by-id to list disks and their partitions.  This is more
accurate and correct than the previous (as-yet unused) implementation.

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

12 years agoceph-disk: reimplement is_partition
Sage Weil [Thu, 28 Mar 2013 01:43:59 +0000 (18:43 -0700)]
ceph-disk: reimplement is_partition

Previously we were assuming any device that ended in a digit was a
partition, but this is not at all correct (e.g., /dev/sr0, /dev/rbd1).
Instead, look in /dev/disk/by-id and see if there is a symlink that ends in
-partNN that links to our device.

There is probably still a better way...

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

12 years agoceph-disk: conditionally remove mount path
Sage Weil [Wed, 27 Mar 2013 19:45:29 +0000 (12:45 -0700)]
ceph-disk: conditionally remove mount path

umount removes it on success; only remove it here if it is still there.

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

12 years agoceph-disk: ignore udevadm settle return code
Sage Weil [Wed, 27 Mar 2013 00:04:14 +0000 (17:04 -0700)]
ceph-disk: ignore udevadm settle return code

If we time out, just continue and let the next step fail.

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

12 years agoceph-disk: rename some local variabels in list_*partitions
Danny Al-Gaaf [Mon, 25 Mar 2013 16:45:32 +0000 (17:45 +0100)]
ceph-disk: rename some local variabels in list_*partitions

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit b7d7e6894c550a7afa8dfb5bfa2bc54b5d331178)

12 years agoceph-disk: fix naming of a local variable in find_cluster_by_uuid
Danny Al-Gaaf [Mon, 25 Mar 2013 15:24:00 +0000 (16:24 +0100)]
ceph-disk: fix naming of a local variable in find_cluster_by_uuid

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 0b5fcfffe6d2f69bd4318cc93ef73195d948b9c5)

12 years agoceph-disk: rename some constants to upper case variable names
Danny Al-Gaaf [Mon, 25 Mar 2013 15:18:17 +0000 (16:18 +0100)]
ceph-disk: rename some constants to upper case variable names

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 8a999ded088e688fd3f4a7c27127b7c06f0b2f66)

12 years agoceph-disk: add some more docstrings
Danny Al-Gaaf [Mon, 25 Mar 2013 15:15:29 +0000 (16:15 +0100)]
ceph-disk: add some more docstrings

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 86e55f5448c4b5b46b74d2d89b01d1e64b1ea826)

12 years agoceph-disk: print subprocess.CalledProcessError on error
Danny Al-Gaaf [Mon, 25 Mar 2013 13:36:41 +0000 (14:36 +0100)]
ceph-disk: print subprocess.CalledProcessError on error

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 543327b1f2a9efe8083bb196433c4bcf83883269)

12 years agoceph-disk: fix indention
Danny Al-Gaaf [Mon, 25 Mar 2013 12:55:56 +0000 (13:55 +0100)]
ceph-disk: fix indention

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 2d26bcc07162a5176cdbc1748b829e3f39653697)

12 years agoceph-disk: udevadm settle before partprobe
Gary Lowell [Tue, 26 Mar 2013 18:31:16 +0000 (11:31 -0700)]
ceph-disk:  udevadm settle before partprobe

After changing the partition table, allow the udev event to be
processed before calling partprobe.  This helps prevent partprobe
from getting a resource busy error on some platforms.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
(cherry picked from commit 9eda8e5d5abf0743a2ad484806cfb2018243515f)

12 years agoceph-disk: re-add python 2.7 dependency comment
Sage Weil [Fri, 22 Mar 2013 17:09:55 +0000 (10:09 -0700)]
ceph-disk: re-add python 2.7 dependency comment

FIXME!

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

12 years agoceph-disk: cast output of subprocess.Popen() to str()
Danny Al-Gaaf [Wed, 20 Mar 2013 13:36:58 +0000 (14:36 +0100)]
ceph-disk: cast output of subprocess.Popen() to str()

Cast output of subprocess.Popen() to str() to be able to use
str.split() and str.splitlines() without warnings from pylint.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 87691dc46edfba11c370592dbb533772190be4b2)

12 years agoceph-disk: fix adjust_symlink() replace 'journal' with 'target'
Danny Al-Gaaf [Wed, 20 Mar 2013 13:02:28 +0000 (14:02 +0100)]
ceph-disk: fix adjust_symlink() replace 'journal' with 'target'

Replace 'journal' variable with 'target' since journal doesn't
exist in this function.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 3575feb7d2e5f4e35c5df193a1f8c9f08f88fcf4)

12 years agoceph-disk: fix adjust_symlink() replace 'canonical' with 'path'
Danny Al-Gaaf [Wed, 20 Mar 2013 13:01:02 +0000 (14:01 +0100)]
ceph-disk: fix adjust_symlink() replace 'canonical' with 'path'

Replace 'canonical' variable with 'path' since canonical doesn't
exist in this function.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit a27cb85b21610b4a9f8eb24f8f6cd04902349728)

12 years agoceph-disk: there is no os.path.lstat use os.lstat
Danny Al-Gaaf [Wed, 20 Mar 2013 12:56:23 +0000 (13:56 +0100)]
ceph-disk: there is no os.path.lstat use os.lstat

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 6d3247b5c02c39a66666a5833106dbc23044e436)

12 years agoceph-disk: remove unused variable key from prepare_journal_dev()
Danny Al-Gaaf [Wed, 20 Mar 2013 12:30:21 +0000 (13:30 +0100)]
ceph-disk: remove unused variable key from prepare_journal_dev()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 97b4f8d66bef2328fa53f9e508eb38f8b8d49632)

12 years agoceph-disk: fix except to catch OSError
Danny Al-Gaaf [Wed, 20 Mar 2013 12:27:27 +0000 (13:27 +0100)]
ceph-disk: fix except to catch OSError

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 9daf6cfce2d57509d896eae28bb97146a682a306)

12 years agoceph-disk: add missing space after >> operator
Danny Al-Gaaf [Wed, 20 Mar 2013 12:15:36 +0000 (13:15 +0100)]
ceph-disk: add missing space after >> operator

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 0ada43f79d2b1f9f84367e558c6d1a3e90e5c9b2)

12 years agofix: Redefining name 'uuid' from outer scope (line 14)
Danny Al-Gaaf [Wed, 20 Mar 2013 11:33:09 +0000 (12:33 +0100)]
fix: Redefining name 'uuid' from outer scope (line 14)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit d3c60dc8cad1db1d5df1c740bc805aaf9ba606ba)

12 years agoceph-disk: remove unused variables from list_partitions()
Danny Al-Gaaf [Wed, 20 Mar 2013 11:17:45 +0000 (12:17 +0100)]
ceph-disk: remove unused variables from list_partitions()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 6a8120d4b0c4cfa851d473532eb2366534f8653d)

12 years agoceph-disk: fix /dev/dm-[0-9] handling list_all_partitions()
Danny Al-Gaaf [Wed, 20 Mar 2013 11:10:22 +0000 (12:10 +0100)]
ceph-disk: fix /dev/dm-[0-9] handling list_all_partitions()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 3af7a1ac5bf24bf832d7180002281d6b5853e85a)

12 years agoceph-disk: rename local variable shadowing builtin
Danny Al-Gaaf [Tue, 19 Mar 2013 21:07:36 +0000 (22:07 +0100)]
ceph-disk: rename local variable shadowing builtin

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 9bcf5b64f45ab6c4bdedf820ed111319b2dbd778)

12 years agoceph-disk: remove twice defined identical function unmount
Danny Al-Gaaf [Tue, 19 Mar 2013 21:05:23 +0000 (22:05 +0100)]
ceph-disk: remove twice defined identical function unmount

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 4adf088107586be7b356d1e963570cdab232809e)

12 years agoceph-disk: remove twice defined function mount
Danny Al-Gaaf [Tue, 19 Mar 2013 21:02:49 +0000 (22:02 +0100)]
ceph-disk: remove twice defined function mount

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit ea26ea0d81a23aa76076ad5441c3b1aadfba3b44)

12 years agoceph-disk: remove double defined function get_conf
Danny Al-Gaaf [Tue, 19 Mar 2013 20:58:22 +0000 (21:58 +0100)]
ceph-disk: remove double defined function get_conf

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit c57daa3c6e03e8974e133d3a2d9bc3d6f06f4faf)

12 years agoceph-disk: rename local variable shadowing builtin
Danny Al-Gaaf [Tue, 19 Mar 2013 20:51:54 +0000 (21:51 +0100)]
ceph-disk: rename local variable shadowing builtin

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 57dde5c8b18ff4ccd53a30bb94119c0ffceb52b7)

12 years agoceph-disk: install and package
Sage Weil [Mon, 18 Mar 2013 21:55:24 +0000 (14:55 -0700)]
ceph-disk: install and package

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

Conflicts:

debian/ceph.install

12 years agoceph-disk: simplify command dispatch
Sage Weil [Fri, 15 Mar 2013 23:50:05 +0000 (16:50 -0700)]
ceph-disk: simplify command dispatch

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

12 years agoceph-disk: consolidate exceptions
Sage Weil [Fri, 15 Mar 2013 23:40:32 +0000 (16:40 -0700)]
ceph-disk: consolidate exceptions

Use a single exception type, and catch it at the top level.

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

12 years agoceph-disk: consolidate ceph-disk-* into a single binary
Sage Weil [Fri, 15 Mar 2013 23:36:45 +0000 (16:36 -0700)]
ceph-disk: consolidate ceph-disk-* into a single binary

 ceph-disk prepare ...
 ceph-disk activate ...
 ceph-disk ...

This let's us share code (we were already duplicating a bunch of stuff!)
and to add new commands easily.

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

12 years agoceph-disk-prepare: 'mkfs -t' instead of 'mkfs --type='
Sage Weil [Tue, 19 Mar 2013 04:13:34 +0000 (21:13 -0700)]
ceph-disk-prepare: 'mkfs -t' instead of 'mkfs --type='

Older mkfs (el6) doesn't like --type=.

Fixes: #4495
Reported-by: Alexandre Maragone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d47759429a6e2fdd392265e90b67046302c97644)