]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
10 years agotests: reduce osd-crush.sh execution time 2341/head
Loic Dachary [Thu, 28 Aug 2014 10:47:03 +0000 (12:47 +0200)]
tests: reduce osd-crush.sh execution time

A loop creating 255 crush rulesets via the command line takes
minutes. It is replaced by the generation of a crushmap instead.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agodoc: Update docs about OSD benchmark syntax
Wido den Hollander [Thu, 28 Aug 2014 06:18:16 +0000 (08:18 +0200)]
doc: Update docs about OSD benchmark syntax

10 years agoRevert "doc: Update docs about OSD benchmark syntax"
Wido den Hollander [Thu, 28 Aug 2014 06:16:03 +0000 (08:16 +0200)]
Revert "doc: Update docs about OSD benchmark syntax"

This reverts commit 36f15c3026debd808920a04bc3a60c96b119405b.

Commit included submodule change which was not supposed to happen.

10 years agodoc: Update docs about OSD benchmark syntax
Wido den Hollander [Thu, 28 Aug 2014 06:12:30 +0000 (08:12 +0200)]
doc: Update docs about OSD benchmark syntax

10 years agoMerge pull request #2339 from leseb/sample-ceph-conf-addition
Sage Weil [Wed, 27 Aug 2014 21:43:33 +0000 (14:43 -0700)]
Merge pull request #2339 from leseb/sample-ceph-conf-addition

sample.ceph.conf: some updates

10 years agoMerge remote-tracking branch 'gh/wip-rewrite-PR2189'
Sage Weil [Wed, 27 Aug 2014 21:24:54 +0000 (14:24 -0700)]
Merge remote-tracking branch 'gh/wip-rewrite-PR2189'

10 years agoMove fedora patch file (used by ceph.spec.in) to rpm/ subdir
Dan Mick [Wed, 27 Aug 2014 19:56:43 +0000 (12:56 -0700)]
Move fedora patch file (used by ceph.spec.in) to rpm/ subdir

Signed-off-by: Dan Mick <dan.mick@inktank.com>
10 years agoceph.spec.in: tests for rhel or centos need to not include _version
Dan Mick [Tue, 12 Aug 2014 23:31:22 +0000 (16:31 -0700)]
ceph.spec.in: tests for rhel or centos need to not include _version

rhel_version and centos_version are apparently the OpenSUSE Build
names; the native macros are just "rhel" and "centos" (and contain
a version number, should it be necessary).

Signed-off-by: Dan Mick <dan.mick@inktank.com>
10 years agoceph.spec.in: Add a small comment on the empty %files section
Dan Mick [Tue, 12 Aug 2014 21:46:52 +0000 (14:46 -0700)]
ceph.spec.in: Add a small comment on the empty %files section

as suggested by Dan Mick.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
10 years agoceph.spec.in: Obsolete all older versions.
Dan Mick [Tue, 12 Aug 2014 21:39:18 +0000 (14:39 -0700)]
ceph.spec.in: Obsolete all older versions.

Now this changeset can be used on all current ceph releases that already
have the package split.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
10 years agoceph.spec.in: No version on ceph-libs Obsoletes.
Dan Mick [Tue, 12 Aug 2014 21:09:43 +0000 (14:09 -0700)]
ceph.spec.in: No version on ceph-libs Obsoletes.

If we are installing with the new package structure we don't ever want the
new package to co-exist with the old one; this includes the mistakenly-
released v0.81 on Fedora, which should be removed in favor of this
version.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
10 years agoceph.spec.in: Obselete ceph-libcephfs (not libcephfs)
Sandon Van Ness [Sat, 9 Aug 2014 01:01:30 +0000 (18:01 -0700)]
ceph.spec.in: Obselete ceph-libcephfs (not libcephfs)

I am guessing that because it was a sub-package libcephfs was mistakenly
used instead of ceph-libcephfs.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
10 years agoceph.spec.in: We need those nice recent changes for rhel7 in Fedora too.
Erik Logtenberg [Fri, 1 Aug 2014 12:20:18 +0000 (14:20 +0200)]
ceph.spec.in: We need those nice recent changes for rhel7 in Fedora too.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
10 years agoceph.spec.in, init-ceph.in: Don't autostart ceph service on Fedora.
Erik Logtenberg [Thu, 31 Jul 2014 22:13:50 +0000 (00:13 +0200)]
ceph.spec.in, init-ceph.in: Don't autostart ceph service on Fedora.

