]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agoinit-radosgw*: add all sections to usage output
Danny Al-Gaaf [Thu, 6 Jun 2013 13:34:54 +0000 (15:34 +0200)]
init-radosgw*: add all sections to usage output

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

11 years agoinit-radosgw*: add status
Danny Al-Gaaf [Thu, 6 Jun 2013 13:33:23 +0000 (15:33 +0200)]
init-radosgw*: add status

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

11 years agofix init-radosgw* to use the same indentation
Danny Al-Gaaf [Thu, 6 Jun 2013 13:21:30 +0000 (15:21 +0200)]
fix init-radosgw* to use the same indentation

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

11 years agoceph_authtool.cc: update help/usage text
Danny Al-Gaaf [Sun, 28 Jul 2013 21:25:58 +0000 (23:25 +0200)]
ceph_authtool.cc: update help/usage text

Added implemented but not listed commands to the help/usage text:
* -g  shortcut for --gen-key
* -a  shortcut for --add-key
* -u/--set-uid to set auid
* --gen-print-key
* --import-keyring

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

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 agoceph.spec.in: remove trailing paren in previous commit
Gary Lowell [Thu, 22 Aug 2013 20:29:32 +0000 (13:29 -0700)]
ceph.spec.in:  remove trailing paren in previous commit

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
11 years agoceph.spec.in: Don't invoke debug_package macro on centos.
Gary Lowell [Thu, 22 Aug 2013 18:07:16 +0000 (11:07 -0700)]
ceph.spec.in:  Don't invoke debug_package macro on centos.

If the redhat-rpm-config package is installed, the debuginfo rpms will
be built by default.   The build will fail when the package installed
and the specfile also invokes the macro.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
11 years agoosd: get initial full map after a map gap
Sage Weil [Sun, 28 Jul 2013 15:59:21 +0000 (08:59 -0700)]
osd: get initial full map after a map gap

If there is a gap in our map history, get the full range of maps that
the mon has.  Make sure the first one is a full map.

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

11 years agoosd: fix off-by-one in map gap logic
Sage Weil [Sun, 28 Jul 2013 15:55:38 +0000 (08:55 -0700)]
osd: fix off-by-one in map gap logic

If we have map 250, and monitor's first is 251, but sends 260, we can
request the intervening range.

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

11 years agoOSD: tolerate holes in stored maps
Samuel Just [Mon, 22 Jul 2013 23:00:07 +0000 (16:00 -0700)]
OSD: tolerate holes in stored maps

We may have holes in stored maps during init_splits_between
and advance_pg.  In either case, we should simply skip the
missing maps.

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

Conflicts:

src/osd/OSD.cc

11 years agoceph-disk: partprobe after creating journal partition
Sage Weil [Wed, 21 Aug 2013 05:39:09 +0000 (22:39 -0700)]
ceph-disk: partprobe after creating journal partition

At least one user reports that a partprobe is needed after creating the
journal partition.  It is not clear why sgdisk is not doing it, but this
fixes ceph-disk for them, and should be harmless for other users.

Fixes: #5599
Tested-by: lurbs in #ceph
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 2af59d5e81c5e3e3d7cfc50d9330d7364659c5eb)

11 years agoosdc/ObjectCacher: do not merge rx buffers
Sage Weil [Fri, 16 Aug 2013 04:48:06 +0000 (21:48 -0700)]
osdc/ObjectCacher: do not merge rx buffers

We do not try to merge rx buffers currently.  Make that explicit and
documented in the code that it is not supported.  (Otherwise the
last_read_tid values will get lost and read results won't get applied
to the cache properly.)

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

11 years agoosdc/ObjectCacher: match reads with their original rx buffers
Sage Weil [Fri, 16 Aug 2013 04:47:18 +0000 (21:47 -0700)]
osdc/ObjectCacher: match reads with their original rx buffers

Consider a sequence like:

 1- start read on 100~200
       100~200 state rx
 2- truncate to 200
       100~100 state rx
 3- start read on 200~200
       100~100 state rx
       200~200 state rx
 4- get 100~200 read result

Currently this makes us crash on

osdc/ObjectCacher.cc: 738: FAILED assert(bh->length() <= start+(loff_t)length-opos)

when processing the second 200~200 bufferhead (it is too big).  The
larger issue, though, is that we should not be looking at this data at
all; it has been truncated away.

Fix this by marking each rx buffer with the read request that is sent to
fill it, and only fill it from that read request.  Then the first reply
will fill the first 100~100 extend but not touch the other extent; the
second read will do that.

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

11 years agomon/Paxos: fix another uncommitted value corner case
Sage Weil [Thu, 22 Aug 2013 22:54:48 +0000 (15:54 -0700)]
mon/Paxos: fix another uncommitted value corner case

