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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>