This patch is taken from the current Fedora package and makes the upstream
ceph.spec compliant with Fedora policy. The goal is to be fully compliant
upstream so that we can replace current Fedora package with upstream
package to fix many bugs in Fedora.

Addition from Dan Mick <dan.mick@inktank.com>:
Do this for RHEL and Centos as well, since they surely will benefit
from the same policy.   Note: this requires changes to
autobuild-ceph and ceph-build scripts, which currently copy
only the dist tarball to the rpmbuild/SOURCES dir.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
Signed-off-by: Dan Mick <dan.mick@inktank.com>:
10 years agoceph.spec.in: Add obsoletes for libcephfs
Erik Logtenberg [Thu, 31 Jul 2014 21:54:03 +0000 (23:54 +0200)]
ceph.spec.in: Add obsoletes for libcephfs

This fixes a bug for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1116614

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
10 years agoceph.spec.in: add ceph-libs-compat
Erik Logtenberg [Thu, 31 Jul 2014 21:49:56 +0000 (23:49 +0200)]
ceph.spec.in: add ceph-libs-compat

Added a ceph-libs-compat package in accordance with Fedora packaging
guidelines [1], to handle the recent package split more gracefully.
In Fedora this is necessary because there are already other packages
depending on ceph-libs, that need to be adjusted to depend on the new
split packages instead. In the mean time, ceph-libs-compat prevents
breakage.

[1] http://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
10 years agosystemd: ceph-mds and ceph-mon need networking too
Sage Weil [Wed, 27 Aug 2014 16:22:59 +0000 (09:22 -0700)]
systemd: ceph-mds and ceph-mon need networking too

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2306 from mgarces/patch-1
Sage Weil [Wed, 27 Aug 2014 16:22:18 +0000 (09:22 -0700)]
Merge pull request #2306 from mgarces/patch-1

needs network or it will not start if enabled

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2313 from dachary/wip-buffer
Sage Weil [Wed, 27 Aug 2014 16:17:51 +0000 (09:17 -0700)]
Merge pull request #2313 from dachary/wip-buffer

common: remove spurious uint32_t in buffer.c

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agosample.ceph.conf: some updates 2339/head
Sébastien Han [Wed, 27 Aug 2014 13:58:44 +0000 (15:58 +0200)]
sample.ceph.conf: some updates

This commit adds:
- a section for radosgw
- fix the replica count value (default is 3 since firefly)
- more OSDs options for performance and CRUSH

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
10 years agoMerge pull request #1950 from xylv/wip-8583
Yehuda Sadeh [Wed, 27 Aug 2014 15:56:25 +0000 (08:56 -0700)]
Merge pull request #1950 from xylv/wip-8583

rgw: admin ops create user API can not determine existing user

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
10 years agotest/mon/mkfs.sh: fix test
Sage Weil [Wed, 27 Aug 2014 04:18:17 +0000 (21:18 -0700)]
test/mon/mkfs.sh: fix test

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2197 from ceph/wip-mon-empty-store
Sage Weil [Wed, 27 Aug 2014 01:05:30 +0000 (18:05 -0700)]
Merge pull request #2197 from ceph/wip-mon-empty-store

ceph_mon: check for existing mon store before opening db

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Pavan Rallabhandi <pavanrallabhandis@gmail.com>
10 years agoMerge pull request #2312 from ceph/wip-config-diff
Sage Weil [Wed, 27 Aug 2014 01:03:21 +0000 (18:03 -0700)]
Merge pull request #2312 from ceph/wip-config-diff

config diff: obtain diff between current config and default config

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Wed, 27 Aug 2014 00:33:59 +0000 (17:33 -0700)]
Merge remote-tracking branch 'gh/next'

Conflicts:
src/os/CollectionIndex.h

10 years agocommon: ceph_context: add admin socket command 'config diff' 2312/head
Joao Eduardo Luis [Tue, 26 Aug 2014 22:31:06 +0000 (23:31 +0100)]
common: ceph_context: add admin socket command 'config diff'