It is possible that we begin the paxos recovery with an uncommitted
value for, say, commit 100.  During last/collect we discover 100 has been
committed already.  But also, another node provides an uncommitted value
for 101 with the same pn.  Currently, we refuse to learn it, because the
pn is not strictly > than our current uncommitted pn... even though it is
the next last_committed+1 value that we need.

There are two possible fixes here:

 - make this a >= as we can accept newer values from the same pn.
 - discard our uncommitted value metadata when we commit the value.

Let's do both!

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

11 years agoos: make readdir_r buffers larger
Sage Weil [Fri, 23 Aug 2013 18:45:35 +0000 (11:45 -0700)]
os: make readdir_r buffers larger

PATH_MAX isn't quite big enough.

Backport: dumpling, cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 99a2ff7da99f8cf70976f05d4fe7aa28dd7afae5)

11 years agoos: fix readdir_r buffer size
Sage Weil [Fri, 23 Aug 2013 18:45:08 +0000 (11:45 -0700)]
os: fix readdir_r buffer size

The buffer needs to be big or else we're walk all over the stack.

Backport: dumpling, cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 2df66d9fa214e90eb5141df4d5755b57e8ba9413)

Conflicts:

src/os/BtrfsFileStoreBackend.cc

11 years agoceph-disk: specify the filetype when mounting
Alfredo Deza [Fri, 23 Aug 2013 12:56:07 +0000 (08:56 -0400)]
ceph-disk: specify the filetype when mounting

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit f040020fb2a7801ebbed23439159755ff8a3edbd)

11 years agoQA: Compile fsstress if missing on machine.
Sandon Van Ness [Fri, 23 Aug 2013 02:44:40 +0000 (19:44 -0700)]
QA: Compile fsstress if missing on machine.

Some distro's have a lack of ltp-kernel packages and all we need is
fstress. This just modified the shell script to download/compile
fstress from source and copy it to the right location if it doesn't
currently exist where it is expected. It is a very small/quick
compile and currently only SLES and debian do not have it already.

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
11 years agomds: fix locking, use-after-free/race in handle_accept
Sage Weil [Mon, 5 Aug 2013 19:52:44 +0000 (12:52 -0700)]
mds: fix locking, use-after-free/race in handle_accept

We need to hold mds_lock here.

Normally the con also holds a reference, but an ill-timed connection reset
could drop it.

Fixes: #5883
Backport: dumpling, cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a0929955cb84fb8cfdeb551d6863e4955b8e2a71)

11 years ago.gitignore: ignore test-driver
Sage Weil [Thu, 22 Aug 2013 17:14:59 +0000 (10:14 -0700)]
.gitignore: ignore test-driver

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

Conflicts:

.gitignore

11 years agofuse: fix warning when compiled against old fuse versions
Sage Weil [Fri, 9 Aug 2013 19:42:49 +0000 (12:42 -0700)]
fuse: fix warning when compiled against old fuse versions

client/fuse_ll.cc: In function 'void invalidate_cb(void*, vinodeno_t, int64_t, int64_t)':
warning: client/fuse_ll.cc:540: unused variable 'fino'

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

11 years agojson_spirit: remove unused typedef
Sage Weil [Fri, 9 Aug 2013 19:40:34 +0000 (12:40 -0700)]
json_spirit: remove unused typedef

In file included from json_spirit/json_spirit_writer.cpp:7:0:
json_spirit/json_spirit_writer_template.h: In function 'String_type json_spirit::non_printable_to_string(unsigned int)':
json_spirit/json_spirit_writer_template.h:37:50: warning: typedef 'Char_type' locally defined but not used [-Wunused-local-typedefs]
         typedef typename String_type::value_type Char_type;

(Also, ha ha, this file uses \r\n.)

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

11 years agogtest: add build-aux/test-driver to .gitignore
Sage Weil [Fri, 9 Aug 2013 19:31:41 +0000 (12:31 -0700)]
gtest: add build-aux/test-driver to .gitignore

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

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 agov0.61.8 v0.61.8
Gary Lowell [Mon, 19 Aug 2013 06:54:49 +0000 (23:54 -0700)]
v0.61.8

11 years agoRadosClient: shutdown monclient after dropping lock
Samuel Just [Thu, 8 Aug 2013 22:12:46 +0000 (15:12 -0700)]
RadosClient: shutdown monclient after dropping lock

Otherwise, the monclient shutdown may deadlock waiting
on a context trying to take the RadosClient lock.

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

11 years agomon/OSDMonitor: make 'osd pool mksnap ...' not expose uncommitted state
Sage Weil [Sat, 17 Aug 2013 16:05:32 +0000 (09:05 -0700)]
mon/OSDMonitor: make 'osd pool mksnap ...' not expose uncommitted state

[This is a backport of d1501938f5d07c067d908501fc5cfe3c857d7281]

