Commit Graph

46854 Commits

Author SHA1 Message Date
Kefu Chai
7b3e5bfe07 Merge pull request #6990 from linuxbox2/master-fixes
Fixes some small issues

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-12-22 21:55:07 +08:00
Josh Durgin
09a3f69e6f Merge remote-tracking branch 'origin/jewel' 2015-12-21 16:59:51 -08:00
Sage Weil
e8dccacacd Merge pull request #6926 from dachary/wip-14080-ceph-disk-udevadm
ceph-disk: fix failures when preparing disks with udev > 214

On CentOS 7.1 and other operating systems with a version of udev greater or equal to 214, 
running ceph-disk prepare triggered unexpected removal and addition of partitions on
the disk being prepared. That created problems ranging from the OSD not being activated
to failures because /dev/sdb1 does not exist although it should.

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-21 12:58:32 -05:00
Josh Durgin
df9ff2522f Merge pull request #7002 from dillaman/wip-14092-jewel
tests: flush op work queue prior to destroying MockImageCtx

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-12-21 07:31:57 -08:00
Jason Dillaman
b87269728d Merge pull request #6986 from xiexingguo/xxg-wip-14129
librbd: fix snap_exists API return code overflow

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2015-12-21 10:29:33 -05:00
xiexingguo
6a45bbc863 test: update test cases with the new snap_exists API
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2015-12-21 23:13:28 +08:00
Jason Dillaman
fbac8172fc Merge pull request #6938 from wuxiangwei/wip-wxw-rbdfuserename
rbd-fuse: implement mv operation

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2015-12-21 09:55:08 -05:00
Jason Dillaman
e8911cfee7 tests: flush op work queue prior to destroying MockImageCtx
Fixes: #14092
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-12-21 09:03:15 -05:00
Loic Dachary
6395bf856b ceph-disk: protect deactivate with activate lock
When ceph-disk prepares the disk, it triggers udev events and each of
them ceph-disk activate. If systemctl stop ceph-osd@2 happens while
there still are ceph-disk activate in flight, the systemctl stop may be
cancelled by the systemctl enable issued by one of the pending ceph-disk
activate.

This only matters in a test environment where disks are destroyed
shortly after they are activated.

Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:37:37 +01:00
Loic Dachary
9dce05a8cd ceph-disk: use blkid instead of sgdisk -i
sgdisk -i 1 /dev/vdb opens /dev/vdb in write mode which indirectly
triggers a BLKRRPART ioctl from udev (starting version 214 and up) when
the device is closed (see below for the udev release note). The
implementation of this ioctl by the kernel (even old kernels) removes
all partitions and adds them again (similar to what partprobe does
explicitly).

The side effects of partitions disappearing while ceph-disk is running
are devastating.

sgdisk is replaced by blkid which only opens the device in read mode and
will not trigger this unexpected behavior.

The problem does not show on Ubuntu 14.04 because it is running udev <
214 but shows on CentOS 7 which is running udev > 214.

git clone git://anonscm.debian.org/pkg-systemd/systemd.git
systemd/NEWS:
CHANGES WITH 214:

        * As an experimental feature, udev now tries to lock the
          disk device node (flock(LOCK_SH|LOCK_NB)) while it
          executes events for the disk or any of its partitions.
          Applications like partitioning programs can lock the
          disk device node (flock(LOCK_EX)) and claim temporary
          device ownership that way; udev will entirely skip all event
          handling for this disk and its partitions. If the disk
          was opened for writing, the close will trigger a partition
          table rescan in udev's "watch" facility, and if needed
          synthesize "change" events for the disk and all its partitions.
          This is now unconditionally enabled, and if it turns out to
          cause major problems, we might turn it on only for specific
          devices, or might need to disable it entirely. Device Mapper
          devices are excluded from this logic.

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

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:37:37 +01:00
Loic Dachary
fe71647bc9 ceph-disk: dereference symlinks in destroy and zap
The behavior of partprobe or sgdisk may be subtly different if given a
symbolic link to a device instead of an actual device. The debug output
is also more confusing when the symlink shows instead of the device it
points to.