Outputs a diff between the current config and what the daemon believes
to be its default config.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
10 years agocommon: config: let us obtain a diff between current and default config
Joao Eduardo Luis [Sun, 24 Aug 2014 16:20:53 +0000 (17:20 +0100)]
common: config: let us obtain a diff between current and default config

It's mildly annoying when trying to figure out what has been changed on
a running system's config options and having to rely on whatever is set
on ceph.conf and the admin's memory of what has been injected.

With this we can simply ask the daemon for the diff between what would be
its default and what is its current config.

Current form will output extraneous information that was not directly
supplied by the user though, such as 'host' 'fsid' and 'daemonize', as
well as defaults we may rewrite ourselves (leveldb tunables on the monitor
for instance).  Nonetheless, it's way better than the alternative and
considering it should be used solely for debug purposes I think we can
get away with it.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
10 years agoMerge pull request #2334 from dachary/wip-9235-uninitialized-variables
Sage Weil [Tue, 26 Aug 2014 21:43:51 +0000 (14:43 -0700)]
Merge pull request #2334 from dachary/wip-9235-uninitialized-variables

tests: histogram prevent re-use of local variables

10 years agotests: histogram prevent re-use of local variables 2334/head
Loic Dachary [Tue, 26 Aug 2014 19:59:39 +0000 (21:59 +0200)]
tests: histogram prevent re-use of local variables

By moving the tests to separate functions.

http://tracker.ceph.com/issues/9235 Fixes: #9235

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2333 from dachary/wip-9235-uninitialized-variables
Sage Weil [Tue, 26 Aug 2014 21:15:35 +0000 (14:15 -0700)]
Merge pull request #2333 from dachary/wip-9235-uninitialized-variables

tests: histogram prevent re-use of local variables

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agotests: histogram prevent re-use of local variables 2333/head
Loic Dachary [Tue, 26 Aug 2014 19:59:39 +0000 (21:59 +0200)]
tests: histogram prevent re-use of local variables

By moving the test to a separate function.

http://tracker.ceph.com/issues/9235 Fixes: #9235

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2330 from ceph/wip-9211
Samuel Just [Tue, 26 Aug 2014 19:24:05 +0000 (12:24 -0700)]
Merge pull request #2330 from ceph/wip-9211

osd/OSDMap: encode blacklist in deterministic order

Reviewed-by: Samuel Just <sam.just@inktank.com>
10 years agoMerge pull request #2331 from ceph/wip-9238
Sage Weil [Tue, 26 Aug 2014 18:08:44 +0000 (11:08 -0700)]
Merge pull request #2331 from ceph/wip-9238

mds: fix FP error in ROUND_UP_TO

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agomds: fix FP error in ROUND_UP_TO 2331/head
John Spray [Tue, 26 Aug 2014 16:36:16 +0000 (17:36 +0100)]
mds: fix FP error in ROUND_UP_TO

Explicitly handle case where denominator is 0, instead of
passing into ROUND_UP_TO.

Regression from 9449520b121fc6ce0c64948386d4ff77f46f4f5f

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoMerge pull request #2321 from ceph/wip-9226
Sage Weil [Tue, 26 Aug 2014 16:18:23 +0000 (09:18 -0700)]
Merge pull request #2321 from ceph/wip-9226

rgw: fix test to identify whether object has tail

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2314 from ceph/wip-mds-pc
John Spray [Tue, 26 Aug 2014 15:37:39 +0000 (16:37 +0100)]
Merge pull request #2314 from ceph/wip-mds-pc

mds: clean up perfcounter names

Reviewed-by: John Spray <john.spray@redhat.com>
10 years agoosd/OSDMap: encode blacklist in deterministic order 2330/head
Sage Weil [Tue, 26 Aug 2014 15:16:29 +0000 (08:16 -0700)]
osd/OSDMap: encode blacklist in deterministic order

When we use an unordered_map the encoding order is non-deterministic,
which is problematic for OSDMap.  Construct an ordered map<> on encode
and use that.  This lets us keep the hash table for lookups in the general
case.