We were returning success without waiting if the pending pool state had
the snap.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agomon/OSDMonitor: make 'osd pool rmsnap ...' not racy/crashy
Sage Weil [Fri, 16 Aug 2013 17:52:02 +0000 (10:52 -0700)]
mon/OSDMonitor: make 'osd pool rmsnap ...' not racy/crashy

NOTE: This is a manual backport of d90683fdeda15b726dcf0a7cab7006c31e99f14.
Due to all kinds of collateral changes in the mon the original patch
doesn't cleanly apply.

Ensure that the snap does in fact exist before we try to remove it.  This
avoids a crash where a we get two dup rmsnap requests (due to thrashing, or
a reconnect, or something), the committed (p) value does have the snap, but
the uncommitted (pp) does not.  This fails the old test such that we try
to remove it from pp again, and assert.

Restructure the flow so that it is easier to distinguish the committed
short return from the uncommitted return (which must still wait for the
commit).

         0> 2013-07-16 14:21:27.189060 7fdf301e9700 -1 osd/osd_types.cc: In function 'void pg_pool_t::remove_snap(snapid_t)' thread 7fdf301e9700 time 2013-07-16 14:21:27.187095
    osd/osd_types.cc: 662: FAILED assert(snaps.count(s))

     ceph version 0.66-602-gcd39d8a (cd39d8a6727d81b889869e98f5869e4227b50720)
     1: (pg_pool_t::remove_snap(snapid_t)+0x6d) [0x7ad6dd]
     2: (OSDMonitor::prepare_command(MMonCommand*)+0x6407) [0x5c1517]
     3: (OSDMonitor::prepare_update(PaxosServiceMessage*)+0x1fb) [0x5c41ab]
     4: (PaxosService::dispatch(PaxosServiceMessage*)+0x937) [0x598c87]
     5: (Monitor::handle_command(MMonCommand*)+0xe56) [0x56ec36]
     6: (Monitor::_ms_dispatch(Message*)+0xd1d) [0x5719ad]
     7: (Monitor::handle_forward(MForward*)+0x821) [0x572831]
     8: (Monitor::_ms_dispatch(Message*)+0xe44) [0x571ad4]
     9: (Monitor::ms_dispatch(Message*)+0x32) [0x588c52]
     10: (DispatchQueue::entry()+0x549) [0x7cf1d9]
     11: (DispatchQueue::DispatchThread::entry()+0xd) [0x7060fd]
     12: (()+0x7e9a) [0x7fdf35165e9a]
     13: (clone()+0x6d) [0x7fdf334fcccd]
     NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
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)

11 years agomon/Paxos: bootstrap peon too if monmap updates
Sage Weil [Fri, 12 Jul 2013 21:27:04 +0000 (14:27 -0700)]
mon/Paxos: bootstrap peon too if monmap updates

If we get a monmap update, the leader bootstraps.  Peons should do the
same.

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

11 years agoosd: fix race when queuing recovery ops
Sage Weil [Tue, 25 Jun 2013 20:16:45 +0000 (13:16 -0700)]
osd: fix race when queuing recovery ops

Previously we would sample how many ops to start under the lock, drop it,
and start that many.  This is racy because multiple threads can jump in
and we start too many ops.  Instead, claim as many slots as we can and
release them back later if we do not end up using them.

Take care to re-wake the work-queue since we are releasing more resources
for wq use.

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

11 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>
(cherry picked from commit 3791a1e55828ba541f9d3e8e3df0da8e79c375f9)

11 years agoceph-disk: fix mount options passed to move_mount
Sage Weil [Sat, 10 Aug 2013 01:02:32 +0000 (18:02 -0700)]
ceph-disk: fix mount options passed to move_mount

Commit 6cbe0f021f62b3ebd5f68fcc01a12fde6f08cff5 added a mount_options but
in certain cases it may be blank.  Fill in with the defaults, just as we
do in mount().

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

11 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

11 years agoceph.spec.in: obsolete ceph-libs only on the affected distro
Danny Al-Gaaf [Tue, 23 Jul 2013 19:56:09 +0000 (21:56 +0200)]
ceph.spec.in: obsolete ceph-libs only on the affected distro

The ceph-libs package existed only on Redhat based distro,
there was e.g. never such a package on SUSE. Therefore: make
sure the 'Obsoletes' is only set on these affected distros.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph.spec.in: Obsolete ceph-libs
Gary Lowell [Wed, 3 Jul 2013 18:28:28 +0000 (11:28 -0700)]
ceph.spec.in:  Obsolete ceph-libs

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agocommon: pick_addresses: fix bug with observer class that triggered #5205
Joao Eduardo Luis [Fri, 9 Aug 2013 21:48:15 +0000 (14:48 -0700)]
common: pick_addresses: fix bug with observer class that triggered #5205

The Observer class we defined to observe conf changes and thus avoid
triggering #5205 (as fixed by eb86eebe1ba42f04b46f7c3e3419b83eb6fe7f9a),
was returning always the same const static array, which would lead us to
always populate the observer's list with an observer for 'public_addr'.

