1
0
mirror of https://github.com/ceph/ceph synced 2025-03-11 02:39:05 +00:00
Commit Graph

48736 Commits

Author SHA1 Message Date
Adam C. Emerson
f4b083a5e3 osdc: Update to use C++11 concurrency
The only externally visible change is that Objecter::get_osdmap_read
and Objedcter::put_osdmap_read have been removed in favor of
Objecter::with_osdmap.

It can be used like:

objecter->with_osdmap([&](const OSDMap& o) { o.do_stuff(); };
int x = objecter->with_osdmap([&](const OSDMap& o) {
    return get_thing(id); });
objecter->with_osdmap(std::mem_fn(&OSDMap::do_stuff));
int x = objecter->with_osdmap(std::mem_fn(&OSDMap::get_thing),
                              id);

The choice between the style of the first two examples or the second two
is arbitrary and depends on what you prefer.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-02-05 17:07:28 -05:00
Matt Benjamin
21438a6773 cmake: add libboost_system to EXTRALIBS
This concisely fixes several unittest builds, and reflects the
fact that this library dependency has moved into several areas
of the codebase (libcephfs, librbd, librgw).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-02-05 16:46:21 -05:00
Matt Benjamin
2669e0c280 cmake: don't try to install src/ceph-disk directory
The proper cmake boilerplate to call ceph-disk/ceph-disk's
python installer is not present, FYI.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-02-05 16:46:16 -05:00
Matt Benjamin
33bc2ba55e cmake: don't add_test cephtool_test_osd twice
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-02-05 16:46:13 -05:00
Jason Dillaman
38b9be2a99 librados_test_stub: protect against notify/unwatch race
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 16:14:39 -05:00
Adam C. Emerson
c1b3138f2e concurrency: Add shunique_lock
Locker class tracking shared/unique/unlocked state of SharedMutex
concept.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-02-05 15:57:03 -05:00
Jason Dillaman
9418f055bd librbd: partial implementation of journal client / tag allocation
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:28 -05:00
Jason Dillaman
8443e50710 librbd: initial version of journal client and tag metadata
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:28 -05:00
Jason Dillaman
608947cb3f journal: added tag support methods
librbd, for example, will allocate a new tag after acquiring
the exclusive lock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:28 -05:00
Jason Dillaman
5eda2859d0 cls_journal: new get_client / client_update methods
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:28 -05:00
Jason Dillaman
3f29e7b89a cls_journal: client registration should hold opaque data structure
The opaque structure will support journal client applications to
store and retrieve complex state.

Fixes: 

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:27 -05:00
Jason Dillaman
fa6d0ba964 cls_journal: new tag management methods and handling
In the case of librbd, a new tag will be allocated when the
exclusive lock is acquired.  All tags for the same dataset
(e.g. librbd image) will belong to the same class.  Tags are
automatically pruned on tag create / client unregister
if no other clients' commit position would require the tags.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 15:21:26 -05:00
Jason Dillaman
243d91db68 journal: switched entry tags to use id instead of string
Later commits will add the ability to allocate tags and
associate them with registered clients.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 13:03:57 -05:00
Adam C. Emerson
48c542ac1c concurrency: make C++11 style debugging mutices
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-02-05 12:15:19 -05:00
Kefu Chai
cb2fc91ec3 Merge pull request from jack-changtao/wip-cmake2
CMake: For CMake version <= 2.8.11, use LINK_PRIVATE and LINK_PUBLIC

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-06 01:14:58 +08:00
Jason Dillaman
3c1f0973d7 Merge pull request from jdurgin/wip-rbd-mirroring
rbd-mirror: daemon skeleton

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2016-02-05 12:02:32 -05:00
Adam C. Emerson
672a694afc time: Remove constexpr from non-literal type in test
This fixes a compile error under clang and fixes another FreeBSD porting
issue.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-02-05 11:22:55 -05:00
Adam C. Emerson
0fcb3070ac time: Have skewing-now call non-skewing now
For the real-time clocks, Ceph's testing infrastructure likes to be able to
inject a skew. To avoid pulling CephContext into ceph_time.h these are moved to
ceph_time.cc. The original way this was done called clock_gettime in both
places.

This is an unnecessary duplication and apparently error-prone. So only call
clock_gettime from one place.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-02-05 11:21:41 -05:00
Loic Dachary
ed8b675a6e Merge pull request from tchaikov/wip-fix-exe-test
tests: mon: "chmod +x mon-created-time.sh"

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2016-02-05 22:52:28 +07:00
Kefu Chai
47c9b621be tests: mon: "chmod +x mon-created-time.sh"
otherwise it always fails to run.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-05 23:45:43 +08:00
Sage Weil
08517578e3 os/bluestore/KernelDevice: use _exit(1) for failure injection
This way we don't generate a core file, which spams the log and trips up
teuthology.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-05 09:51:59 -05:00
Sage Weil
a297261a38 os/bluestore: fix block device file creation
Just make a separate flag to indicate whether we create a block
file.  This lets us drop the weird touch in vstart.sh, and default
to creating a token 'block' file on --mkfs.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-05 09:21:41 -05:00
Sage Weil
c4f9d26553 Merge pull request from xiexingguo/xxg-wip-finisher
librados: shutdown finisher in a more graceful way

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-05 09:17:43 -05:00
Sage Weil
33689975ce Merge pull request from liewegas/wip-bluestore-block
osd: bluestore: set default wal size; improve weird implicit block file creation logic

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2016-02-05 09:17:15 -05:00
Sage Weil
c87f3f3464 Merge pull request from tchaikov/wip-cmake-spdk
build: spdk submodule; cmake

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-05 09:16:59 -05:00
Sage Weil
adfc653ea0 Merge pull request from dachary/wip-13942-ceph-disk
ceph-disk: support bluestore

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-05 09:15:26 -05:00
Sage Weil
4c13f9d788 os/bluestore/BlueFS: initialize super block_size earlier in mkfs
Reported-by: Dan Mick <dmick@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-05 08:41:03 -05:00
xie xingguo
23d39cbc25 os/kstore: kill dead code
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-05 18:42:03 +08:00
xie xingguo
5d5e4200e2 os/kstore: fix race condition
The get_omap_iterator shall check the existence of onode too,
which may race with the rename method.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-05 17:37:49 +08:00
xie xingguo
1e8719f955 os/bluestore: fix race condition
The get_omap_iterator shall check the existence of onode too, which may
race with the rename method.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-05 17:34:51 +08:00
Jianjian Huo
d5cdc7a5a2 os/bluestore: remove unused intrusive member hook in enode
Enode only uses intrusive unordered_set base hook, member hook is not neccesary.
This should save some memory space, when we have tons of enodes.

Signed-off-by: Jianjian Huo <samuel.huo@gmail.com>
2016-02-05 00:44:38 -05:00
Loic Dachary
9828d49d6f global: do not start two daemons with a single pid-file (part 2)
Fixes the following bugs:

* the fd is open(O_WRONLY) and cannot be read from, safe_read
  always fails and never removes the pid file.

* pidfile_open(g_conf) is close(STDOUT_FILENO) and there is a risk that
  pidfile_open gets STDOUT_FILENO only to have it closed and redirected
  to /dev/null.

* Before writing the file, ftruncate it so that overriding a file
  containing the pid 1234 with the pid 89 does not end up being
  a file with 8934.

* Before reading the file, lseek back to offset 0 otherwise it
  will read nothing.

* tests_pidfile was missing an argument when failing
  TEST_without_pidfile and killed all process with ceph in their name,
  leading to chaos and no useful error message.

* lstat(fd) cannot possibly return a result different from the one
  obtained right after the file was open, stat(path) must be used
  instead.

In addition to fixing the bugs above, refactor the pidfile.cc
implementation to:

* be systematic about error reporting (using cerr for when removing
  the pidfile because derr is not available at this point and derr
  when creating the pidfile).

* replace pidfile_open / pidfile_write with just pidfile_write since
  there never is a case when they are not used together.

More test cases are added to test_pidfile to verify the bugs above are
fixed.

http://tracker.ceph.com/issues/13422 Fixes: 

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-02-05 12:17:44 +07:00
xie xingguo
dca8111a98 os/kstore: assign nid for newly created onode
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-05 12:07:33 +08:00
xie xingguo
d5dfb007aa os/bluestore: assign nid for newly created onode
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-02-05 12:06:10 +08:00
Kefu Chai
8f13194bec Merge pull request from ktdreyer/wip-admin-build-doc-deps
admin/build-doc: depend on zlib1g-dev and graphviz

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-05 11:31:41 +08:00
renhwztetecs
b7bbcee2dc mon: unregister command on shutdown
unregister command on shutdown
include: "quorum enter" && "quorum exit"

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
2016-02-05 10:21:10 +08:00
Sage Weil
9da41fee1a systemd/ceph-radosgw-prestart.sh: remove
This is unpackaged and unused.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 17:48:16 -05:00
Sage Weil
b9ce1df075 unittest_config: cope with $data_dir not being expanded on non-daemons
Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 17:06:02 -05:00
Sage Weil
78592fd8a2 common: add $data_dir/config to config search path
Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 17:06:02 -05:00
Sage Weil
25929099ac common/config: expand $data_dir in config path
Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 17:06:02 -05:00
Sage Weil
3944d560e4 global: add data_dir_option for all daemons
This let's us use a generic $data_dir substitution that will map
to rgw_data, osd_data, etc.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 17:06:02 -05:00
Sage Weil
3760a024c8 Merge pull request from jack-changtao/wip-cache-tier
osd: enforce cache_min_evict_age

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 16:17:17 -05:00
Sage Weil
2caed6a12e Merge pull request from athanatos/wip-admin-malloc
common: admin socket commands for tcmalloc heap get/set operations

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 16:15:54 -05:00
Sage Weil
f97fcf2780 Merge pull request from athanatos/wip-14278
osd: correctly remove pg shards which are no longer acting

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 16:06:35 -05:00
Sage Weil
3bde8955d6 Merge pull request from athanatos/wip-14423
Wip 14423

Reviewed-by: Sage Weil <sage@redhat.com>
2016-02-04 16:04:34 -05:00
Sage Weil
8ec24d51f7 Merge pull request from batrick/systemd-sandbox
systemd: add systemd sandboxing to services

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Boris Ranto <branto@redhat.com>
2016-02-04 15:25:05 -05:00
Josh Durgin
28dcf0bc1b .gitignore: add rbd-mirror
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2016-02-04 11:42:52 -08:00
Sage Weil
aedb928869 os/bluestore/BlueStore: fix enode uniqueness
We were failing to set o->enode, which meant that there were
multiple instances of the same enode alive at once.  Avoid this
category of bug by changing _txc_release to take the onode ref
and assign it there, and removing almost all of the local EnodeRef
instances.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-02-04 13:05:37 -05:00
Ken Dreyer
dada290bf2 admin/build-doc: depend on zlib1g-dev and graphviz
The docs currently require zlib1g-dev (on Ubuntu) and graphviz (on RHEL
and Ubuntu) in order to build.

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2016-02-04 10:41:37 -07:00
Yehuda Sadeh
995a6029bb Merge pull request from ceph/wip-mtime-bugfix
Bug fix for mtime anomalies in RadosGW and other places

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2016-02-04 08:36:02 -08:00