Fixes: #9211
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2325 from xinxinsh/wip-9217
Sage Weil [Tue, 26 Aug 2014 14:53:06 +0000 (07:53 -0700)]
Merge pull request #2325 from xinxinsh/wip-9217

fix wrong value of op_w_latency perf counter

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2327 from theanalyst/fix/vstart_rgw_port
Sage Weil [Tue, 26 Aug 2014 13:23:38 +0000 (06:23 -0700)]
Merge pull request #2327 from theanalyst/fix/vstart_rgw_port

vstart: start rgw on port specified by env var

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agovstart: start rgw on port specified by env var 2327/head
Abhishek Lekshmanan [Tue, 26 Aug 2014 10:16:55 +0000 (15:46 +0530)]
vstart: start rgw on port specified by env var

This ensures that user specified option according to $CEPH_RGW_PORT is
considered before starting radosgw

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>
10 years agodon't update op_rw_rlatency/op_w_rlatency when rlatency is zero 2325/head
xinxin shu [Tue, 26 Aug 2014 00:16:04 +0000 (08:16 +0800)]
don't update op_rw_rlatency/op_w_rlatency when rlatency is zero

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
10 years agofix wrong value of op_w_latency perf counter
xinxin shu [Tue, 26 Aug 2014 05:37:14 +0000 (13:37 +0800)]
fix wrong value of op_w_latency perf counter

Fixes: #9217
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
10 years agoMerge pull request #2320 from ceph/wip-9221
Samuel Just [Tue, 26 Aug 2014 00:29:12 +0000 (17:29 -0700)]
Merge pull request #2320 from ceph/wip-9221

ceph_test_rados_api_tier: make PromoteOn2ndRead test tolerate retries

Reviewed-by: Samuel Just <sam.just@inktank.com>
10 years agoMerge branch 'wip-objecter'
John Spray [Tue, 26 Aug 2014 00:04:27 +0000 (01:04 +0100)]
Merge branch 'wip-objecter'

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2319 from dachary/wip-9209-round-up-to
Sage Weil [Mon, 25 Aug 2014 21:47:33 +0000 (14:47 -0700)]
Merge pull request #2319 from dachary/wip-9209-round-up-to

common: ROUND_UP_TO accepts any rounding factor

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agocommon: ROUND_UP_TO accepts any rounding factor 2319/head
Loic Dachary [Mon, 25 Aug 2014 15:05:04 +0000 (17:05 +0200)]
common: ROUND_UP_TO accepts any rounding factor

The ROUND_UP_TO function was limited to rounding factors that are powers
of two. This saves a modulo but it is not used where it would make a
difference. The implementation is changed so it is generic.

http://tracker.ceph.com/issues/9209 Fixes: #9209

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2323 from lpabon/fix-quick-guide
Yehuda Sadeh [Mon, 25 Aug 2014 18:53:59 +0000 (11:53 -0700)]
Merge pull request #2323 from lpabon/fix-quick-guide

Fix syntax error in rst documentation

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
10 years agoFix syntax error in rst documentation 2323/head
Luis Pabón [Mon, 25 Aug 2014 18:43:53 +0000 (14:43 -0400)]
Fix syntax error in rst documentation

Signed-off-by: Luis Pabón <lpabon@redhat.com>
10 years agorgw: fix test to identify whether object has tail 2321/head
Yehuda Sadeh [Mon, 25 Aug 2014 17:38:42 +0000 (10:38 -0700)]
rgw: fix test to identify whether object has tail

Fixes: #9226
Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
Backport: firefly

We need to identify whether an object is just composed of a head, or
also has a tail. Test for pre-firefly objects ("explicit objs") was
broken as it was just looking at the number of explicit objs in the
manifest. However, this is insufficient, as we might have empty head,
and in this case it wouldn't appear, so we need to check whether the
sole object is actually pointing at the head.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
10 years agoceph_test_rados_api_tier: make PromoteOn2ndRead test tolerate retries 2320/head
Sage Weil [Mon, 25 Aug 2014 17:18:43 +0000 (10:18 -0700)]
ceph_test_rados_api_tier: make PromoteOn2ndRead test tolerate retries

If there is an ill-timed connection reset our read could get sent twice.
Weaken our assertion if the read was slow to tolerate this case.