This would of course become a problem when trying to obtain the observer
for 'cluster_add' during md_config_t::set_val() -- thus triggering the
same assert as initially reported on #5205.

Backport: cuttlefish
Fixes: #5205
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 7ed6de9dd7aed59f3c5dd93e012cf080bcc36d8a)

11 years agomake sure we are using the mount options
Alfredo Deza [Thu, 8 Aug 2013 23:09:26 +0000 (16:09 -0700)]
make sure we are using the mount options

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

11 years agoPG: set !flushed in Reset()
Samuel Just [Fri, 2 Aug 2013 18:58:52 +0000 (11:58 -0700)]
PG: set !flushed in Reset()

Otherwise, we might serve a pull before we start_flush in the
ReplicaActive constructor.

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

11 years agoosd: make open classes on start optional
Sage Weil [Fri, 26 Jul 2013 21:02:07 +0000 (14:02 -0700)]
osd: make open classes on start optional

This is cuttlefish; default to the old behavior!

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

11 years agoosd: load all classes on startup
Sage Weil [Fri, 26 Jul 2013 20:58:46 +0000 (13:58 -0700)]
osd: load all classes on startup

This avoid creating a wide window between when ceph-osd is started and
when a request arrives needing a class and it is loaded.  In particular,
upgrading the packages in that window may cause linkage errors (if the
class API has changed, for example).

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

Conflicts:
src/osd/ClassHandler.cc

11 years agoceph_test_rados: print version banner on startup
Sage Weil [Sun, 28 Jul 2013 22:42:08 +0000 (15:42 -0700)]
ceph_test_rados: print version banner on startup

It is helpful when looking at qa run logs to see what version of the
tester is running.

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

11 years agoceph_test_rados: add --pool <name> arg
Sage Weil [Fri, 14 Jun 2013 05:08:36 +0000 (22:08 -0700)]
ceph_test_rados: add --pool <name> arg

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

11 years agoupstart: stop ceph-create-keys when the monitor stops
Sage Weil [Fri, 26 Jul 2013 21:07:02 +0000 (14:07 -0700)]
upstart: stop ceph-create-keys when the monitor stops

This avoids lingering ceph-create-keys tasks.

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

11 years agoFileStore: fix fd leak in _check_global_replay_guard
Samuel Just [Fri, 26 Jul 2013 20:42:27 +0000 (13:42 -0700)]
FileStore: fix fd leak in _check_global_replay_guard

Bug introduced in f3f92fe21061e21c8b259df5ef283a61782a44db.

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

11 years agomon/Paxos: share uncommitted value when leader is/was behind
Sage Weil [Thu, 25 Jul 2013 18:10:53 +0000 (11:10 -0700)]
mon/Paxos: share uncommitted value when leader is/was behind

If the leader has and older lc than we do, and we are sharing states to
bring them up to date, we still want to also share our uncommitted value.
This particular case was broken by b26b7f6e, which was only contemplating
the case where the leader was ahead of us or at the same point as us, but
not the case where the leader was behind.  Note that the call to
share_state() a few lines up will bring them fully up to date, so
after they receive and store_state() for this message they will be at the
same lc as we are.

Fixes: #5750
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 05b6c7e8645081f405c616735238ae89602d3cc6)

11 years agoMerge remote-tracking branch 'gh/cuttlefish-next' into cuttlefish
Sage Weil [Thu, 25 Jul 2013 22:21:31 +0000 (15:21 -0700)]
Merge remote-tracking branch 'gh/cuttlefish-next' into cuttlefish

11 years agoHashIndex: reset attr upon split or merge completion
Samuel Just [Wed, 24 Jul 2013 01:04:40 +0000 (18:04 -0700)]
HashIndex: reset attr upon split or merge completion

A replay of an in progress merge or split might make
our counts unreliable.

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

11 years agotest/filestore/store_test: add test for 5723
Samuel Just [Wed, 24 Jul 2013 00:34:25 +0000 (17:34 -0700)]
test/filestore/store_test: add test for 5723

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

Conflicts:
src/os/LFNIndex.cc
src/test/filestore/store_test.cc

11 years agoFileStore::_collection_rename: fix global replay guard
Samuel Just [Tue, 23 Jul 2013 20:51:26 +0000 (13:51 -0700)]
FileStore::_collection_rename: fix global replay guard

If the replay is being replayed, we might have already
performed the rename, skip it.  Also, we must set the
collection replay guard only after we have done the
rename.

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

11 years agov0.61.7 v0.61.7
Gary Lowell [Thu, 25 Jul 2013 03:44:12 +0000 (20:44 -0700)]
v0.61.7

