]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoclient: send all request put's through put_request() 383/head
Sage Weil [Fri, 28 Jun 2013 19:21:58 +0000 (12:21 -0700)]
client: send all request put's through put_request()

Make sure all MetaRequest reference put's go through the same path that
releases inode references, including all of the error paths.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: fix remaining Inode::put() caller, and make method psuedo-private
Sage Weil [Fri, 28 Jun 2013 18:50:11 +0000 (11:50 -0700)]
client: fix remaining Inode::put() caller, and make method psuedo-private

Not sure I can make this actually private and make Client::put_inode() a
friend method (making all of Client a friend would defeat the purpose).
This works well enough, though!

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: use put_inode on MetaRequest inode refs
Sage Weil [Fri, 28 Jun 2013 04:39:35 +0000 (21:39 -0700)]
client: use put_inode on MetaRequest inode refs

When we drop the request inode refs, we need to use put_inode() to ensure
they get cleaned up properly (removed from inode_map, caps released, etc.).
Do this explicitly here (as we do with all other inode put() paths that
matter).

Fixes: #5381
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk: s/else if/elif/
Greg Farnum [Thu, 27 Jun 2013 21:58:14 +0000 (14:58 -0700)]
ceph-disk: s/else if/elif/

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Luis <joao.luis@inktank.com>
(cherry picked from commit bd8255a750de08c1b8ee5e9c9a0a1b9b16171462)

12 years agoqa/workunits/misc/multiple_rsync: put tee output in /tmp
Sage Weil [Thu, 27 Jun 2013 05:11:07 +0000 (22:11 -0700)]
qa/workunits/misc/multiple_rsync: put tee output in /tmp

2013-06-25T10:29:15.811 INFO:teuthology.task.workunit.client.0.err:+ rsync -auv --exclude local/ /usr/ usr.2
2013-06-25T10:29:15.811 INFO:teuthology.task.workunit.client.0.err:+ tee a
2013-06-25T10:29:15.902 INFO:teuthology.task.workunit.client.0.out:sending incremental file list
2013-06-25T10:29:48.738 INFO:teuthology.task.workunit.client.0.out:
2013-06-25T10:29:48.740 INFO:teuthology.task.workunit.client.0.out:sent 1449972 bytes  received 7477 bytes  43505.94 bytes/sec
2013-06-25T10:29:48.740 INFO:teuthology.task.workunit.client.0.out:total size is 3205268241  speedup is 2199.23
2013-06-25T10:29:48.740 INFO:teuthology.task.workunit.client.0.err:+ hexdump -C a
2013-06-25T10:29:48.741 INFO:teuthology.task.workunit.client.0.out:00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
2013-06-25T10:29:48.741 INFO:teuthology.task.workunit.client.0.out:00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 0a 73  |...............s|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000020  65 6e 74 20 31 34 34 39  39 37 32 20 62 79 74 65  |ent 1449972 byte|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000030  73 20 20 72 65 63 65 69  76 65 64 20 37 34 37 37  |s  received 7477|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000040  20 62 79 74 65 73 20 20  34 33 35 30 35 2e 39 34  | bytes  43505.94|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000050  20 62 79 74 65 73 2f 73  65 63 0a 74 6f 74 61 6c  | bytes/sec.total|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000060  20 73 69 7a 65 20 69 73  20 33 32 30 35 32 36 38  | size is 3205268|
2013-06-25T10:29:48.742 INFO:teuthology.task.workunit.client.0.out:00000070  32 34 31 20 20 73 70 65  65 64 75 70 20 69 73 20  |241  speedup is |
2013-06-25T10:29:48.743 INFO:teuthology.task.workunit.client.0.out:00000080  32 31 39 39 2e 32 33 0a                           |2199.23.|
2013-06-25T10:29:48.743 INFO:teuthology.task.workunit.client.0.out:00000088

This passes consistently when the output is in /tmp, but fails after a few
iterations when on cephfs+kclient.  Avoid the bug with this test.

See: #5453

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: fix radosgw-admin buckets list
Yehuda Sadeh [Wed, 26 Jun 2013 18:28:57 +0000 (11:28 -0700)]
rgw: fix radosgw-admin buckets list

Fixes: #5455
Backport: cuttlefish
This commit fixes a regression, where radosgw-admin buckets list
operation wasn't returning any data.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoHandle non-existent front interface in maps from older MONs
David Zafman [Thu, 27 Jun 2013 01:55:26 +0000 (18:55 -0700)]
Handle non-existent front interface in maps from older MONs

Fix OSDService::get_con_osd_hb() to not try to get_connection() without front interface
Fix OSD::handle_osd_map() to check for missing front interface

Fixes: #5460
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk: do not mount over an osd directly in /var/lib/ceph/osd/$cluster-$id
Sage Weil [Thu, 27 Jun 2013 01:27:49 +0000 (18:27 -0700)]
ceph-disk: do not mount over an osd directly in /var/lib/ceph/osd/$cluster-$id