Fixes: #9221
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2311 from onlyjob/master
Gregory Farnum [Mon, 25 Aug 2014 17:17:59 +0000 (10:17 -0700)]
Merge pull request #2311 from onlyjob/master

Fix FTBFS on alpha due to incorrect check on BLKGETSIZE

Reviewed-by: Greg Farnum <greg@inktank.com>
10 years agoMerge pull request #2318 from dachary/wip-osd-config
Sage Weil [Mon, 25 Aug 2014 15:32:29 +0000 (08:32 -0700)]
Merge pull request #2318 from dachary/wip-osd-config

documentation: update recovery config options defaults

10 years agodocumentation: update recovery config options defaults 2318/head
Loic Dachary [Mon, 25 Aug 2014 13:52:29 +0000 (15:52 +0200)]
documentation: update recovery config options defaults

So they match the values from config_opts.h

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoCollectionIndex: Collection name is added to the access_lock name
Somnath Roy [Mon, 18 Aug 2014 23:59:36 +0000 (16:59 -0700)]
CollectionIndex: Collection name is added to the access_lock name

The CollectionIndex constructor is changed to accept the coll_t
so that the collection name can be used to form access_lock(RWLock)
name.This is needed otherwise lockdep will report a recursive lock error
and assert. lockdep needs unique lock names for each Index object.

Fixes: #9145
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
(cherry picked from commit 615d2d904024526cc58557ee5250c2536a3cd5c8)

10 years agoMerge pull request #2275 from ceph/wip-9079
Sage Weil [Mon, 25 Aug 2014 13:25:07 +0000 (06:25 -0700)]
Merge pull request #2275 from ceph/wip-9079

msg/Accepter: do not unlearn_addr on bind()

Reviewed-by: Greg Farnum <greg@inktank.com>
10 years agorgw: admin ops create user API can not determine existing user 1950/head
Ray Lv [Wed, 11 Jun 2014 14:13:23 +0000 (22:13 +0800)]
rgw: admin ops create user API can not determine existing user

Fixes: #8583
Signed-off-by: Ray Lv <raylv@yahoo-inc.com>
10 years agoMerge pull request #2317 from ashishchandra1/patch-1
Loic Dachary [Mon, 25 Aug 2014 12:10:49 +0000 (14:10 +0200)]
Merge pull request #2317 from ashishchandra1/patch-1

Update python.rst

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
10 years agoUpdate python.rst 2317/head
Ashish Chandra [Mon, 25 Aug 2014 12:06:29 +0000 (17:36 +0530)]
Update python.rst

Signed-off-by:ashish.a.chandra@ril.com

10 years agoMerge pull request #2316 from dachary/wip-warning
John Spray [Mon, 25 Aug 2014 10:06:42 +0000 (11:06 +0100)]
Merge pull request #2316 from dachary/wip-warning

rbd: fix signess warning

Reviewed-by: John Spray <john.spray@redhat.com>
10 years agomsg/Accepter: do not unlearn_addr on bind() 2275/head
Sage Weil [Mon, 25 Aug 2014 04:18:00 +0000 (21:18 -0700)]
msg/Accepter: do not unlearn_addr on bind()

It is dangerous to set need_addr = true as it means someone may set the
addr to something else (specifically the port) in a racing thread.

However, it is not necessary: the only reason we added it way back in
5d5045d31a9e10d21b44eb1bd137db9ae53128ff was so that
local_connection->peer_addr would get updated, and bind() now calls that
unconditionally.

Fixes: #9079
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd: update handle_osd_map call
John Spray [Mon, 25 Aug 2014 00:45:22 +0000 (01:45 +0100)]
osd: update handle_osd_map call

I had changed the implementation in Objecter
to avoid a spurious get/put cycle in "osdc/Objecter: fix resource
management", but this guy was still going a get() before
calling handle_osd_map.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon/Timer: fix deadlock in RWTimer::shutdown
John Spray [Mon, 25 Aug 2014 00:29:02 +0000 (01:29 +0100)]
common/Timer: fix deadlock in RWTimer::shutdown