11 years agoPGLog::rewind_divergent_log: unindex only works from tail, index() instead
Samuel Just [Mon, 22 Jul 2013 20:46:10 +0000 (13:46 -0700)]
PGLog::rewind_divergent_log: unindex only works from tail, index() instead

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

The original patch covered the same code in PGLog.cc.

Conflicts:

src/osd/PGLog.cc
src/osd/PG.cc

11 years agomsg/Pipe: do not hold pipe_lock for verify_authorizer()
Sage Weil [Thu, 18 Jul 2013 16:55:43 +0000 (09:55 -0700)]
msg/Pipe: do not hold pipe_lock for verify_authorizer()

We shouldn't hold the pipe_lock while doing the ms_verify_authorizer
upcalls.

Fix by unlocking a bit earlier, and verifying our state is still correct
in the failure path.

This regression was introduced by ecab4bb9513385bd765cca23e4e2fadb7ac4bac2.

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

Conflicts:

src/msg/Pipe.cc

11 years agomsg/Pipe: a bit of additional debug output
Sage Weil [Tue, 16 Jul 2013 21:17:05 +0000 (14:17 -0700)]
msg/Pipe: a bit of additional debug output

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

11 years agomsg/Pipe: hold pipe_lock during important parts of accept()
Sage Weil [Tue, 16 Jul 2013 20:13:46 +0000 (13:13 -0700)]
msg/Pipe: hold pipe_lock during important parts of accept()

Previously we did not bother with locking for accept() because we were
not visible to any other threads.  However, we need to close accepting
Pipes from mark_down_all(), which means we need to handle interference.

Fix up the locking so that we hold pipe_lock when looking at Pipe state
and verify that we are still in the ACCEPTING state any time we retake
the lock.

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

11 years agomsgr: fix a typo/goto-cross from dd4addef2d
Greg Farnum [Wed, 17 Jul 2013 22:23:12 +0000 (15:23 -0700)]
msgr: fix a typo/goto-cross from dd4addef2d

We didn't build or review carefully enough!

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

11 years agomsgr: close accepting_pipes from mark_down_all()
Sage Weil [Tue, 16 Jul 2013 00:16:23 +0000 (17:16 -0700)]
msgr: close accepting_pipes from mark_down_all()

We need to catch these pipes too, particularly when doing a rebind(),
to avoid them leaking through.

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

11 years agomsgr: maintain list of accepting pipes
Sage Weil [Tue, 16 Jul 2013 00:14:25 +0000 (17:14 -0700)]
msgr: maintain list of accepting pipes

New pipes exist in a sort of limbo before we know who the peer is and
add them to rank_pipe.  Keep a list of them in accepting_pipes for that
period.

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

11 years agomsgr: adjust nonce on rebind()
Sage Weil [Tue, 16 Jul 2013 23:25:28 +0000 (16:25 -0700)]
msgr: adjust nonce on rebind()

We can have a situation where:

 - we have a pipe to a peer
 - pipe goes to standby (on peer)
 - we rebind to a new port
 - ....
 - we rebind again to the same old port
 - we connect to peer

and get reattached to the ancient pipe from two instances back.  Avoid that
by picking a new nonce each time we rebind.

Add 1,000,000 each time so that the port is still legible in the printed
output.

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

Conflicts:

src/msg/Accepter.cc

11 years agomsgr: mark_down_all() after, not before, rebind
Sage Weil [Tue, 16 Jul 2013 00:10:23 +0000 (17:10 -0700)]
msgr: mark_down_all() after, not before, rebind

If we are shutting down all old connections and binding to new ports,
we want to avoid a sequence like:

 - close all prevoius connections
 - new connection comes in on old port
 - rebind to new ports
 -> connection from old port leaks through

As a first step, close all connections after we shut down the old
accepter and before we start the new one.

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

Conflicts:

src/msg/SimpleMessenger.cc

11 years agomsg/Pipe: unlock msgr->lock earlier in accept()
Sage Weil [Tue, 16 Jul 2013 20:01:18 +0000 (13:01 -0700)]
msg/Pipe: unlock msgr->lock earlier in accept()

Small cleanup.  Nothing needs msgr->lock for the previously larger
window.

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

11 years agomsg/Pipe: avoid creating empty out_q entry
Sage Weil [Tue, 16 Jul 2013 17:09:02 +0000 (10:09 -0700)]
msg/Pipe: avoid creating empty out_q entry

We need to maintain the invariant that all sub queues in out_q are never
empty.  Fix discard_requeued_up_to() to avoid creating an entry unless we
know it is already present.

This bug leads to an incorrect reconnect attempt when

 - we accept a pipe (lossless peer)
 - they send some stuff, maybe
 - fault
 - we initiate reconnect, even tho we have nothing queued

In particular, we shouldn't reconnect because we aren't checking for
resets, and the fact that our out_seq is 0 while the peer's might be
something else entirely will trigger asserts later.

This fixes at least one source of #5626, and possibly #5517.

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

