Commit Graph

48736 Commits

Author SHA1 Message Date
Sage Weil
8497099503 os/bluestore/BlueStore: default Onode::true to false
This patch is mostly a wash, except that _rename now avoids doing the
_do_remove() work in the case where the object didn't exist before.

Reported-by: ie xingguo <xie.xingguo@zte.com.cn>
Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 10:30:13 -05:00
Sage Weil
0e42ee9af2 Merge pull request #7453 from ceph/wip-14566
msg/async: fix potential race condition
2016-02-04 10:10:01 -05:00
Sage Weil
70f7b1e316 os/memstore/MemStore: set Collection::cid on create
This was broken by the collection handles merge in
2e52a8b17c because the c->cid
value was never initialized and now we started to rely on it.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 09:24:22 -05:00
changtao
ab7d3decbf CacheTier: set cache_min_evict_age is effective
Signed-off-by: Tao Chang <changtao@hihuron.com>
2016-02-04 22:08:07 +08:00
Sage Weil
300106a9f0 Merge pull request #7505 from xiexingguo/xxg-wip-kstorelru
os/kstore: insert new onode to the front position of onode LRU

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:43:42 -05:00
Sage Weil
bb6917320b Merge pull request #7492 from jjhuo/master
os/bluestore: insert new onode to the front position of onode LRU

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:43:19 -05:00
Sage Weil
76e791412c Merge branch 'xxg-wip-14474' of git://github.com/xiexingguo/ceph
Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:36:06 -05:00
Sage Weil
21a65fca59 Merge pull request #7380 from yuyuyu101/async-nip
msg/async: reduce extra tcp packet for message ack
2016-02-04 08:39:15 -05:00
Sage Weil
a637dcd207 Merge pull request #7398 from theanalyst/fix/12744
mon: PG Monitor should report waiting for backfill

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-04 08:38:32 -05:00
Sage Weil
30ff251367 Merge pull request #7447 from liewegas/wip-parallel-rados-test
test: run rados api tests in parallel

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-02-04 08:38:09 -05:00
Sage Weil
fb1abc3dee Merge pull request #7455 from yuyuyu101/bufferlist-move
buffer: use move construct to append/push_back/push_front

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:37:55 -05:00
Sage Weil
408ae365d1 Merge pull request #7459 from dwj192/mon-created
mon: fix monmap creation stamp

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:37:22 -05:00
Sage Weil
0dd5147c57 Merge pull request #7477 from xiexingguo/wip-fix-obj
osdc/objecter: fix race condition and result code overflow

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:36:40 -05:00
Sage Weil
d0ce8008a2 Merge pull request #7482 from branch-predictor/bp-faster-health
mon: reduce CPU and memory manager pressure of pg health check

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 08:33:56 -05:00
Orit Wasserman
d06da59b6e Merge pull request #7518 from ceph/wip-14637-man-radosgw-admin-orphans
doc: add orphans commands to radosgw-admin(8)
2016-02-04 11:05:54 +01:00
Loic Dachary
2591f6371e ceph-disk: use the type file for bluestore
The type file in the OSD bluestore data exists and contains the
bluestore string. ceph-disk activate should use it instead of
the "osd objectstore" configuration value. It is better in case the
configuration file changes between prepare and activate.

The fsid file cannot be used by bluestore to signify that ceph-osd
--mkfs has completed successfully because it is pre-populated by
ceph-disk. Introduce the mkfs_done file, dedicated to this, instead of
overloading an existing file.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:47 +07:00
Loic Dachary
36656c8dc9 tests: ceph-disk tests pid files must exist
http://tracker.ceph.com/issues/13422 made it so ceph-osd won't start
unless the pidfile can be created successfully. The default location
being the current directory, ceph-osd must explicitly be told to write
in a directory where it has write permissions.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
c50f3b9f48 tests: ceph-disk qa workunit for bluestore
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
7b9a8042da ceph-disk: bluestore deactivate / destroy
It is straightforward because it entirely relies on information
collected by ceph-disk list which has full support for bluestore.
It loops on all possible auxiliary devices (as found in Spaces.NAMES)
and does the associated deactivate / destruction which is merely about
handling dmcrypt map / unmap.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
cfea72ee52 ceph-disk: bluestore list
The objectstore journal and the bluestore block auxiliary device are
handled in the same way. Each occurrence of journal in the code is
replaced with a variable.

