Add the osd's features to the osd's extra info field in the OSDMap
so we can track which OSDs are able to deal with Erasure Codes.
This will allow us to decide whether or not we are ready to set EC
whenever the user asks us to set EC on a pool -- which shall be
handled by a subsequent commit.
Fixes: 6028
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
If we have a pool with type Erasure, then we consider we require
CEPH_FEATURE_OSD_ERASURE_CODES.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
crush: make set_chooseleaf_tries work with firstn chooseleaf, too
Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.com>
Include the tunables profile, and flags indicating whether it is optimal,
legacy, or requires certain features.
Signed-off-by: Sage Weil <sage@inktank.com>
Allow warning to be disabled via ceph.conf. Link to the docs from the
warning detail. Add a section to the docs specifically about what to do
about the warning.
Signed-off-by: Sage Weil <sage@inktank.com>
Upstart script for mapping / unmapping rbd device based on /etc/ceph/rbdmap file.
It does not mount or unmount filesystem, this part should be performed by _netdev option in fstab.
Signed-off-by: Laurent Barbe <laurent@ksperis.com>
Add configuration variable to override compatible acting set handling.
Later we'll check the osdmap that all OSDs are updated to use new acting sets.
Fixes: #6990
Signed-off-by: David Zafman <david.zafman@inktank.com>
The underlying code assumes the memory buffer is aligned on a long
boundary which is not always the case. Using buffer::create_page_aligned
which calls posix_memalign ensure the allocated buffer starts at an
address that is properly aligned.
Signed-off-by: Loic Dachary <loic@dachary.org>
Primarily useful to run scripts from qa/workunits as part of make check.
vstart_wrapper.sh starts a vstart.sh cluster, runs the command given in
argument and tearsdown cluster when it completes.
The vstart_wrapped_tests.sh script contains the list of scripts that
need the vstart_wrapper.sh to run. It would not be necessary if automake
allowed passing argument to tests scripts. It also adds markers to the
output to facilitate searching the output because it can be very verbose.
This wrapper is kept simple and will probably evolve into something more
sophisticated depending on the scripts being added to
vstart_wrapper_tests.sh. There are numerous options, ranging from
parsing the yaml from ceph-qa-suite to figure out the configuration
cluster to converting the same yaml into a puppet manifest that is
applied locally or even driving OpenStack instances to avoid messing
with the local machine. But this would probably be overkill at this
point.
Signed-off-by: Loic Dachary <loic@dachary.org>
A recent coverity run found two "defects" in rbd.cc:
** CID 1138367: Time of check time of use (TOCTOU)
/rbd.cc: 2024 in do_kernel_rm(const char *)()
2019 const char *fname = "/sys/bus/rbd/remove_single_major";
2020 if (stat(fname, &sbuf)) {
2021 fname = "/sys/bus/rbd/remove";
2022 }
2023
2024 int fd = open(fname, O_WRONLY);
2025 if (fd < 0) {
** CID 1138368: Time of check time of use (TOCTOU)
/rbd.cc: 1735 in do_kernel_add(const char *, const char *, const char *)()
same as above, s/remove/add
There is nothing racey going on here, and this is not an instance of
TOCTOU, but, instead of silencing coverity with annotatations, redo
this with two open() calls.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
killall fails to kill all OSDs when called as a oneliner. Replace with a
loop using pkill that retries until there are no more process to kill by
the required name.
Signed-off-by: Loic Dachary <loic@dachary.org>
Instead of removing them only in the current directory. Leftovers
prevent running make check-coverage properly because lcov fails
when stumbling on old .gcno files with
lcov -d . -c -i -o check-coverage_base_full.lcov
Processing os/BtrfsFileStoreBackend.gcno
geninfo: ERROR: ceph/src/os/BtrfsFileStoreBackend.gcno: reached
unexpected end of file
Signed-off-by: Loic Dachary <loic@dachary.org>
The legacy behavior is to make the normal number of tries for the
recursive chooseleaf call. The descend_once tunable changed this to
making a single try and bail if we get a reject (note that it is
impossible to collide in the recursive case).
The new set_chooseleaf_tries lets you select the number of recursive
chooseleaf attempts for indep mode, or default to 1. Use the same
behavior for firstn, except default to total_tries when the legacy
tunables are set (for compatibility). This makes the rule step
override the (new) default of 1 recursive attempt, keeping behavior
consistent with indep mode.
Signed-off-by: Sage Weil <sage@inktank.com>
We were leaking the static leader_supported_mon_commands. Move this into
the class so that we can clean up in the destructor.
Rename get_command_descriptions -> format_command_descriptions.
Fixes: #7009
Signed-off-by: Sage Weil <sage@inktank.com>
In FileJournal::_check_disk_write_cache(), use pclose() instead of
fclose() to close a stream, created by popen().
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
For the purposes of FileJournal::_check_disk_write_cache(), use
get_linux_version(), which is based on uname(2), instead of parsing the
contents of /proc/version.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
get_linux_version() returns a version of the currently running kernel,
encoded as in int, and is contained in common/linux_version.[ch].
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Break up AC_CHECK_HEADERS macro into one header-file per line so it's
easier to read and make changes.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>