11 years agomsg/Pipe: assert lock is held in various helpers
Sage Weil [Mon, 15 Jul 2013 21:47:05 +0000 (14:47 -0700)]
msg/Pipe: assert lock is held in various helpers

These all require that we hold pipe_lock.

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

11 years agomsg/Pipe: be a bit more explicit about encoding outgoing messages
Sage Weil [Sun, 14 Jul 2013 15:55:52 +0000 (08:55 -0700)]
msg/Pipe: be a bit more explicit about encoding outgoing messages

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

11 years agomsg/Pipe: fix RECONNECT_SEQ behavior
Sage Weil [Fri, 12 Jul 2013 23:21:24 +0000 (16:21 -0700)]
msg/Pipe: fix RECONNECT_SEQ behavior

Calling handle_ack() here has no effect because we have already
spliced sent messages back into our out queue.  Instead, pull them out
of there and discard.  Add a few assertions along the way.

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

11 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>
(cherry picked from commit 9586305a2317c7d6bbf31c9cf5b67dc93ccab50d)

11 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>
(cherry picked from commit ec612a5bda119cea52bbac9b2a49ecf1e83b08e5)

11 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>
(cherry picked from commit afafb87e8402242d3897069f4b94ba46ffe0c413)

11 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>
(cherry picked from commit 5fc1dabfb3b2cbffdee3214d24d7769d6e440e45)

Conflicts:

src/msg/SimpleMessenger.cc

11 years agoReplicatedPG: track temp collection contents, clear during on_change
Samuel Just [Fri, 19 Jul 2013 02:26:02 +0000 (19:26 -0700)]
ReplicatedPG: track temp collection contents, clear during on_change

We also assert in on_flushed() that the temp collection is actually
empty.

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

Conflicts:

src/osd/ReplicatedPG.cc

11 years agoPG, ReplicatedPG: pass a transaction down to ReplicatedPG::on_change
Samuel Just [Fri, 19 Jul 2013 02:25:14 +0000 (19:25 -0700)]
PG, ReplicatedPG: pass a transaction down to ReplicatedPG::on_change

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

11 years agoPG: start flush on primary only after we process the master log
Samuel Just [Wed, 17 Jul 2013 22:04:10 +0000 (15:04 -0700)]
PG: start flush on primary only after we process the master log

Once we start serving reads, stray objects must have already
been removed.  Therefore, we have to flush all operations
up to the transaction writing out the authoritative log.
On replicas, we flush in Stray() if we will not eventually
be activated and in ReplicaActive if we are in the acting
set.  This way a replica won't serve a replica read until
the store is consistent.

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

11 years agoReplicatedPG: replace clean_up_local with a debug check
Samuel Just [Wed, 17 Jul 2013 19:51:19 +0000 (12:51 -0700)]
ReplicatedPG: replace clean_up_local with a debug check

Stray objects should have been cleaned up in the merge_log
transactions.  Only on the primary have those operations
necessarily been flushed at activate().

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

11 years agoFileStore: add global replay guard for split, collection_rename
Samuel Just [Thu, 18 Jul 2013 17:12:17 +0000 (10:12 -0700)]
FileStore: add global replay guard for split, collection_rename

In the event of a split or collection rename, we need to ensure that
we don't replay any operations on objects within those collections
prior to that point.  Thus, we mark a global replay guard on the
collection after doing a syncfs and make sure to check that in
_check_replay_guard() for all object operations.

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

Conflicts:

src/os/FileStore.cc

11 years agoOSD: add config option for peering_wq batch size
Samuel Just [Mon, 15 Jul 2013 20:44:20 +0000 (13:44 -0700)]
OSD: add config option for peering_wq batch size

Large peering_wq batch sizes may excessively delay
peering messages resulting in unreasonably long
peering.  This may speed up peering.

Backport: cuttlefish
Related: #5084
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 39e5a2a406b77fa82e9a78c267b679d49927e3c3)

11 years agoceph-disk: use new get_dev_path helper for list
Sage Weil [Wed, 24 Jul 2013 21:46:24 +0000 (14:46 -0700)]
ceph-disk: use new get_dev_path helper for list

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Tested-by: Olivier Bonvalet <ob.ceph@daevel.fr>
(cherry picked from commit fd1fd664d6102a2a96b27e8ca9933b54ac626ecb)

11 years agoceph-disk: use /sys/block to determine partition device names
Sage Weil [Thu, 11 Jul 2013 19:59:56 +0000 (12:59 -0700)]
ceph-disk: use /sys/block to determine partition device names

Not all devices are basename + number; some have intervening character(s),
like /dev/cciss/c0d1p2.

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

11 years agoceph-disk: reimplement is_partition() using /sys/block
Sage Weil [Wed, 3 Jul 2013 18:01:58 +0000 (11:01 -0700)]
ceph-disk: reimplement is_partition() using /sys/block

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

