When choosing a random OSD to send a message to, verify not only that
the OSD id is up but that the session is for the same instance of that OSD
by checking that the address matches.
Fixes: #7093
Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
The mon may occasionally send OSDMap messages to random OSDs, but is not
very descriminating in that we may not have authenticated yet. Ignore any
messages if that is the case; we will reqeust whatever we need during the
BOOTING state.
Fixes: #7093
Signed-off-by: Sage Weil <sage@inktank.com>
Adds a class that executes registered callbacks in its destructor. Since
static duration objects have their destructors called when returning
from main or calling exit then this can be used as a replacement for
on_exit.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
How to make this portable:
- MAP_ANONYMOUS -> MAP_ANON (OSX)
- sem_init (anonymous semaphore) needs to be replaced by named
semaphores using sem_open/sem_close. Use a memory address of the sem_t
variable to hack anonymous semaphore behavior.
- sem_getvalue isn't supported on OSX. it is used here to do
sem_wait/sem_post to bring a semaphore back to a specific value. to get
around this we may need to restructure the test so that the semaphore
can be destroyed and re-initialized rather than inspected as its
currently being done.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
On OSX (and currently any platform missing the MSG_MORE
macro) the MSG_MORE optimization is disabled. The MSG_NOSIGNAL flag is
available on OSX but is called SO_NOSIGPIPE and must be set via
setsockopt.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
When running "make check", Automake generates test-suite.log, along with
various *.log and *.trs files in the tree. Add these files to
.gitignore.
(It looks like this feature arrived in Automake 1.13.)
Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
The output of test/ceph-disk.sh is very verbose which is good for
debugging errors. However it sometime contains strings that match
/error:/i which is picked by gitbuilder as a sign that the test fail,
even when the exit code is zero.
Remove from the output the three strings triggering false positive in
gitbuilder.
Signed-off-by: Loic Dachary <loic@dachary.org>
In cce990efc8 we added a limit to avoid
holding the lock for too long. However, if we back off, we currently
wait for a full second, which is probably a bit much--we really just want
to give other threads a chance.
Backport: emperor
Signed-off-by: Sage Weil <sage@inktank.com>
Replace hardcoded /etc/ceph with the SYSCONFDIR global variable and
implement the --sysconfdir option to override the default value.
Signed-off-by: Loic Dachary <loic@dachary.org>
Replace hardcoded /var/lib/ceph with the STATEDIR global variable and
implement the --statedir option to override the default value.
Signed-off-by: Loic Dachary <loic@dachary.org>
Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.
Signed-off-by: Loic Dachary <loic@dachary.org>
It is meant to be used when preparing and activating a directory that is
not to be used with init. No file is created to identify the init
system, no symbolic link is made to the directory in /var/lib/ceph
and the init scripts are not called.
Signed-off-by: Loic Dachary <loic@dachary.org>
Use get_conf_with_default instead of get_conf because fsid is a known
ceph configuration option. It allows overriding via CEPH_ARGS which is
convenient for testing. Only options that are not found in config_opts.h
are fetch via get_conf.
Signed-off-by: Loic Dachary <loic@dachary.org>
The string form of a CalledProcessError instance does not include the
output datamember. Add it to the Error exception for debug purposes.
Signed-off-by: Loic Dachary <loic@dachary.org>
Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.
Signed-off-by: Loic Dachary <loic@dachary.org>
/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.
The hardcoded path cannot be removed altogether because it will most
likely lead to unexpected and difficult to diagnose problems for
existing installations where the PATH finds the program elsewhere.
The --prepend-to-path flag is added and defaults to /usr/bin : it prepends
to the PATH environment variable. The hardcoded path is removed
and the PATH will be used: since /usr/bin is searched first, the
legacy behavior will not change.
Signed-off-by: Loic Dachary <loic@dachary.org>
Reorder sequence so min_size check is right
Remove redundant resize of backfill
Correction to 19cff890eb
Signed-off-by: David Zafman <david.zafman@inktank.com>
Because ceph-disk relies on hardcoded paths. The corresponding test will
be added back when ceph-disk can run from sources.
Fixes: #7085
Signed-off-by: Loic Dachary <loic@dachary.org>
Working around missing integer types is pretty easy. For example, the
__u32 family are Linux-specific types, and using these in Ceph
internally is fine because we can typedef them.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Defines CEPH_[BIG|LITTLE]_ENDIAN to use, as BYTE_ORDER etc macros may be
different names on different platforms.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
The tunables were mostly supported by later argonaut point releases,
but not officially. Let's stick with bobtail though!
Signed-off-by: Sage Weil <sage@inktank.com>