Always dereference the symlink before running destroy and zap.

Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Loic Dachary
730b5d62d3 ceph-disk: increase partprobe / udevadm settle timeouts
The default of 120 seconds may be exceeded when the disk is very slow
which can happen in cloud environments. Increase it to 600 seconds
instead.

The partprobe command may fail for the same reason but it does not have
a timeout parameter. Instead, try a few times before failing.

The udevadm settle guarding partprobe are not necessary because
partprobe already does the same. However, partprobe does not provide a
way to control the timeout. Having a udevadm settle after another is
going to be a noop most of the time and not add any delay. It matters
when the udevadm settle run by partprobe fails with a timeout because
partprobe will silentely ignores the failure.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Loic Dachary
fd7fe8c497 tests: ceph-disk workunit increase verbosity
So that reading the teuthology log is enough in most cases to figure out
the cause of the error.

Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Loic Dachary
b271a06b6a ceph-disk: fix typo
Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Loic Dachary
f5d36b9ac2 ceph-disk: log parted output
Should parted output fail to parse, it is useful to get the full output
when running in verbose mode.

Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Loic Dachary
5fa35ba10e ceph-disk: do not discard stderr
Signed-off-by: Loic Dachary <loic@dachary.org>
2015-12-21 11:31:25 +01:00
Matt Benjamin
cd2947d7e9 Dispatcher.h: include assert.h
The inline ms_fast_dispatch implementation calls assert, which
puts asset.h in the interface.

The fact that many Dispatcher descendants don't implement
ms_fast_dispatch prevents making the method pure virtual--which
suggests that maybe there is a need for a FastDispatcher
interface that inherits Dispatcher and introduces ms_fast_dispatch
and related?

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2015-12-20 13:32:13 -05:00
Matt Benjamin
c2a2499263 xio: avoid conversion warning w/xio_queue_depth
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2015-12-20 13:14:41 -05:00
Matt Benjamin
34bb892ac0 xio: remove static declspec on buffer::create_msg
Likely an update missed from PR #6686.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2015-12-20 12:42:28 -05:00
wuxiangwei
71eb4f9f09 rbd-fuse: discard space restriction for mv operation
discard space restriction for destination image name of
the mv operation.

Signed-off-by: Xiangwei Wu wuxiangwei@h3c.com
2015-12-20 04:14:35 -05:00
xiexingguo
084f22ce15 tools: replace snap_exists with a new safer version
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2015-12-20 16:23:48 +08:00
xiexingguo
c97b1a68ae librbd: fix snap_exists API overflow issue
The original one may overflow and thus not be safe.