11 years agoceph-disk: use get_dev_name() helper throughout
Sage Weil [Wed, 3 Jul 2013 18:01:39 +0000 (11:01 -0700)]
ceph-disk: use get_dev_name() helper throughout

This is more robust than the broken split trick.

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

11 years agoceph-disk: refactor list_[all_]partitions
Sage Weil [Wed, 3 Jul 2013 17:55:36 +0000 (10:55 -0700)]
ceph-disk: refactor list_[all_]partitions

Make these methods work in terms of device *names*, not paths, and fix up
the only direct list_partitions() caller to do the same.

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

11 years agoceph-disk: add get_dev_name, path helpers
Sage Weil [Wed, 3 Jul 2013 17:52:29 +0000 (10:52 -0700)]
ceph-disk: add get_dev_name, path helpers

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

11 years agoceph-disk: handle /dev/foo/bar devices throughout
Sage Weil [Tue, 18 Jun 2013 23:21:48 +0000 (16:21 -0700)]
ceph-disk: handle /dev/foo/bar devices throughout

Assume the last component is the unique device name, even if it appears
under a subdir of /dev.

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

11 years agoceph-disk: make is_held() smarter about full disks
Sage Weil [Tue, 18 Jun 2013 03:54:15 +0000 (20:54 -0700)]
ceph-disk: make is_held() smarter about full disks

Handle the case where the device is a full disk.  Make the partition
check a bit more robust (don't make assumptions about naming aside from
the device being a prefix of the partition).

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

11 years agomon/OSDMonitor: search for latest full osdmap if record version is missing
Sage Weil [Wed, 24 Jul 2013 18:55:42 +0000 (11:55 -0700)]
mon/OSDMonitor: search for latest full osdmap if record version is missing

In 97462a3213e5e15812c79afc0f54d697b6c498b1 we tried to search for a
recent full osdmap but were looking at the wrong key.  If full_0 was
present we could record that the latest full map was last_committed even
though it wasn't present.  This is fixed in 76cd7ac1c, but we need to
compensate for when get_version_latest_full() gives us a back version
number by repeating the search.

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

11 years agotest: test_store_tool: global init before using LevelDBStore
Joao Eduardo Luis [Mon, 17 Jun 2013 13:43:36 +0000 (14:43 +0100)]
test: test_store_tool: global init before using LevelDBStore

Fixes a segfault

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

11 years agomon: OSDMonitor: fix a bug introduced on 97462a32
Joao Eduardo Luis [Wed, 24 Jul 2013 11:00:28 +0000 (12:00 +0100)]
mon: OSDMonitor: fix a bug introduced on 97462a32

Fixes: #5737
Backport: cuttlefish

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

11 years agomon/Paxos: fix pn for uncommitted value during collect/last phase
Sage Weil [Sun, 21 Jul 2013 15:48:18 +0000 (08:48 -0700)]
mon/Paxos: fix pn for uncommitted value during collect/last phase

During the collect/last exchange, peers share any uncommitted values
with the leader.  They are supposed to also share the pn under which
that value was accepted, but were instead using the just-accepted pn
value.  This effectively meant that we *always* took the uncommitted
value; if there were multiples, which one we accepted depended on what
order the LAST messages arrived, not which pn the values were generated
under.

The specific failure sequence I observed:

 - collect
  - learned uncommitted value for 262 from myself
  - send collect with pn 901
 - got last with pn 901 (incorrect) for 200 (old) from peer
  - discard our own value, remember the other
 - finish collect phase
  - ignore old uncommitted value

Fix this by storing a pending_v and pending_pn value whenever we accept
a value.  Use this to send an appropriate pn value in the LAST reply
so that the leader can make it's decision about which uncommitted value
to accept based on accurate information.  Also use it when we learn
the uncommitted value from ourselves.

We could probably be more clever about storing less information here,
for example by omitting pending_v and clearing pending_pn at the
appropriate point, but that would be more fragile.  Similarly, we could
store a pn for *every* commit if we wanted to lay some groundwork for
having multiple uncommitted proposals in flight, but I don't want to
speculate about what is necessary or sufficient for a correct solution
there.

Fixes: #5698
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 20baf662112dd5f560bc3a2d2114b469444c3de8)

11 years agomon/Paxos: debug ignored uncommitted values
Sage Weil [Sun, 21 Jul 2013 15:12:46 +0000 (08:12 -0700)]
mon/Paxos: debug ignored uncommitted values

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

11 years agomon/Paxos: only learn uncommitted value if it is in the future
Sage Weil [Sun, 21 Jul 2013 15:11:22 +0000 (08:11 -0700)]
mon/Paxos: only learn uncommitted value if it is in the future

If an older peer sends an uncommitted value, make sure we only take it
if it is in the future, and at least as new as any current uncommitted
value.

(Prior to the previous patch, peers could send values from long-past
rounds.  The pn values are also bogus.)

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

