If the user didn't specify any actions, print out a usage message rather
than silently exiting.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
If "rados put" uses write instead of write_full, the resulting object on
the server may be a mismash of old and new objects, if the old object
was longer than the new one. This is fairly counterintuitive behavior
for radostool, so remove it.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Create a libcommon service thread. Use it to handle SIGHUP.
Handle it by means of a flag that gets set. Using a queue would raise
the complicated question of what to do when the queue was full.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Don't use the global g_ceph_context. Instead, store the CephContext in
the structures provided by the library user.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
A CephContext represents the context held by a single library user.
There can be multiple CephContexts in the same process.
For daemons and utility programs, there will be only one CephContext.
The CephContext contains the configuration, the dout object, and
anything else that you might want to pass to libcommon with every
function call.
Move some non-config things out of md_config_t and into CephContext.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Split off common_init_daemonize from common_init_finish. cfuse is a
daemon that calls common_init_finish, but handles daemonization itself.
This fixes cfuse.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Get rid of the initialize-then-shutdown-crypto hack. We just initialize
crypto once, after it is safe to do so. There is now a single callback,
common_init_finish, which does the final stage of initialization,
including starting crypto and daemonization (if required.)
common_init_finish needs to be done before messenger::start().
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
A few things:
- track Connection* instead of entity_inst_t for hb peers
- we can only send maps over the cluster_messenger
- if peer is still alive, do that
- if peer is not, send dying MOSDPing ping with YOU_DIED flag
If we forget the peer epoch when we see them go down, we won't share the
map later in update_heartbeat_peers() to tell them they're down.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We try to keep track of which epochs our peers have so that we can be
semi-intelligent about which map incrementals we send preceeding any
messages. Since this is useful from the heartbeat and cluster channels/
threads, protect the data with an inner lock and clean up the callers.
Be smarter about when we forget.
Make note of peer epoch when we receive a ping.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>