Commit Graph

13255 Commits

Author SHA1 Message Date
Colin Patrick McCabe
5f73086852 Splt rados_init into rados_create + rados_connect
Splt rados_init into rados_create and rados_connect.  The pattern will
be for users to call create, set configuration, and then connect. Rename
rados_release to rados_destroy, to be more symmetrical with
rados_create. You can't reconnect after calling destroy.

Don't create the messenger inside the RadosClient constructor. Instead,
wait until RadosClient::connect().

Rename rados_conf_apply to rados_reopen_log. Add comment about SIGHUP.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
871fa1b322 Add rados_conf_apply, comments
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
0d54e31169 md_config_t::set_val/get_val
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
21544fdc32 common: more include and copyright fixes
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
ebc9dbc175 common: Fix some missing includes, copyrights
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
713f9a11dd cconf: remove second argument to cconf --lookup
Everyone uses get_conf to get configuration values. So the logic for
defaulting to some value if we can't find the requested key should live
there. Also fix a case in cconf where we could encounter a usage error
and keep on going.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
29b6439104 ceph_common.sh: remove get_val, get_val_bool
get_val and get_val_bool are unused.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
431a5bf7c3 Rename config.h -> common/config.h
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
f2e3d83886 config.cc: doesn't depend on ceph_ver.h
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Josh Durgin
96edddea9e testlibrbdpp: update for new librados and librbd APIs
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-23 10:17:25 -08:00
Josh Durgin
c5bb735038 rbd: update for new librados and librbd APIs
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-23 09:31:52 -08:00
Josh Durgin
134f261a0a librbd: implement stacking on top of librados
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-23 09:31:52 -08:00
Josh Durgin
b1d6e30e8c librados: add constructor to allow client re-use
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-23 09:31:52 -08:00
Josh Durgin
15f20f5b0e librados: switch to noun_verb function names
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-23 09:31:52 -08:00
Sage Weil
b2ceebf4e3 librbd: stack on top of librados 2011-02-23 09:31:52 -08:00
Samuel Just
7434659201 ReplicatedPG: snap_trimmer should bail out while finalizing_scrub
Check to make sure !finalizing_scrub when relocking.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-02-22 15:09:40 -08:00
Samuel Just
4ddc5db610 OSD,PG: fix race between processing scrub and dequeueing scrub
Previously, a second scrub could be scheduled between when the first is
dequeued and processed resulting in two scrubs of the pg running
concurrently.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-02-22 15:09:33 -08:00
Sage Weil
89b743c4b4 osd: fix recovery pointer when pulling head before snapid
If recovery wants to pull a snapped object and needs the head first, pull()
does that, but the caller doesn't ++skipped and incorrectly bumps the
recovery pointer, preventing us from going back and re-pulling the snapped
object later.

Return a tristate enum from pull so we can tell what it did and update our
recovery state appropriately.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 12:45:21 -08:00
Sage Weil
48f69894ed osd: verify object version during push
Fail to push if the ondisk version doesn't match the version we want to
send.