11 years agomon/Paxos: only share uncommitted value if it is next
Sage Weil [Mon, 22 Jul 2013 21:13:23 +0000 (14:13 -0700)]
mon/Paxos: only share uncommitted value if it is next

We may have an uncommitted value from our perspective (it is our lc + 1)
when the collector has a much larger lc (because we have been out for
the last few rounds).  Only share an uncommitted value if it is in fact
the next value.

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

12 years agov0.61.6 v0.61.6
Gary Lowell [Tue, 23 Jul 2013 20:52:19 +0000 (13:52 -0700)]
v0.61.6

12 years agomon/OSDMonitor: fix base case for 7fb3804fb workaround
Sage Weil [Tue, 23 Jul 2013 20:32:12 +0000 (13:32 -0700)]
mon/OSDMonitor: fix base case for 7fb3804fb workaround

After cluster creation, we have no full map stored and first_committed ==
1.  In that case, there is no need for a full map, since we can get there
from OSDMap() and the incrementals.

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

12 years agomon: OSDMonitor: work around a full version bug introduced in 7fb3804fb
Joao Eduardo Luis [Tue, 23 Jul 2013 16:25:13 +0000 (17:25 +0100)]
mon: OSDMonitor: work around a full version bug introduced in 7fb3804fb

In 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 we moved the full version
stashing logic to the encode_trim_extra() function.  However, we forgot
to update the osdmap's 'latest_full' key that should always point to
the latest osdmap full version.  This eventually degenerated in a missing
full version after a trim.  This patch works around this bug by looking
for the latest available full osdmap version in the store and updating
'latest_full' to its proper value.

Related-to: #5704
Backport: cuttlefish

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

12 years agomon: OSDMonitor: update the osdmap's latest_full with the new full version
Joao Eduardo Luis [Tue, 23 Jul 2013 15:36:52 +0000 (16:36 +0100)]
mon: OSDMonitor: update the osdmap's latest_full with the new full version

We used to do this on encode_full(), but since [1] we no longer rely on
PaxosService to manage the full maps for us.  And we forgot to write down
the latest_full version to the store, leaving it in a truly outdated state.

[1] - 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6

Fixes: #5704
Backport: cuttlefish
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a815547ed3e5ffdbbb96c8c0c1b8d6dd8c62bfba)

12 years agomon: decline to scrub when paxos is not active
Sage Weil [Thu, 18 Jul 2013 21:35:19 +0000 (14:35 -0700)]
mon: decline to scrub when paxos is not active

In f1ce8d7c955a2443111bf7d9e16b4c563d445712 we close a race between scrub
and paxos commit completion on the leader.  The fix is nontrivial to
backport and probably not worthwhile; just avoid scrubbing at that time
for now.

Note that the actual fix for this is in commit
f1ce8d7c955a2443111bf7d9e16b4c563d445712.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agov0.61.5 v0.61.5
Gary Lowell [Wed, 17 Jul 2013 23:39:08 +0000 (16:39 -0700)]
v0.61.5

12 years agoceph-disk: rely on /dev/disk/by-partuuid instead of special-casing journal symlinks
Sage Weil [Tue, 16 Jul 2013 20:14:50 +0000 (13:14 -0700)]
ceph-disk: rely on /dev/disk/by-partuuid instead of special-casing journal symlinks

This was necessary when ceph-disk-udev didn't create the by-partuuid (and
other) symlinks for us, but now it is fragile and error-prone.  (It also
appears to be broken on a certain customer RHEL VM.)  See
d7f7d613512fe39ec883e11d201793c75ee05db1.

Instead, just use the by-partuuid symlinks that we spent all that ugly
effort generating.

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

12 years agomon: Monitor: StoreConverter: clearer debug message on 'needs_conversion()'
Joao Eduardo Luis [Tue, 16 Jul 2013 15:49:48 +0000 (16:49 +0100)]
mon: Monitor: StoreConverter: clearer debug message on 'needs_conversion()'

The previous debug message outputted the function's name, as often our
functions do.  This was however a source of bewilderment, as users would
see those in logs and think their stores would need conversion.  Changing
this message is trivial enough and it will make ceph users happier log
readers.

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

12 years agomon: Monitor: do not reopen MonitorDBStore during conversion
Joao Eduardo Luis [Tue, 16 Jul 2013 15:45:39 +0000 (16:45 +0100)]
mon: Monitor: do not reopen MonitorDBStore during conversion

We already open the store on ceph_mon.cc, before we start the conversion.
Given we are unable to reproduce this every time a conversion is triggered,
we are led to believe that this causes a race in leveldb that will lead
to 'store.db/LOCK' being locked upon the open this patch removes.

Regardless, reopening the db here is pointless as we already did it when
we reach Monitor::StoreConverter::convert().

Fixes: #5640
Backport: cuttlefish

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