If we get a peer log/missing and call search_for_missing, requeue the pg
for recovery so we can pull anything we may have just found.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If our might_have_unfound calculation was off (it currently can be, see
#865) we could prematurely give up. Try any up OSD at this stage just to
be sure.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
recover_replicas may fail to start anything if we see an unexpected error.
In that case, try recover_primary immediately instead of waiting for the
PG to (hopefully) get requeued for recovery later.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If we couldn't start any recovery ops and things are still
unfound, see if we can discover more missing object locations.
It may be that our initial locations were bad and we errored
out while trying to pull.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Adds deep copy method IoCtx::dup, so that the data and metadata
contexts can have different snap_seqs and snap contexts.
Also avoid calling Rados::shutdown explicitly, since the destructor
will do this, and it must run after the Image destructor.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Adds get and put to IoCtxImpl for refcounting,
and uses them in WatchContext, which shouldn't
be creating a copy of the IoCtxImpl.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
IoCtx::from_rados_ioctx_t creates an IoCtx out of a rados_ioctx_t.
However, this IoCtx must share ownership of the IoCtxImpl pointer with
the C API user who first called rados_ioctx_create. This must be done
via a reference count inside the IoCtxImpl.
Also add a copy constructor and assignment operator to class IoCtx,
since it's now cheap to have them.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
It's much better to get EPIPE than SIGPIPE.
Block SIGPIPE in all threads we create. In the daemon, block SIGPIPE in
the main thread.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Log a version message whenever we open the dout log, not just the first
time. However, only output it to log files and syslog. Spewing versions
to stderr and stdout was determined to be annoying.
Rename dout_emergency_impl to dout_emergency_to_file_and_syslog to
better reflect its function.
Rename ceph_version_to_string to pretty_version_to_string.
Add get_process_name to do just that. Re-arrange some version.h methods.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Conflicts:
src/common/common_init.cc
It turns out POSIX says rename(a,b) is a no-op when a and b link to the
same inode. This is super weird but good news because it means we can
rip out a bunch of poorly tested code.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reopen the dout stream only after we parse all configuration options.
Specifying --log-file on the command line now works as expected.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Remove the log_to_file configuration option. Instead, only log to a file
if either log_file or log_dir is set.
This way, command-line options like --log-file=/tmp/foo work as
expected.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
At global constructor time: default to logging everything to stderr.
During common_init: set appropriate logging defaults based on the type
or program (daemon or other).
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
G++ complains about the difference between the return type of tcmalloc's
IsHeapProfilerRunning (int) and the return type of the function that
g_conf.profiler_running is supposed to point to (bool). We could
probably get away with a type-cast, but as a compiler developer and
former C++ language lawyer, I'd rather not take the risk of destroying
the universe by invoking undefined behavior ;-)
Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We infer an empty missing set, but weren't calculating object locations
based on that. Usually it was okay because we already had another
location, but not always! And especially not when one location turns out
to be bad and we need to go to another.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If the recovery finds the object missing on disk during recovery, add it
to the local missing set so we can (hopefully) recover it from another
replica.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
1- If we try to pull an object that isn't there, send an empty push in
reply.
2- If we get an empty push, call a new failed_push helper. Also called
when we pull partial/bad data.
3- Fix the fail behavior to close out our attempt, adjust our missing_loc,
but let the calling recovery code handle the retry.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>