A few helpers are added to the Ptype class to factorize the most common
lookups but the code logic is unmodified with one exception: the
more_osd_info previously added a journal_uuid entry regarless. If there
was no journal_uuid file, it would be None. It is changed to only add
the {block,journal}_uuid entry if the corresponding file exist.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
fbc0984b6e ceph-disk: bluestore trigger
Copy paste the journal code and s/journal/block/

More work will be needed to support multiple auxiliary
devices (block.wal etc). But the goal is to minimize the change because
this commit is part of a series of commits focusing on refactoring
prepare, not the entire ceph-disk codebase.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
170dca3a27 ceph-disk: bluestore activate
Only support the block file for now. The refactoring consist of
replacing main_activate_journal with main_activate_space and a name
argument (block, journal). More work will be needed to support multiple
auxiliary devices (block.wal etc). But the goal is to minimize the
change because this commit is part of a series of commits focusing on
refactoring prepare, not the entire ceph-disk codebase.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
65bc36e610 ceph-disk: bluestore prepare
Only support the block file for now. It is handled the same as the
journal, only with a different name (block) and it's own set of ptypes
depending on multipath or dmcrypt.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:01:46 +07:00
Loic Dachary
a547bd29f4 ceph-disk: refactor prepare
The logic / code path is only modified to the extent necessary for the
refactor.

The Prepare class roughly replaces the prepare_main function but also
handles the prepare subcommand argument parsing. It creates the data and
journal objects and delegate the actual work to them via the prepare()
method.

The Prepare class assumes that preparing an OSD consists on the
following phases:

  * optionally prepare auxiliary devices, such as the journal
  * prepare a data directory or device
  * populate the data directory with fsid etc. and optionally
    symbolic links to the auxiliary devices

The PrepareDefault class is derived from Prepare and implements the
current model where there only is one auxiliary device, the journal.

The PrepareJournal class implements the *journal* functions
and is based on a generic class, PrepareSpace which handles the
allocation of an auxiliary device. The only journal specific feature is
left to the PrepareJournal class: querying the OSD to figure out if
a journal is wanted or not.

The OSD data directory is prepared via the PrepareData class. It creates
a file system if necessary (i.e. if a device) and populate the data
directory. Further preparation is then delegated to the auxiliary
devices (i.e. adding a symlink to the device for a journal).

There was some code paths related dmcrypt / multipath devices in
the prepare functions, although it is orthogonal. A class tree for
Devices was created to isolate that.

Although that was the primary reason for adding a new class tree, two
other aspects have also been moved there: ptypes and partition creation.
The ptypes are organized into a data structure with a few helpers in
the hope it will be easier to maintain. All references to the *_UUID
variables have been updated.

The creation of a partition is delegated to sgdisk and a wrapper helps
reduce the code redundancy.