Fixes: #9213
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix op_cancel on homeless session
John Spray [Mon, 25 Aug 2014 00:16:39 +0000 (01:16 +0100)]
osdc/Objecter: fix op_cancel on homeless session

Wrote this block without realizing that op_cancel
takes write lock on session lock, and that operation
is undefined when you already hold the read lock.

Fixes: #9214
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: hold session ref longer in resend
John Spray [Sun, 24 Aug 2014 22:48:57 +0000 (23:48 +0100)]
osdc/Objecter: hold session ref longer in resend

This is mostly cosmetic: in fact we are getting an extra
ref in _map_session and holding the session lock, so
it's safe, but it's awkward to be giving up the ref on
a session and then continuing to refer to it.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agotest: fix prematurely released lock in RadosModel
John Spray [Sun, 24 Aug 2014 17:17:59 +0000 (18:17 +0100)]
test: fix prematurely released lock in RadosModel

Should hold this lock while touching context->snaps.  Don't
think this has anything to do with #9203 though.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix ref counts in *Map_Latest
John Spray [Sat, 23 Aug 2014 19:03:47 +0000 (20:03 +0100)]
osdc/Objecter: fix ref counts in *Map_Latest

These contexts were putting before continuing to
use the CommandOp/LingerOp.  I added an assert to
reflect that, which was hitting (#9207).

This change is to remove the assertion and put the
put() in the right place (and the end of the function).

Fixes: #9207
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: avoid locking two sessions at once
John Spray [Fri, 22 Aug 2014 16:22:07 +0000 (17:22 +0100)]
osdc/Objecter: avoid locking two sessions at once

... in close_session

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: disable lockdep for double lock
John Spray [Fri, 22 Aug 2014 12:37:46 +0000 (13:37 +0100)]
osdc/Objecter: disable lockdep for double lock

There is a special case in _recalc_linger_op_target
where we lock two sessions at once to transfer an op
between them.  It is deadlock safe because it's the only
place we lock two at once, and we hold rwlock for write
while we do it.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon/RWLock: allow disable lockdep on calls
John Spray [Fri, 22 Aug 2014 14:19:08 +0000 (15:19 +0100)]
common/RWLock: allow disable lockdep on calls

To support callers with special cases where they
know they can safely take two locks with the
same name at the same time.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix resource management
John Spray [Fri, 15 Aug 2014 00:26:20 +0000 (01:26 +0100)]
osdc/Objecter: fix resource management

The refactor introduced various reference leaks, and
lacked cleanup in shutdown.

Things done here:
 * Reinstate _recalc_linger_op_target, which was accidentally
   disabled and let to freezes in notify() (#9112)
 * Make reference counting on OSDSessions much more explicit, using
   put_session and get_session everywhere
 * Add assertions in ~OSDSession and ~Objecter that the various
   maps of operations have been emptied.
 * Reassign ops away from closing session to homeless session in
   close_session()
 * Delete/deref all the ops from the objecter-wide maps of operations
   in shutdown()

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: handle (and ignore) MOSDMap; do not leak
Sage Weil [Tue, 19 Aug 2014 22:18:24 +0000 (15:18 -0700)]
librados: handle (and ignore) MOSDMap; do not leak

We return true, so we should drop the MOSDMap ref.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoclient: handle (and ignore) MOSDMap
Sage Weil [Tue, 19 Aug 2014 22:13:42 +0000 (15:13 -0700)]
client: handle (and ignore) MOSDMap

To avoid spamming the log.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: shut down monclient after objecter
Sage Weil [Fri, 15 Aug 2014 22:31:16 +0000 (15:31 -0700)]
librados: shut down monclient after objecter

The objecter ms_handle_reset may call into monc; shut objecter down first.

Fixes: #9130
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomon/MonClient: ensure !cur_con == cur_mon.empty()
Sage Weil [Fri, 15 Aug 2014 22:30:30 +0000 (15:30 -0700)]
mon/MonClient: ensure !cur_con == cur_mon.empty()

Keep these in sync.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: verbose logging in ::notify
John Spray [Fri, 15 Aug 2014 13:58:57 +0000 (14:58 +0100)]
librados: verbose logging in ::notify

One is interested in knowning specifically which stage
of the operation we are at.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: fix uninitialized values in notify
John Spray [Fri, 15 Aug 2014 12:09:48 +0000 (13:09 +0100)]
librados: fix uninitialized values in notify

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: separate ::notify return values
John Spray [Fri, 15 Aug 2014 00:28:28 +0000 (01:28 +0100)]
librados: separate ::notify return values

There is a return code from objecter for committing
the notify linger op, and then later a code in the
CEPH_MSG_WATCH_NOTIFY handled by RadosClient directly.
Afaict there isn't any nice ordering guarantee here,
so they could stamp on each other.  Use a SaferCond
for the submit one.

I don't think this was related to #9112 but while
I'm here...

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrbd: handle blacklisting during shutdown
John Spray [Thu, 14 Aug 2014 22:59:16 +0000 (23:59 +0100)]
librbd: handle blacklisting during shutdown

This was failing the test_lock_fence.sh test due to
a crash during shutdown when the rbd client was blacklisted.

We should fix this more generally in ObjectCacher at some
point, but for the moment handle it explicitly in librbd.

Fixes: #9105
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: refactor watch/notify; return notify error code
Sage Weil [Wed, 13 Aug 2014 00:40:36 +0000 (17:40 -0700)]
librados: refactor watch/notify; return notify error code

Get rid of a level of intermediate classes with confusing names and put
the notify and notify finish logic in a single place so that it is easier
to follow and understand.

Pass the return value from the notify completion message to the caller.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: prefix msg handler with handle_
Sage Weil [Mon, 11 Aug 2014 01:05:53 +0000 (18:05 -0700)]
librados: prefix msg handler with handle_

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: rename watch/notify callback register functions
Sage Weil [Mon, 11 Aug 2014 00:57:43 +0000 (17:57 -0700)]
librados: rename watch/notify callback register functions

Make it clear these are for watch OR notify, not just watch.  I was
confused.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd: include ETIMEDOUT in notify reply on timeout
Sage Weil [Mon, 11 Aug 2014 00:52:18 +0000 (17:52 -0700)]
osd: include ETIMEDOUT in notify reply on timeout

If a notify operation times out (all watchers to not ACK in time), include
an ETIMEDOUT in the final error message back to the client, so that they
know about it.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomessages/MWatchNotify: include an error code in the message
Sage Weil [Mon, 11 Aug 2014 00:51:08 +0000 (17:51 -0700)]
messages/MWatchNotify: include an error code in the message

Document the fields, while we are here.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: avoid unnecessary locks
John Spray [Thu, 14 Aug 2014 13:39:10 +0000 (14:39 +0100)]
librados: avoid unnecessary locks

Revise wait_for_osdmap to be called outside of RadosClient::lock
and only take the lock if it has to wait for a map.

Also, now that objecter handles its own locking nicely,
there are various places where it is no longer necessary
for RadosClient to take its own lock -- all the calls that
go directly into objecter (RadosClient::pool_*) don't need
to hold RadosClient::lock.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: fix race on osdmap initialization
John Spray [Thu, 14 Aug 2014 10:56:07 +0000 (11:56 +0100)]
librados: fix race on osdmap initialization

This would cause occasional failures where calls
to lookup_pool immediately after connect() would
fail to find any pool because the OSD map had not
yet been loaded.  The wait for the map was lost when
the pool name cache was lost in ce176b827.

To avoid similar issues, the pool_requires_alignment
and pool_required_alignment helpers need the same
wait_for_osdmap before proceeding.  Usually callers
would call lookup_pool before these guys but it's
not guaranteed.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: update Objecter shutdown
John Spray [Wed, 13 Aug 2014 01:19:22 +0000 (02:19 +0100)]
librados: update Objecter shutdown

Previously checking for CONNECTED was equivalent to
checking the objecter had been initialized, but since
the separation between init() and start() that is
no longer the case.  Avoid the need to be smart by
just readint Objecter::initialized to learn whether
to call Objecter::shutdown

Fixes: #9067
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agotools: update for Journaler/Objecter interfaces
John Spray [Tue, 12 Aug 2014 16:47:01 +0000 (17:47 +0100)]
tools: update for Journaler/Objecter interfaces

Journaler now requires a Finisher: construct one in
MDSUtility.

Objecter now requires separate calls to init() and start(),
do that in MDSUtility and also take advantage of Objecter's
new ability to act as its own dispatcher.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon: fix Finisher perf counter
John Spray [Tue, 12 Aug 2014 16:45:40 +0000 (17:45 +0100)]
common: fix Finisher perf counter

This was declared as a long running average
but then .dec() was called on it, which
triggers an assertion.

You only have this problem if you pass a name
argument to Finisher::Finisher, which we mostly
don't do, but may as well fix this anyway.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: remove unused Blinker.h
John Spray [Mon, 11 Aug 2014 21:33:28 +0000 (22:33 +0100)]
osdc: remove unused Blinker.h

Not used anyway, not touched since 2007.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agotest: add some missing modelines
John Spray [Mon, 11 Aug 2014 21:12:58 +0000 (22:12 +0100)]
test: add some missing modelines

Just happened to be editing these and they had
emacs modelines but no vim modelines.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: Add lock to Filer::Probe
John Spray [Fri, 8 Aug 2014 00:49:26 +0000 (01:49 +0100)]
osdc: Add lock to Filer::Probe

This is necessary now that Objecter can call back
from multiple OSD op completions in parallel: otherwise
we get multiple threads trying to update
the same Probe object.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds/Server: fix wait_for_osd_map calls
John Spray [Thu, 7 Aug 2014 17:09:59 +0000 (18:09 +0100)]
mds/Server: fix wait_for_osd_map calls

These needed a C_OnFinisher and C_IO_Wrapper because they
are called back from the Objecter like an I/O completion.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: fix C_RetryRead locking
John Spray [Thu, 7 Aug 2014 17:08:41 +0000 (18:08 +0100)]
osdc/Journaler: fix C_RetryRead locking

Not sure this was ever actually getting used, but
it would have had a problem if it was.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: convert IO contexts
John Spray [Thu, 7 Aug 2014 14:56:40 +0000 (15:56 +0100)]
mds: convert IO contexts

As of this change, the only thing in the MDS inheriting
directly from Context is MDSContext.

The only files touching mds_lock explicitly are MDS, MDLog and
MDSContext -- everyone else should be getting their locking behaviour
via the contexts.  (one minor exception made for an assertion in
Locker).

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: use finisher for public callbacks
John Spray [Thu, 7 Aug 2014 14:52:58 +0000 (15:52 +0100)]
osdc/Journaler: use finisher for public callbacks

This is needed because of occasional lock cycles with
external callers doing e.g. write_head.

We do get some weird-looking multiply-nested
C_OnFinisher(C_OnFinisher(...)) from this approach,
where one finisher exists to protect journaler from
lock cycles wrt objecter, and the other exists
to protect the MDS from lock cycles wrt journaler.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: remove unused waitfor_trim
John Spray [Thu, 7 Aug 2014 14:15:38 +0000 (15:15 +0100)]
osdc/Journaler: remove unused waitfor_trim

There was no code path for ever adding contexts to this list.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: Switch to new context types
John Spray [Wed, 6 Aug 2014 13:37:11 +0000 (14:37 +0100)]
mds: Switch to new context types

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: add MDSContext subclasses
John Spray [Wed, 6 Aug 2014 13:35:57 +0000 (14:35 +0100)]
mds: add MDSContext subclasses

These allow contexts within the MDS to identify themselves
as either 'internal' contexts (expecting to be called within
the big MDS lock) or 'IO' contexts (which should take the big
mds lock themselves when called back).

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoinclude: generalize C_Contexts and C_Gather*
John Spray [Wed, 6 Aug 2014 13:31:53 +0000 (14:31 +0100)]
include: generalize C_Contexts and C_Gather*

... by making them templates so that they can be
used in places that expect a subclass of Context.

The existing names are now typedefs to template
instantiations using Context.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon: assert non-null ptrs in OnFinisher
John Spray [Wed, 6 Aug 2014 11:27:13 +0000 (12:27 +0100)]
common: assert non-null ptrs in OnFinisher

Callers should not be constructing C_OnFinisher
if they have no context to call back.

Signed-off-by: John Spray <john.spray@redhat.com>