This isn't supposed to happen. If it does it means we have a bug somewhere
else.  Log something to the error log and don't push.  This is better than
the current behavior, which goes into a loop (repeatedly pulling the object
and retrying when it's not the right version).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 12:20:40 -08:00
Sage Weil
e4b8274241 osd: improve up_thru request behavior
There is some epoch the OSD wants for up_thru, based on when the PG mapping
last changed.  However, once the monitor gets to the point where it must
update the map, it should set up_thru to the most recent epoch the OSD has
seen (i.e. the epoch it is known to be "up thru"!).  This will hopefully/
frequently avoid any subsequent up_thru requests.

MOSDAlive already has a separate field (in PaxosServiceMessage) to hold the
latest epoch; just fix the constructor to set it properly, and make the
monitor use it.  No protocol change, yay!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 09:40:47 -08:00
Colin Patrick McCabe
4df36436cb pybind: update rados python bindings for new API
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-22 09:27:40 -08:00
Sage Weil
0e4e5a5b26 osd: set correct epoch for up_thru osd->mon request
Put the epoch we need for up_thru in the request.  Putting the most recent
epoch causes incorrect osdmap churn.

Fixes: #824
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 09:10:04 -08:00
Greg Farnum
158889b2e4 PGMap: make osd_full and nearfull ratios configurable.
These were previously set by #defines. Pretty stupid
when we have a nice config system already!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-22 09:11:12 -08:00
Sage Weil
950e8c3e80 librados: more API cleanup; rados_conf_ stubs
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 08:09:32 -08:00
Colin Patrick McCabe
1dc12e3e1d move g_default_file_layout into ceph_fs.cc
It's defined in ceph_fs.h.

Fix a bunch of headers that use types without including the headers that
define those types.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-22 08:09:32 -08:00
Sage Weil
2de8b7b812 librados: add cluster handle to C API
Had to add a layer of indirection to the list context handles.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-22 08:09:32 -08:00
Sage Weil
0a96e6a73a Makefile: include ceph_argsparse.h in dist tarball
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-20 21:00:57 -08:00
Sage Weil
4ffe069859 filestore: fix clone_range
This was broken by the safe_write() switchover; the success return value
is now 0, not the number of bytes written.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-20 20:58:16 -08:00
Colin Patrick McCabe
2a59b2132f common: Split argument parsing into ceph_argparse
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-20 10:17:11 -08:00
Sage Weil
349cb12859 keyring_init: don't print error when explicit key/keyfile is specified
e.g. when I am non-root and specify a key explicitly, no need to complain
about not being able to read root's /etc/ceph/keyring.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-02-20 13:54:20 -08:00
Sage Weil
859aaf7836 Revert "keyring_init: g_conf.keyring is not a list"
This reverts commit 2fb6036aa5.
2011-02-20 13:52:15 -08:00
Colin Patrick McCabe
2fb6036aa5 keyring_init: g_conf.keyring is not a list
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 10:02:39 -08:00
Josh Durgin
b96f1642b4 Revert "Makefile.am: remove unused libs from linking with librbd tests and rbd"
Same problem as 38f38a9914.

This reverts commit e5db46cea0.
2011-02-18 16:01:10 -08:00
Colin Patrick McCabe
f51040ccd7 Clock: remove unused mutex
We don't use a mutex in g_clock any more, so let's not construct one any
more.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 08:40:26 -08:00
Greg Farnum
a7929c5e26 Merge branch 'pool_memory' 2011-02-18 15:42:16 -08:00
Greg Farnum
a2f0cd0d7b test: Add new memory tests, move to own subdir.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-18 15:41:41 -08:00
Greg Farnum
654dc79c3e vstart: remove directories, too.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-18 15:41:41 -08:00
Greg Farnum
eea1f098cc OSD: convert waiting_for_pg from hash_map to map.
This doesn't need to be a hash_map; there will only be an entry
for each PG that gets a message request while it's not active.
Shouldn't be too many PGs that that happens too, right?

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-18 15:41:41 -08:00
Greg Farnum
935eaf3a62 PG: remove the object locking stubs and some dead code.
These are unused (#if 0'd, so no way to use them!) and require
a memory-hogging hash_map. Goodbye!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-18 15:41:41 -08:00
Greg Farnum
f49909ba27 PG: convert hash_maps to maps, remove unused.
waiting_for_[missing|degraded]_object don't need to be
hash_maps, and we don't use stat_object_temp_rd at all.
Swap to map and remove to reduce per-PG memory consumption!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-02-18 15:41:41 -08:00
Colin Patrick McCabe
5db1e50db3 debug.h: cleanup includes
Shouldn't need to include DoutStreambuf.h; that's all implementation.
Don't include Mutex.h, since we don't use it.
*Do* include config.h, since we need it.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 07:36:06 -08:00
Colin Patrick McCabe
d362874e54 common: Move hex dump functions into hex.h
Move hex dump functions into hex.h. Remove unecessary includes from
debug.cc

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 06:35:47 -08:00
Colin Patrick McCabe
61b661b2f8 Makefile: version.cc should depend on ceph_ver
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 06:28:39 -08:00
Colin Patrick McCabe
ef0e07d993 debug.h: move Ceph version stuff into version.h
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-18 06:25:06 -08:00
Josh Durgin
38f38a9914 Revert "Makefile.am: remove unused libs from linking with librbd"
librados doesn't export ceph::buffer_total_alloc

This reverts commit 9bbd6c32a5.
2011-02-18 13:11:44 -08:00
Josh Durgin
eadc3c87cc testlibrbdpp: fix off by one error in read test
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-18 11:17:17 -08:00
Josh Durgin
e5db46cea0 Makefile.am: remove unused libs from linking with librbd tests and rbd
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-18 11:12:48 -08:00
Josh Durgin
9bbd6c32a5 Makefile.am: remove unused libs from linking with librbd
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-02-18 10:50:55 -08:00
Sage Weil
4231cef68f Merge remote branch 'origin/max_commit_size' 2011-02-17 23:06:13 -08:00
Colin Patrick McCabe
b56cafe492 pybind/rados: write_full: remove silly extra param
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-17 10:53:00 -08:00