The ptype of a given partition depends on the type of the device (is it
dmcrypt'ed or a multipath device ?). It is best implemented by
derivation so the prepare function does not need to be concerned about
how the ptype of a partition is determined.

Many functions could be refactored into a Device class and its
derivatives, but that was not done to minimize the size of the refactor.

  Device knows how to create a partition and figure out the ptype tobe
  DevicePartition a regular device partition
  DevicePartitionMultipath a partition of a multipath device
  DevicePartitionCrypt base class for luks/plain dmcrypt, can map/unmap
  DevicePartitionCryptPlain knows how to setup dmcrypt plain
  DevicePartitionCryptLuks knows how to setup dmcrypt plain

The CryptHelpers class is introduced to factorize the code snippets that
were duplicated in various places but that do not really belong
because they are convenience wrappers to figure out:

   * if dmrypt should be used
   * the keysize
   * the dmcrypt type (plain or luks)

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 17:00:53 +07:00
xie xingguo
501ddff4f0 librados/RadosClient: stop client's finisher in a more graceful way
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-04 16:24:16 +08:00
xie xingguo
be9c0efc28 os/filestore/JournalingObjectStore: stop journal in a more graceful way
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-04 16:19:27 +08:00
Josh Durgin
8f0166728b packaging: add an rbd-mirror package
Depend on ceph-common for /etc/ceph. Startup scripts will be added later.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2016-02-04 00:10:16 -08:00
Josh Durgin
b35061a7e6 man: stub manpage for rbd-mirror
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2016-02-04 00:10:16 -08:00
Josh Durgin
3d263840f6 rbd-mirror: skeleton of a mirroring daemon
This isn't functional yet, since ImageReplayer doesn't do any replay
yet.  Just the parts for monitoring other clusters for changes
(ClusterWatcher and PoolWatcher) are tested, with simple
unit and functional tests.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2016-02-03 23:44:53 -08:00
Loic Dachary
ec4a28885a tests: generic ceph-disk qa check_osd_status
The helper function no longer has journal hardcoded.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
76606c93d2 tests: pytest must not truncate data structures
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
3d9c4a8112 tests: ceph-disk no longer test separate journals
Remove unused argument.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
c9e3e8a5df tests: workaround ceph-disk global side effects
Because some variables are global in ceph-disk, tests that modify them
interact with each other in non-predictable ways. This will go away
eventually but requires a significant refactor. Workaround by running
one py.test per test file.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
53014bf437 ceph-disk: move check_journal_reqs (no change)
To help with the prepare refactor.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
ef702ef7a8 ceph-disk: cleanup unused argument in list_format
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
7f6295d21f ceph-disk: make all must setup.py install
Refactor the test / virtualenv setup in the same way it was done for
ceph-detect-init.

All shell tests use ceph-helpers.sh which is modified to add ceph-disk /
ceph-detect-init virtualenv/bin to the PATH to ensure the source version
is used even if ceph is installed.

See "ceph-detect-init: make all must setup.py install"

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
17c5287df7 tests: fix ceph-disk unit tests
Because ceph-disk unit tests were not run as part of make check, part of
the most recent changes broke them. This is a batch fix to sanitize the
situation. Since it is now run with make check, that won't happen again.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
b030d8fc11 ceph-detect-init: make all must setup.py install
When make all runs in the ceph-detect-init module, it does a "setup.py
build" which is not used. Replace it with a python setup.py install in a
virtualenv so that tests can add the virtualenv/bin to their PATH and
call ceph-detect-init from sources as they would if it was installed.

Part of run-tox.sh is moved to tools/setup-virtualenv.sh so that it can
be re-used by ceph-disk and other python modules.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
c7fbe2124b tests: instructions to collect ceph-disk coverage
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
ca97b67b76 tests: remove ceph-disk dead code
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
e3b0395d25 ceph-disk: flake8 fixes
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:38:08 +07:00
Loic Dachary
2e05e47403 tests: run ceph-disk tests via tox
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:36:37 +07:00
Loic Dachary
5151063fda ceph-disk: refactor into a proper python module
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:36:37 +07:00
Loic Dachary
9429c0402e tests: ceph-disk deactivate takes the activate lock
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:36:37 +07:00
Loic Dachary
f4dd1c67ce tests: ceph-disk command returns stderr
Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-04 14:36:37 +07:00
Sage Weil
43dce135d6 ceph-osd: don't mention journal on mkfs
Some backends don't use it, almost all clusters use the default
path, and there'll always be a symlink.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 14:36:37 +07:00
Kefu Chai
7ab19fdb08 makefile: include spdk source in dist tar ball.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:05:54 +08:00
Kefu Chai
09e55d0c24 autotools: enable NVMEDevice if SPDK is found
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:05:53 +08:00
Kefu Chai
ecb1256968 cmake: enable NVMEDevice if SPDK is found
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:03:21 +08:00
Kefu Chai
fd630dc7d9 spdk: add submodule spdk for the nvme support
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:03:21 +08:00