Fixes: #14129
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2015-12-20 16:23:48 +08:00
Sage Weil
7dca87c63c Merge pull request #6766 from xiexingguo/xxg-wip-cleanup
osd: fix wrongly placed assert and some cleanups

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-12-19 14:02:02 -05:00
Sage Weil
a96ee93363 Merge pull request #6708 from xiaoxichen/shutdown_when_flipping
osd: shut down if we flap too many times in a short period

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 14:01:31 -05:00
Sage Weil
64cb5f6a20 Merge pull request #5782 from ceph/wip-cxx11time
common: new timekeeping common code, and Objecter conversion

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 14:00:37 -05:00
Sage Weil
ae0dc478b2 Merge pull request #6796 from dx9/wip-12406-sys_siglist
common: signal_handler: added support for using reentrant strsignal() implementations vs. sys_siglist[]

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 13:59:55 -05:00
Sage Weil
5f9f986fd4 Merge pull request #6814 from stiopaa1/rem_inc
msg: removed unneeded includes from Dispatcher

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 13:59:27 -05:00
Sage Weil
0a4b7ab20c Merge pull request #6815 from badone/wip-13993
common: log: Assign LOG_DEBUG priority to syslog calls

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 13:58:37 -05:00
Sage Weil
2fe8180353 Merge pull request #6881 from wido/mon-codestyle-fix
mon: fix coding-style on PG related Monitor files

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 13:58:12 -05:00
Sage Weil
6bb34fefd6 Merge pull request #6921 from liewegas/wip-kv-log
osd,mon: log leveldb and rocksdb to ceph log

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-12-19 13:57:34 -05:00
Sage Weil
0114cb53b7 Merge pull request #6950 from mslovy/wip-optimaze-map
osd: misc optimization for map utilization

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-19 13:57:02 -05:00
Sage Weil
ce995d7de9 Merge pull request #6963 from liewegas/wip-memstore
osd: memstore: fix two bugs

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2015-12-19 13:56:32 -05:00
Josh Durgin
a2befde278 Merge pull request #6982 from dillaman/wip-librbd-valgrind
librbd: uninitialized state in snap remove state machine

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-12-18 15:19:58 -08:00
Jason Dillaman
6d9da6a641 librbd: uninitialized state in snap remove state machine
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-12-18 16:41:21 -05:00
Josh Durgin
d7581cda4a Merge pull request #6979 from dillaman/wip-14123-jewel
librbd: correct issues discovered when cache is disabled

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-12-18 13:25:35 -08:00
Josh Durgin
73358df6de Merge pull request #6974 from dillaman/wip-14108-jewel
librbd: correct issues discovered during teuthology testing

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-12-18 13:13:44 -08:00
Jason Dillaman
28081d777d Merge pull request #6978 from trociny/fix-rbd-init-order
rbd: fix static initialization ordering issues

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2015-12-18 15:42:24 -05:00
Adam C. Emerson
ecf2bebe99 time: Update OSDC for C++11 Time
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:16:17 -05:00
Adam C. Emerson
ac964259b4 osdc: Whitespace
Since I'm making a pervasive change anyway, knock off end-of-line spaces
and wrap overly long lines.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:16:17 -05:00
Adam C. Emerson
4367eb18d2 perfcounters: Allow C++11 time increment/decrement
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:15:04 -05:00
Adam C. Emerson
a3a7c037bf timer: Another timer using new time/lock standards
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:15:03 -05:00
Adam C. Emerson
08f26766b3 time: Overload for std:chrono in Cond::TimedWait
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:15:03 -05:00
Adam C. Emerson
84dcfbd8ba time: Add basic support for std::chrono based time
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2015-12-18 15:15:03 -05:00
Jason Dillaman
bfc9690dd1 librbd: skip journal event if write/discard was no-op
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-12-18 15:14:34 -05:00
Jason Dillaman
f6659cc7f0 librbd: object map ENOENT optimizations should complete asynchronously
This ensures a consistent lock ordering between the optimized path and
a librados callback. Remove the cache writebach handler's custom finisher
and re-use the op_work_queue.

Fixes: #14123
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-12-18 15:14:06 -05:00
Sage Weil
04e290887c Merge pull request #6701 from XinzeChi/wip-batch-peek-journal
osd: FileJournal: support batch peak and pop from writeq

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-18 15:09:21 -05:00
Sage Weil
14f5d3ba69 Merge pull request #6804 from ceph/putting-the-fail-in-assertion-failed
common: assert: abort() rather than throw

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-18 15:08:22 -05:00
Sage Weil
3aa9eb3518 Merge pull request #6900 from liewegas/wip-13988
mon: fix reuse of osd ids (clear osd info on osd deletion)

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-12-18 15:07:49 -05:00
Sage Weil
2dbb19d99f Merge pull request #6902 from XinzeChi/wip-pg_stat_t-encoding
osd: utime_t, eversion_t, osd_stat_sum_t encoding optimization

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-18 15:07:14 -05:00
Sage Weil
471164d61a Merge pull request #6909 from mslovy/wip-shared-cache
common: improve shared_cache and simple_cache efficiency with hash table

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-18 15:06:14 -05:00