If we see a 'ready' file in the target OSD dir, do not mount our device
on top of it.

Among other things, this prevents ceph-disk activate on stray disks from
stepping on teuthology osds.

Fixes: #5445
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocephtool/test.sh: add case for auth add with no caps
Dan Mick [Thu, 27 Jun 2013 00:07:48 +0000 (17:07 -0700)]
cephtool/test.sh: add case for auth add with no caps

Test case for failure in #5467.  Supplying new auth info overwrites.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMonCommands.h: auth add doesn't require caps (it can use -i <file>)
Dan Mick [Wed, 26 Jun 2013 22:31:25 +0000 (15:31 -0700)]
MonCommands.h: auth add doesn't require caps (it can use -i <file>)

This was a regression from the old behavior introduced by the
CLI rewrite.

Fixes: #5467
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMakefile.am: fix libglobal.la race with ceph_test_cors
Dan Mick [Wed, 26 Jun 2013 01:23:22 +0000 (18:23 -0700)]
Makefile.am: fix libglobal.la race with ceph_test_cors

ceph_test_cors had libglobal.la in its _LDFLAGS macro definition;
it should have been in _LDADD.  Moreover, things using libglobal.la
ought to be using LIBGLOBAL_LDA to add it to _LDADD.  Fix them all.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge branch 'next'
Gary Lowell [Tue, 25 Jun 2013 20:45:22 +0000 (13:45 -0700)]
Merge branch 'next'

12 years agoMerge pull request #380 from dachary/wip-4907
Josh Durgin [Tue, 25 Jun 2013 17:57:41 +0000 (10:57 -0700)]
Merge pull request #380 from dachary/wip-4907

get_xattr() can return more than 4KB

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge pull request #379 from dachary/wip-5312
Sage Weil [Tue, 25 Jun 2013 17:15:10 +0000 (10:15 -0700)]
Merge pull request #379 from dachary/wip-5312

skip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agov0.65 v0.65
Gary Lowell [Tue, 25 Jun 2013 16:19:32 +0000 (09:19 -0700)]
v0.65

12 years agoget_xattr() can return more than 4KB 380/head
Loic Dachary [Tue, 25 Jun 2013 14:10:02 +0000 (16:10 +0200)]
get_xattr() can return more than 4KB

Instead of failing if the attribute to be returned is larger than 4KB,
double the buffer size each time librados.rados_getxattr returns
-errno.ERANGE and try again.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoskip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined 379/head
Loic Dachary [Tue, 25 Jun 2013 13:04:34 +0000 (15:04 +0200)]
skip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined

The TEST(EXT4StoreTest, _detect_fs) test is meant to be run from
qa/workunits/filestore/filestore.sh, after the ext4 file system was
created. If the DISK and MOUNTPOINT environment variables are not
defined, display a message explaining the expected environment and
silentely skip the test. The tests in store_test.cc are not unit tests
because they depend on their environment.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Tue, 25 Jun 2013 03:41:15 +0000 (20:41 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agomon/Elector: cancel election timer if we bootstrap
Sage Weil [Tue, 25 Jun 2013 01:51:07 +0000 (18:51 -0700)]
mon/Elector: cancel election timer if we bootstrap

If we short-circuit and bootstrap, cancel our timer.  Otherwise it will
go off some time later when we are in who knows what state.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: cancel probe timeout on reset
Sage Weil [Tue, 25 Jun 2013 01:12:11 +0000 (18:12 -0700)]
mon: cancel probe timeout on reset

If we are probing and get (say) an election timeout that calls reset(),
cancel the timer.  Otherwise, we assert later with a splat like

2013-06-24 01:09:33.675882 7fb9627e7700  4 mon.b@0(leader) e1 probe_timeout 0x307a520
2013-06-24 01:09:33.676956 7fb9627e7700 -1 mon/Monitor.cc: In function 'void Monitor::probe_timeout(int)' thread 7fb9627e7700 time 2013-06-24 01:09:43.675904
mon/Monitor.cc: 1888: FAILED assert(is_probing() || is_synchronizing())

 ceph version 0.64-613-g134d08a (134d08a9654f66634b893d493e4a92f38acc63cf)
 1: (Monitor::probe_timeout(int)+0x161) [0x56f5c1]
 2: (Context::complete(int)+0xa) [0x574a2a]
 3: (SafeTimer::timer_thread()+0x425) [0x7059a5]
 4: (SafeTimerThread::entry()+0xd) [0x7065dd]
 5: (()+0x7e9a) [0x7fb966f62e9a]
 6: (clone()+0x6d) [0x7fb9652f9ccd]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

Fixes: #5438
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon/AuthMonitor: ensure initial rotating keys get encoded when create_initial called 2x
Sage Weil [Tue, 25 Jun 2013 00:58:48 +0000 (17:58 -0700)]
mon/AuthMonitor: ensure initial rotating keys get encoded when create_initial called 2x

The create_initial() method may get called multiple times; make sure it
will unconditionally generate new/initial rotating keys.  Move the block
up so that we can easily assert as much.

Broken by commit cd98eb0c651d9ee62e19c2cc92eadae9bed678cd.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoosd: tolerate racing threads starting recovery ops
Sage Weil [Mon, 24 Jun 2013 23:37:29 +0000 (16:37 -0700)]
osd: tolerate racing threads starting recovery ops

We sample the (max - active) recovery ops to know how many to start, but
do not hold the lock over the full duration, such that it is possible to
start too many ops.  This isn't problematic except that our condition
checks for being == max but not beyond it, and we will continue to start
recovery ops when we shouldn't.  Fix this by adjusting the conditional
to be <=.

Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agoinit-radosgw.sysv: remove -x debug mode
Sage Weil [Tue, 25 Jun 2013 00:42:04 +0000 (17:42 -0700)]
init-radosgw.sysv: remove -x debug mode

Fixes: #5443
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocommon/pick_addresses: behave even after internal_safe_to_start_threads
Sage Weil [Mon, 24 Jun 2013 19:52:44 +0000 (12:52 -0700)]
common/pick_addresses: behave even after internal_safe_to_start_threads

ceph-mon recently started using Preforker to working around forking issues.
As a result, internal_safe_to_start_threads got set sooner and calls to
pick_addresses() which try to set string config values now fail because
there are no config observers for them.

Work around this by observing the change while we adjust the value.  We
assume pick_addresses() callers are smart enough to realize that their
result will be reflected by cct->_conf and not magically handled elsewhere.

Fixes: #5195, #5205
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoAdd python-argparse to dependencies (for pre-2.7 systems)
Dan Mick [Mon, 24 Jun 2013 21:50:07 +0000 (14:50 -0700)]
Add python-argparse to dependencies (for pre-2.7 systems)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge pull request #376 from dalgaaf/wip-da-SCA-cppcheck-3
Sage Weil [Mon, 24 Jun 2013 20:47:50 +0000 (13:47 -0700)]
Merge pull request #376 from dalgaaf/wip-da-SCA-cppcheck-3

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodebian, rpm: remove python-lockfile dependency
Sage Weil [Mon, 24 Jun 2013 20:04:44 +0000 (13:04 -0700)]
debian, rpm: remove python-lockfile dependency

As for 2a4953b697a3464862fd3913336edfd7eede2487 ceph-disk no longer uses
this.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Mon, 24 Jun 2013 19:25:58 +0000 (12:25 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agomds: do not assume segment list is non-empty in standby_trim_segments
Sage Weil [Fri, 21 Jun 2013 21:23:45 +0000 (14:23 -0700)]
mds: do not assume segment list is non-empty in standby_trim_segments

If we restart standby replay shortly after startup, before we actually have
any segments, we an trigger a segfault here:

 ceph version 0.64-441-gc39b99c (c39b99cdecceaca77f66eafbcc38387406826406)
 1: ceph-mds() [0x975caa]
 2: (()+0xfcb0) [0x7fc33b5a5cb0]
 3: (MDLog::standby_trim_segments()+0x192) [0x78a932]
 4: (MDS::C_MDS_StandbyReplayRestartFinish::finish(int)+0x39) [0x595f69]
 5: (Journaler::_finish_reprobe(int, unsigned long, Context*)+0x190) [0x7917b0]
 6: (Filer::_probed(Filer::Probe*, object_t const&, unsigned long, utime_t)+0x558) [0x7c6b38]
 7: (Objecter::C_Stat::finish(int)+0xc0) [0x7c7930]
 8: (Objecter::handle_osd_op_reply(MOSDOpReply*)+0xe48) [0x7b2c78]
 9: (MDS::handle_core_message(Message*)+0xae8) [0x589858]
 10: (MDS::_dispatch(Message*)+0x2f) [0x589a1f]
 11: (MDS::ms_dispatch(Message*)+0x1d3) [0x58b4a3]
 12: (DispatchQueue::entry()+0x3f1) [0x943861]
 13: (DispatchQueue::DispatchThread::entry()+0xd) [0x86e32d]

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

12 years agoMerge pull request #374 from ceph/wip-5427
Sage Weil [Mon, 24 Jun 2013 17:20:24 +0000 (10:20 -0700)]
Merge pull request #374 from ceph/wip-5427

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agotest/librados/cmd.cc: use static_cast instead of C-Style cast 376/head
Danny Al-Gaaf [Mon, 24 Jun 2013 13:29:12 +0000 (15:29 +0200)]
test/librados/cmd.cc: use static_cast instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Objecter.cc: use static_cast instead of C-Style cast
Danny Al-Gaaf [Mon, 24 Jun 2013 13:24:00 +0000 (15:24 +0200)]
osdc/Objecter.cc: use static_cast instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/MonClient.cc: use static_cast instead of C-Style cast
Danny Al-Gaaf [Mon, 24 Jun 2013 13:19:41 +0000 (15:19 +0200)]
mon/MonClient.cc: use static_cast instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/cmdparse.cc: reduce scope of local variable 'pos'
Danny Al-Gaaf [Mon, 24 Jun 2013 12:34:46 +0000 (14:34 +0200)]
common/cmdparse.cc: reduce scope of local variable 'pos'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/cmdparse.cc: remove unused variable
Danny Al-Gaaf [Mon, 24 Jun 2013 12:29:50 +0000 (14:29 +0200)]
common/cmdparse.cc: remove unused variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/OSD.cc: prefer prefix ++operator for non-trivial iterator
Danny Al-Gaaf [Mon, 24 Jun 2013 12:24:14 +0000 (14:24 +0200)]
osd/OSD.cc: prefer prefix ++operator for non-trivial iterator

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoOSDMonitor.cc: prefer prefix ++operator for non-trivial iterator
Danny Al-Gaaf [Mon, 24 Jun 2013 12:18:52 +0000 (14:18 +0200)]
OSDMonitor.cc: prefer prefix ++operator for non-trivial iterator

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/MonCap.cc: use empty() instead of if(size())
Danny Al-Gaaf [Mon, 24 Jun 2013 12:14:38 +0000 (14:14 +0200)]
mon/MonCap.cc: use empty() instead of if(size())

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/cmdparse.cc: prefer prefix ++operator for non-trivial iterator
Danny Al-Gaaf [Mon, 24 Jun 2013 11:50:33 +0000 (13:50 +0200)]
common/cmdparse.cc: prefer prefix ++operator for non-trivial iterator

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMerge pull request #375 from ceph/wip-msgr
Gregory Farnum [Mon, 24 Jun 2013 05:42:07 +0000 (22:42 -0700)]
Merge pull request #375 from ceph/wip-msgr

misc msgr fixes

Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomsgr: clear_pipe+queue reset when replacing lossy connections 375/head
Sage Weil [Mon, 24 Jun 2013 01:09:55 +0000 (18:09 -0700)]
msgr: clear_pipe+queue reset when replacing lossy connections

We already handle the lossless replacement and lossy fault paths, but
not the lossy replacement.  This fixes an assert(!cleared) in the
reaper.  Adjust comments appropriately.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsgr: reaper: make sure pipe has been cleared (under pipe_lock)
Sage Weil [Mon, 17 Jun 2013 20:32:38 +0000 (13:32 -0700)]
msgr: reaper: make sure pipe has been cleared (under pipe_lock)

All paths to pipe shutdown should have cleared the con->pipe reference
already.  Assert as much.

Also, do it under pipe_lock!

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsg/Pipe: goto fail_unlocked on early failures in accept()
Sage Weil [Mon, 17 Jun 2013 21:14:02 +0000 (14:14 -0700)]
msg/Pipe: goto fail_unlocked on early failures in accept()

Instead of duplicating an incomplete cleanup sequence (that does not
clear_pipe()), goto fail_unlocked and do the cleanup in a generic way.
s/rc/r/ while we are here.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsgr: clear con->pipe inside pipe_lock on mark_down
Sage Weil [Mon, 17 Jun 2013 20:32:07 +0000 (13:32 -0700)]
msgr: clear con->pipe inside pipe_lock on mark_down

We need to do this under protection of the pipe_lock.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsgr: clear_pipe inside pipe_lock on mark_down_all
Sage Weil [Mon, 17 Jun 2013 19:47:11 +0000 (12:47 -0700)]
msgr: clear_pipe inside pipe_lock on mark_down_all

Observed a segfault in rebind -> mark_down_all -> clear_pipe -> put that
may have been due to a racing thread clearing the connection_state pointer.
Do the clear_pipe() call under the protection of pipe_lock, as we do in
all other contexts.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/AuthMonitor: make initial auth include rotating keys 374/head
Sage Weil [Sun, 23 Jun 2013 16:25:55 +0000 (09:25 -0700)]
mon/AuthMonitor: make initial auth include rotating keys

This closes a very narrow race during mon creation where there are no
service keys.

Fixes: #5427
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: do not leak no_reply messages
Sage Weil [Sun, 23 Jun 2013 15:52:46 +0000 (08:52 -0700)]
mon: do not leak no_reply messages

I think I assumed no_reply() was releasing the references, but it is
not.  Which is better, since send_reply() doesn't either.  Fix the leaks
by dropping the message ref explicitly.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: fix leak of MOSDFailure messages
Sage Weil [Sun, 23 Jun 2013 15:53:09 +0000 (08:53 -0700)]
mon: fix leak of MOSDFailure messages

We need to discard/cancel/free the failure report messages before we
cancel a report out.  Assert in the dtor to ensure we didn't forget.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agodebian: ceph-common requires matching version of python-ceph
Sage Weil [Sat, 22 Jun 2013 17:28:16 +0000 (10:28 -0700)]
debian: ceph-common requires matching version of python-ceph

If they skew the ceph_argparse.py module may be missing.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next'
Dan Mick [Sat, 22 Jun 2013 01:46:08 +0000 (18:46 -0700)]
Merge branch 'next'

Conflicts:
src/ceph.in

12 years agoAdd header comments and Inktank copyrights to ceph.in/ceph_argparse.py
Dan Mick [Sat, 22 Jun 2013 01:39:59 +0000 (18:39 -0700)]
Add header comments and Inktank copyrights to ceph.in/ceph_argparse.py

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph.in: rip out reusable code to pybind/ceph_argparse.py
Dan Mick [Fri, 21 Jun 2013 23:10:35 +0000 (16:10 -0700)]
ceph.in: rip out reusable code to pybind/ceph_argparse.py

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Conflicts:
src/ceph.in

12 years agoceph: even shinier
Sage Weil [Fri, 21 Jun 2013 22:52:32 +0000 (15:52 -0700)]
ceph: even shinier

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph: do not busy-loop on ceph -w
Sage Weil [Fri, 21 Jun 2013 22:50:59 +0000 (15:50 -0700)]
ceph: do not busy-loop on ceph -w

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agolibrados: make cmd test tolerate NXIO for osd commands
Sage Weil [Fri, 21 Jun 2013 21:53:22 +0000 (14:53 -0700)]
librados: make cmd test tolerate NXIO for osd commands

The cluster may be thrashing underneath us; tolerate NXIO in case the OSD
is currently down.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-mds'
Sage Weil [Fri, 21 Jun 2013 21:25:34 +0000 (14:25 -0700)]
Merge remote-tracking branch 'gh/wip-mds'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomds: do not assume segment list is non-empty in standby_trim_segments
Sage Weil [Fri, 21 Jun 2013 21:23:45 +0000 (14:23 -0700)]
mds: do not assume segment list is non-empty in standby_trim_segments

If we restart standby replay shortly after startup, before we actually have
any segments, we an trigger a segfault here:

 ceph version 0.64-441-gc39b99c (c39b99cdecceaca77f66eafbcc38387406826406)
 1: ceph-mds() [0x975caa]
 2: (()+0xfcb0) [0x7fc33b5a5cb0]
 3: (MDLog::standby_trim_segments()+0x192) [0x78a932]
 4: (MDS::C_MDS_StandbyReplayRestartFinish::finish(int)+0x39) [0x595f69]
 5: (Journaler::_finish_reprobe(int, unsigned long, Context*)+0x190) [0x7917b0]
 6: (Filer::_probed(Filer::Probe*, object_t const&, unsigned long, utime_t)+0x558) [0x7c6b38]
 7: (Objecter::C_Stat::finish(int)+0xc0) [0x7c7930]
 8: (Objecter::handle_osd_op_reply(MOSDOpReply*)+0xe48) [0x7b2c78]
 9: (MDS::handle_core_message(Message*)+0xae8) [0x589858]
 10: (MDS::_dispatch(Message*)+0x2f) [0x589a1f]
 11: (MDS::ms_dispatch(Message*)+0x1d3) [0x58b4a3]
 12: (DispatchQueue::entry()+0x3f1) [0x943861]
 13: (DispatchQueue::DispatchThread::entry()+0xd) [0x86e32d]

Fixes: #5333
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomds: rev protocol
Sage Weil [Fri, 21 Jun 2013 15:20:33 +0000 (08:20 -0700)]
mds: rev protocol

Commit 18b9e63b4df643e1f2fb8f17416089e5d970bf60 changed the OTW lock
encoding.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: kill Server::handle_client_lookup_hash()
Yan, Zheng [Fri, 21 Jun 2013 06:39:27 +0000 (14:39 +0800)]
mds: kill Server::handle_client_lookup_hash()

Server::handle_client_lookup_ino() is more simple and robust. Use it
to handle both LOOKUPHASH and LOOKUINO requests.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: use "open-by-ino" helper to handle LOOKUPINO request
Yan, Zheng [Fri, 21 Jun 2013 06:39:26 +0000 (14:39 +0800)]
mds: use "open-by-ino" helper to handle LOOKUPINO request

Fixes #3541
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agoMerge remote-tracking branch 'yan/wip-mds' into wip-mds
Sage Weil [Thu, 20 Jun 2013 22:55:41 +0000 (15:55 -0700)]
Merge remote-tracking branch 'yan/wip-mds' into wip-mds

12 years agoceph.in: remove some TAB chars
Dan Mick [Thu, 20 Jun 2013 22:12:24 +0000 (15:12 -0700)]
ceph.in: remove some TAB chars

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph.in: fix ^C handling in watch (trap exception in while, too)
Dan Mick [Thu, 20 Jun 2013 22:11:03 +0000 (15:11 -0700)]
ceph.in: fix ^C handling in watch (trap exception in while, too)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph: --version as well as -v
Sage Weil [Thu, 20 Jun 2013 22:04:51 +0000 (15:04 -0700)]
ceph: --version as well as -v

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Thu, 20 Jun 2013 19:30:54 +0000 (12:30 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agoosdc: re-calculate truncate_size for strip objects
Yan, Zheng [Thu, 20 Jun 2013 07:50:18 +0000 (15:50 +0800)]
osdc: re-calculate truncate_size for strip objects

Feed truncate_size through the striping algorithm so that it reflects the
correct per-object offset (as opposed to the file offset).

Fixes #5380
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoqa/workunits/misc/multiple_rsync.sh: wtf
Sage Weil [Sun, 16 Jun 2013 03:42:39 +0000 (20:42 -0700)]
qa/workunits/misc/multiple_rsync.sh: wtf

2013-06-15T12:55:29.808 INFO:teuthology.task.workunit.client.0.err:+ rsync -auv --exclude local/ /usr/ usr.1
2013-06-15T12:55:29.808 INFO:teuthology.task.workunit.client.0.err:+ tee a
2013-06-15T12:55:29.820 INFO:teuthology.task.workunit.client.0.out:sending incremental file list
2013-06-15T12:56:46.019 INFO:teuthology.task.workunit.client.0.out:
2013-06-15T12:56:46.020 INFO:teuthology.task.workunit.client.0.out:sent 1452634 bytes  received 7485 bytes  19086.52 bytes/sec
2013-06-15T12:56:46.020 INFO:teuthology.task.workunit.client.0.out:total size is 3205063225  speedup is 2195.07
2013-06-15T12:56:46.020 INFO:teuthology.task.workunit.client.0.err:+ wc -l a
2013-06-15T12:56:46.021 INFO:teuthology.task.workunit.client.0.out:4 a
2013-06-15T12:56:46.022 INFO:teuthology.task.workunit.client.0.err:+ wc -l a
2013-06-15T12:56:46.022 INFO:teuthology.task.workunit.client.0.err:+ grep 4
2013-06-15T12:56:46.023 INFO:teuthology.task.workunit.client.0.out:4 a
2013-06-15T12:56:46.024 INFO:teuthology.task.workunit.client.0.err:+ rsync -auv --exclude local/ /usr/ usr.2
2013-06-15T12:56:46.024 INFO:teuthology.task.workunit.client.0.err:+ tee a
2013-06-15T12:56:46.112 INFO:teuthology.task.workunit.client.0.out:sending incremental file list
2013-06-15T12:57:17.172 INFO:teuthology.task.workunit.client.0.out:
2013-06-15T12:57:17.174 INFO:teuthology.task.workunit.client.0.out:sent 1452634 bytes  received 7485 bytes  46352.98 bytes/sec
2013-06-15T12:57:17.174 INFO:teuthology.task.workunit.client.0.out:total size is 3205063225  speedup is 2195.07
2013-06-15T12:57:17.175 INFO:teuthology.task.workunit.client.0.err:+ wc -l a
2013-06-15T12:57:17.175 INFO:teuthology.task.workunit.client.0.out:3 a

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

12 years agoqa/workunits/cephtool/test.sh: fix and cleanup several tests
Sage Weil [Thu, 20 Jun 2013 18:28:26 +0000 (11:28 -0700)]
qa/workunits/cephtool/test.sh: fix and cleanup several tests

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: drop deprecated 'stop_cluster'
Sage Weil [Thu, 20 Jun 2013 18:23:38 +0000 (11:23 -0700)]
mon: drop deprecated 'stop_cluster'

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: make 'mds compat rm_*compat' idempotent
Sage Weil [Thu, 20 Jun 2013 18:23:11 +0000 (11:23 -0700)]
mds: make 'mds compat rm_*compat' idempotent

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: make 'log ...' command wait for commit before reply
Sage Weil [Thu, 20 Jun 2013 18:11:50 +0000 (11:11 -0700)]
mon: make 'log ...' command wait for commit before reply

Previously we would just dump the command argument to our local log client
and reply immediately, which could lose the message if we then restarted.
Instead, commit directly and wait before replying.

Also, log as the actual client, not as the monitor processing the message.

Fixes: #5409
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoa/workunits/cephtool/test.sh: --no-log-to-stderr when examining stderr
Sage Weil [Thu, 20 Jun 2013 18:04:26 +0000 (11:04 -0700)]
a/workunits/cephtool/test.sh: --no-log-to-stderr when examining stderr

We can get random messages to stderror from socket reconnects and such;
discard those if we are looking at stderr in the test.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: more fix dout use in sync_requester_abort()
Sage Weil [Thu, 20 Jun 2013 16:46:42 +0000 (09:46 -0700)]
mon: more fix dout use in sync_requester_abort()

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: fix raw use of *_dout in sync_requester_abort()
Sage Weil [Mon, 10 Jun 2013 18:48:25 +0000 (11:48 -0700)]
mon: fix raw use of *_dout in sync_requester_abort()

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc/release-notes: v0.61.4
Sage Weil [Thu, 20 Jun 2013 15:08:14 +0000 (08:08 -0700)]
doc/release-notes: v0.61.4

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #367 from ceph/wip-ceph-cli
Sage Weil [Thu, 20 Jun 2013 03:02:27 +0000 (20:02 -0700)]
Merge pull request #367 from ceph/wip-ceph-cli

Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge remote-tracking branch 'upstream/next'
Samuel Just [Thu, 20 Jun 2013 02:54:31 +0000 (19:54 -0700)]
Merge remote-tracking branch 'upstream/next'

12 years agoFileStore: handle observers in constructor/destructor
Samuel Just [Thu, 20 Jun 2013 02:46:06 +0000 (19:46 -0700)]
FileStore: handle observers in constructor/destructor

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoinit-radosgw: use radosgw --show-config-value to get config values 367/head
Sage Weil [Thu, 20 Jun 2013 02:38:17 +0000 (19:38 -0700)]
init-radosgw: use radosgw --show-config-value to get config values

This way we get the correct default values, as reflected by radosgw
itself.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph: fix ceph-conf call to get admin socket path for 'daemon <name> ...'
Sage Weil [Wed, 19 Jun 2013 23:28:10 +0000 (16:28 -0700)]
ceph: fix ceph-conf call to get admin socket path for 'daemon <name> ...'

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-conf: make --show-config-value reflect daemon defaults
Sage Weil [Wed, 19 Jun 2013 23:27:34 +0000 (16:27 -0700)]
ceph-conf: make --show-config-value reflect daemon defaults

We want DAEMON defaults, but we don't want global_init to do anything else
daemonish like print a banner or mkdir /var/run/ceph.  This lets us use

 ceph-conf -n osd.0 --show-config-value log_file

to get the default, while

 ceph-conf -n osd.0 log_file

only reflects what is in the config file.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoFileStore: apply changes after disabling m_filestore_replica_fadvise
Samuel Just [Thu, 20 Jun 2013 01:57:05 +0000 (18:57 -0700)]
FileStore: apply changes after disabling m_filestore_replica_fadvise

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit ed8b0e65bde14d0a3a08bc233dee6a997e379dcc)

12 years agoFileStore: apply changes after disabling m_filestore_replica_fadvise
Samuel Just [Thu, 20 Jun 2013 01:57:05 +0000 (18:57 -0700)]
FileStore: apply changes after disabling m_filestore_replica_fadvise

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph-disk: use unix lock instead of lockfile class
Sage Weil [Thu, 20 Jun 2013 00:27:49 +0000 (17:27 -0700)]
ceph-disk: use unix lock instead of lockfile class

The lockfile class relies on file system trickery to get safe mutual
exclusion.  However, the unix syscalls do this for us.  More
importantly, the unix locks go away when the owning process dies, which
is behavior that we want here.

Fixes: #5387
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Thu, 20 Jun 2013 00:55:20 +0000 (17:55 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agoceph-disk: make list_partition behave with unusual device names
Alexandre Maragone [Tue, 18 Jun 2013 23:18:01 +0000 (16:18 -0700)]
ceph-disk: make list_partition behave with unusual device names

When you get device names like sdaa you do not want to mistakenly conclude that
sdaa is a partition of sda.  Use /sys/block/$device/$partition existence
instead.

Fixes: #5211
Backport: cuttlefish
Signed-off-by: Alexandre Maragone <alexandre.maragone@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #364 from dachary/wip-5213
athanatos [Wed, 19 Jun 2013 22:59:39 +0000 (15:59 -0700)]
Merge pull request #364 from dachary/wip-5213

unit tests for PGLog::proc_replica_log

Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge pull request #366 from dachary/wip-5398
athanatos [Wed, 19 Jun 2013 22:57:28 +0000 (15:57 -0700)]
Merge pull request #366 from dachary/wip-5398

PGLog::rewind_divergent_log must not call mark_dirty_from on end()

Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: get_index prior to taking fdcache_lock in lfn_unlink
Samuel Just [Wed, 19 Jun 2013 22:11:28 +0000 (15:11 -0700)]
FileStore: get_index prior to taking fdcache_lock in lfn_unlink

We take the fdcache_lock while holding onto index objects
elsewhere in the code.

Fixes: #5389
Reviewed-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPGLog::rewind_divergent_log must not call mark_dirty_from on end() 366/head
Loic Dachary [Wed, 19 Jun 2013 20:50:30 +0000 (22:50 +0200)]
PGLog::rewind_divergent_log must not call mark_dirty_from on end()

PGLog::rewind_divergent_log is dereferencing iterator "p" though it is
already past the end of its container. When entering the loop for the
first time, p is log.log.end() and must not be dereferenced.

mark_dirty_from must only be called after p--. It
will not rewind past begin() because of the

  if (p == log.log.begin())

test above.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agounit tests for PGLog::proc_replica_log 364/head
Loic Dachary [Mon, 17 Jun 2013 09:45:22 +0000 (11:45 +0200)]
unit tests for PGLog::proc_replica_log

The tests covers 100% of the LOC of proc_replica_log. It is broken down
in 7 cases to enumerate all the situations it must address. Each case
is isolated in a independant code block where the conditions are
reproduced.

All tests are done on omissing and oinfo because they are the only
data structures that can be modified by proc_replica_log.

The first case is a noop and checks that only last_complete gets
updated when there are no logs.

The following case includes entries that are supposed to be ignored (
x7, x8 and xa ), however this is not an actual proof that the code
ignoring them is actually run : it only shows in the code coverage
report.

   The log entry (1,3) modifies the object x9 but the olog entry
   (2,3) deletes it : log is authoritative and the object is added
   to missing. x7 is divergent and ignored. x8 has a more recent
   version in the log and the olog entry is ignored. xa is past
   last_backfill and ignored.

The other cases are a variation of the first case with minimal changes
to make them easier to understand and adapt. For instance most of them
start with a tail that is the same ( object with hash x5 and both at
version 1,1 ).

http://tracker.ceph.com/issues/5213 refs #5213

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoadd constness to PGLog::proc_replica_log
Loic Dachary [Mon, 10 Jun 2013 16:39:47 +0000 (18:39 +0200)]
add constness to PGLog::proc_replica_log

The function is made const by replacing a single call to log.objects[]
with log.objects.find. The olog argument is also a const and does not
require any change.

http://tracker.ceph.com/issues/5213 refs #5213

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoMerge pull request #342 from ceph/wip-mon
Sage Weil [Wed, 19 Jun 2013 18:33:28 +0000 (11:33 -0700)]
Merge pull request #342 from ceph/wip-mon

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon/PaxosService: not active during paxos UPDATING_PREVIOUS 342/head
Sage Weil [Fri, 7 Jun 2013 18:41:21 +0000 (11:41 -0700)]
mon/PaxosService: not active during paxos UPDATING_PREVIOUS

Treat this as an extension of the recovery process, e.g.

 RECOVERING -> ACTIVE
or
 RECOVERING -> UPDATING_PREVIOUS -> ACTIVE

and we are not active until we get to "the end" in both cases.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: simplify states
Sage Weil [Fri, 7 Jun 2013 18:40:22 +0000 (11:40 -0700)]
mon: simplify states

- make states mutually exclusive (an enum)
- rename locked -> updating_previous
- set state prior to begin() to simplify things a bit

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: not readable when LOCKED
Sage Weil [Fri, 7 Jun 2013 18:14:58 +0000 (11:14 -0700)]
mon/Paxos: not readable when LOCKED

If we are re-proposing a previously accepted value from a previous quorum,
we should not consider it readable, because it is possible it was exposed
to clients as committed (2/3 accepted) but not recored to be committed, and
we do not want to expose old state as readable when new state was
previously readable.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: cleanup: drop unused PREPARING state bit
Sage Weil [Fri, 7 Jun 2013 18:07:38 +0000 (11:07 -0700)]
mon/Paxos: cleanup: drop unused PREPARING state bit

This is never set when we block, and nobody looks at it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/PaxosService: simplify is_writeable
Sage Weil [Thu, 6 Jun 2013 22:20:05 +0000 (15:20 -0700)]
mon/PaxosService: simplify is_writeable

Recast this in terms of paxos check + our conditions, and make it
match wait_for_writeable().

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/PaxosService: simplify readable check
Sage Weil [Wed, 5 Jun 2013 00:03:15 +0000 (17:03 -0700)]
mon/PaxosService: simplify readable check

Recast this in terms of the paxos check and our additional conditions,
which match wait_for_readable().

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/MonmapMonitor: remove some dead code
Sage Weil [Fri, 31 May 2013 22:35:55 +0000 (15:35 -0700)]
mon/MonmapMonitor: remove some dead code

Signed-off-by: Sage Weil <sage@inktank.com>