This was missing from 17b5fc9a but we didn't notice
because the test wasn't being run by the gitbuilders.
Signed-off-by: John Spray <john.spray@redhat.com>
Using the array notation to list test is error prone and more
complicated to write.
It also fixes a bug : only the first test of each series (MON, OSD, MDS)
was run and the others were ignored.
Signed-off-by: Loic Dachary <loic@dachary.org>
This was an overly-strict check. In fact it is perfectly
fine to set an overlay on a pool that is already in use
as a filesystem data or metadata pool.
Fixes: #10135
Signed-off-by: John Spray <john.spray@redhat.com>
If CEPH_CLI_TEST_DUP_COMMAND is set when ceph osd create is called, it
will create two osd. They must be cleaned up afterwards instead of
assuming only one is going to be created.
http://tracker.ceph.com/issues/10083Fixes: #10083
Signed-off-by: Loic Dachary <ldachary@redhat.com>
For testing injectargs a configuration option was changed that has side
effects on the cluster. It could introduce random failures later. It is
replaced with a configuration option that cannot have adverse side
effects on the cluster.
http://tracker.ceph.com/issues/9919Fixes: #9919
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
It is incorrect to append the content of CEPH_ARGS to the argument list
when running injectargs. For instance if
CEPH_ARGS='--log-file the.log' \
./ceph tell osd.0 injectargs --no-osd_debug_op_order
translates into
./ceph tell osd.0 injectargs --no-osd_debug_op_order \
--log-file the.log
it ends up changing the log file of osd.0 which is probably unintended.
Instead CEPH_ARGS is inserted before injectargs and it translates into:
./ceph tell osd.0 --log-file the.log \
injectargs --no-osd_debug_op_order
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
The arguments of injectargs being valid ceph arguments, they are.
consumed when the ceph cli calls rados.conf_parse_argv(). It can be
worked around by obsuring them as in:
ceph tell osd.0 injectargs '--osd_debug_drop_ping_probability 444'
where '--osd_debug_drop_ping_probability 444' is a single argument that
does not match any known argument. The trick is that it will be
evaluated again once it reaches the OSD or the MON and translated into
the expected list of arguments. Although it is clear once explained, it
is obscure and leads to strange combinations such as:
ceph tell osd.0 injectargs '--osd_debug_op_order '
(note the extra space at the end) to set boolean parameters. A better
workaround is to add a -- marking the end of the options as in:
ceph tell osd.0 -- injectargs --osd_debug_op_order
this one is unfortunately much less documented and the user does not
usually know the exact semantic of --, let alone where it should be
placed.
The simpler solution is to split the argument list in two if
"injectargs" is found. The arguments that show after the "injectargs"
argument is removed from the list of arguments until parsing is
complete. It implements the more intuitive syntax:
ceph tell osd.0 injectargs --osd_debug_op_order
and the other forms are still valid for backward compatibility.
http://tracker.ceph.com/issues/9372Fixes: #9372
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Suites run with CEPH_TEST_CLI_DUP_COMMAND=1, which will send a duplicate
command for every command issued with the 'ceph' tool. Behavior is to
get a reply from the command and then send a duplicate, looking for the
same outcome (guaranteeing idempotency of the operations). However, it
so happens that if you remove the entity's own key from the keyring and
you happen to be unlucky enough so that the client's connection gets
failed (we also run tests with connection failure injections), the
'ceph' tool won't be able to reconnect to the cluster to send the
duplicate command (as it's entity no longer exists in the cluster's
keyring).
We rewrite the test instead of resorting to ugly hacks to work around
this behavior, simply having a new 'role-definer' added by the existing
'role-definer' (which we weren't testing anyway, so bonus points for
that) and then have one removing the other (to test the procedure) and
finally using 'client.admin' to remove the last 'role-definer'.
Fixes: #9820
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
Assuming they are more likely than others to leave OSD/MON in an
unstable state that could have undefined side effects on the tests
following it. A cleaner solution would be to run them in a separate
script that is run on an independent cluster.
http://tracker.ceph.com/issues/9700Fixes: #9700
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
We added MDS resetting code here a while back,
but the order of operations was such that a
"cluster up" was being run between a fail_all_mds
and the point at which we needed the map not to
be interfered with (testing setmap).
Also the new fs create/destroy cycles for testing
EC pool handling were missing calls to stop the
daemons before fs rm.
Signed-off-by: John Spray <john.spray@redhat.com>
It is expected for ceph tell to fail with ENXIO if the daemon it is
trying to join is not ready for some reason. This should be handled as a
transient error instead of a fatal error.
Add two shell functions to help with retry. They may prove useful if
other cases requiring a few retries show up.
http://tracker.ceph.com/issues/9655Fixes: #9655
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
expect_false does not extend past the pipe and fails because the command
succeeds
introduced in f05c977bbc
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Keep the osd trash test to ensure it is a valid command but make it a
noop by giving it a zero argument (meaning thrash 0 OSD maps).
Remove the loops that were added after the command in an attempt to wait
for the cluster to recover and not pollute the rest of the tests. Actual
testing of osd thrash would require a dedicated cluster because it the
side effects are random and it is unnecessarily difficult to ensure they
are finished.
http://tracker.ceph.com/issues/9620Fixes: #9620
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
ceph --format plain osd find 1 (and metadata) are not implemented and
must fallback to the default (json-pretty).
http://tracker.ceph.com/issues/9538Fixes: #9538
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Add a trivial osd health test at the beginning of each group of
tests. When facing an intermittent failure, it is difficult to diagnose
if the cluster appears to be missing an OSD but there is no indication
as to when the OSDs were last up.
The tests are now only run after all OSDs are up.
These checks can be disabled with --no-sanity-check to allow running
some tests that have less requirements than running all the tests.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
From the bash man page:
set -e exit immediately ... The shell does not exit ... if the
command's return value is being inverted with !
Add an explicit exit 1 where appropriate.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
* Removing tiers from a base pool in use by CephFS is forbidden.
* Using CephFS pools as tiers is forbidden.
Signed-off-by: John Spray <john.spray@redhat.com>
Fixes two things:
* EC pools are now permissible if they have a cache overlay
* Pools are not permissible if they are a cache tier.
Fixes: #9435
Signed-off-by: John Spray <john.spray@redhat.com>
Add tests to fail as soon as an unexpected condition is met in
test_mon_osd. Otherwise the actual error will be more difficult find in
the logs.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Previously this test assumed no pre-existing
filesystem and no MDS running. Generalize it
to nuke any existing filesystems found before
running, so that you can use it inside a vstart
cluster that had MDS>0.
Signed-off-by: John Spray <john.spray@redhat.com>
Make sure gets and sets of tiering-specific variables succeed on tier
pools and fail on non-tier pools.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: 'osd pool' - if we can set it, we must be able to get it
Reviewed-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Sage Weil <sage@redhat.com>
Add support to get the values for the following variables:
- target_max_objects
- target_max_bytes
- cache_target_dirty_ratio
- cache_target_full_ratio
- cache_min_flush_age
- cache_min_evict_age
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
... that after a fs new on fresh pools, crash_replay_interval
is set to the default on the data pool.
Signed-off-by: John Spray <john.spray@redhat.com>
If the test is run against a cluster started with vstart.sh (which is
the case for make check), the --asok-does-not-need-root disables the use
of sudo and allows the test to run without requiring privileged user
permissions.
Signed-off-by: Loic Dachary <loic@dachary.org>
Accomodate changes:
* data and metadata pools no longer exist by default
* filesystem-using tests must use `fs new` to create
the filesystem first.
Signed-off-by: John Spray <john.spray@inktank.com>
Commit 7dc93a9651 fixed an incorrect
behavior with the OSD's 'osd bench' value hard-caps. The test wasn't
appropriately modified unfortunately.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
The test was a big sequence of commands being run and it has been growing
organically for a while, even though it has maintained a sense of
locality with regard to the portions being tested.
This patch intends to split the commands into functions, allowing for a
better semantic context and easier expansion. On the other hand, this
will also allow us to implement mechanisms to run specific portions of
the test instead of always having to run the whole thing just to test a
couple of lines down at the bottom (or have to creatively edit the test).
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
It was a noop because it was incorrectly using the variable n. Add a
test to protect against regression.
http://tracker.ceph.com/issues/8440Fixes: #8440
Reported-by: Geoffrey Hartz <hartz.geoffrey@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
When a pool is created with ceph osd pool create, the auid is not
inferred from the session auid and is set to zero. Add the
ceph osd pool set <pool> auid <int>
command to set it after it is created, and the matching get:
ceph osd pool get <pool> auid
Signed-off-by: Loic Dachary <loic@dachary.org>
There are several perils when splitting a cache pool:
- split invalidstes pg stats, which disables the agent
- a scrub must be manually triggered post-split to rebuild stats
- the pool may fill the OSDs during that period.
- or, the pool may end up beyond the 'full' mark and once scrub does
complete and the agent activate we may block IO for a long time while
we catch up with flush/evict
Make it a bit harder for users to shoot themselves in the foot.
Fixes: #8043
Signed-off-by: Sage Weil <sage@inktank.com>
The qa and functional tests are adapted to the new command prototype
requiring a profile instead of a list of properties. When possible the
implicit ruleset creation is used to simplify the test setup.
Signed-off-by: Loic Dachary <loic@dachary.org>
If I have to touch this again I will remove it. Ugh. This time,
ubuntu@teuthology:/var/lib/teuthworker/archive/teuthology-2014-03-11_02:30:01-rados-firefly-distro-basic-plana/125922
hit NXIO a few lines down because one of the OSDs was still down.
Signed-off-by: Sage Weil <sage@inktank.com>
- fix the wait check for osds to come back up
- make sure they get marked back in, too
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
This wreaks havoc on our QA because it marks osds up and down and then
immediately after that we try to scrub and some osds are still down.
Adjust the CLI test to wait for all OSDs to come back up after thrashing.
Signed-off-by: Sage Weil <sage@inktank.com>
The cache pools will throttle when they reach the target max size, so it
is important to make the administrator aware when they approach that point.
Unfortunately it is not particularly easy to efficiently keep track of
which PGs have hit their limit and use that for reporting. However, it
is easy to raise a flag when we start to approach the target for the
entire pool, and that sort of early warning is arguably more useful
anyway.
Trigger the warning based on the target full ratio. Not when we hit the
target, but when we are 2/3 between it and completely full.
Implements: #7442
Signed-off-by: Sage Weil <sage@inktank.com>
This is a friendlier interface for setting up a cache tier with some
reasonable defaults (defined via config options). This will simplify
the user experience and documentation.
Signed-off-by: Sage Weil <sage@inktank.com>
In general, users should not use non-empty pools as new tiers or else
things can behave strangely:
- the data sets are unrelated behavior will be... strange.
- if the cache pool is not "new" and does not do the OMAP flag, the OSD
will not know not to flush omap objects to an EC base tier
- probably other random stuff I'm forgetting
Allow a user to shoot themselves in the foot with --force-nonempty.
Implements: #7457
Signed-off-by: Sage Weil <sage@inktank.com>
We would like to get the hit set parameters: hit_set_type |
hit_set_period | hit_set_count | hit_set_fpp via OSDMonitor
Signed-off-by: Kai Zhang <zakir.exe@gmail.com>
comment out erasure pool related tests when an OSD is involved because
it does not work yet. See http://tracker.ceph.com/issues/7360.
Signed-off-by: Loic Dachary <loic@dachary.org>
On Linux ENOTSUP is remapped
/usr/include/x86_64-linux-gnu/bits/errno.h
/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP
and should have different values on other operating systems. On Ubuntu
precise the string returned when translating the error value of ENOTSUP
or EOPNOTSUPP is always EOPNOTSUPP but on Ubuntu saucy it is always
ENOTSUP.
Replace ENOSYS with ENOTSUP because the expected semantic is very
similar and modify the test to not check on the string translation of
the error.
Rework the check_response shell function to optionaly check the return
code. The erasure coded pool size change test verifies the error message
only but not the error code.
Signed-off-by: Loic Dachary <loic@dachary.org>
We had already added this as a flag (set/unset) when I generalized the
'mds set_max_mds' to be 'ceph mds set <var> <val>'. Switch the snaps
flag to be a key/value to with true/false (similar to the hashpspool
pool flag) since there are fewer users and the var/val approach is more
general.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
When run in a shared environment ( as opposed as a machine created for
the purpose of running this test only ), it is important to cleanup
leftovers to avoid poluting the /tmp space. Create a common temporary
directory for all tmp files.
Signed-off-by: Loic Dachary <loic@dachary.org>
First, add the ability to modify max_file_size. While we are at it, move
to a more sensible interface for adjusting max_mds too.
Signed-off-by: Sage Weil <sage@inktank.com>
The three rules created by build_simple are identical. They are replaced
by a single rule named replicated_rule which is set to be used by the
data, rbd and metadata pools.
Instead of hardcoding the ruleset number to zero, it is read from
osd_pool_default_crush_ruleset which defaults to zero.
The CEPH_DEFAULT_CRUSH_REPLICATED_RULESET enum is moved from osd_type.h to
config.h because it may be needed when osd_type.h is not included.
Signed-off-by: Loic Dachary <loic@dachary.org>
Creating an erasure pool will crash the OSD because OSD::_make_pg
asserts if the type is not replicated. The tests related to erasure
coded pool creation are removed from qa/workunits/cephtool/test.sh.
The osd-create-pool.sh unit test covers the cases removed from test.sh
more extensively. The intent is to check the interactions with the MON
only, therefore it does not run an OSD and the absence of erasure code
placement group backend implementation is not an issue.
Signed-off-by: Loic Dachary <loic@dachary.org>
When osd create pool is called twice on the same pool, it will succeed
because the pool already exists. However, if a different type is
specified, it must fail.
Signed-off-by: Loic Dachary <loic@dachary.org>
It looked like it worked because the wrapper hide the error. The failing
tests are commented out so that the other tests can be used.
Signed-off-by: Loic Dachary <loic@dachary.org>
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>
instead of assuming the pool size is 2, query it and increment it to
test for pool set data size. It allows to run the test from vstart.sh
without knowing what the required pool size is in advance:
rm -fr dev out ; mkdir -p dev ; \
MON=1 OSD=3 ./vstart.sh -n -X -l mon osd
LC_ALL=C PATH=:$PATH CEPH_CONF=ceph.conf \
../qa/workunits/cephtool/test.sh
Signed-off-by: Loic Dachary <loic@dachary.org>
The file removal installed to be triggered when the script stops must
not fail if the file does not exist.
Signed-off-by: Loic Dachary <loic@dachary.org>
We ran into problems before when we made this a string because a mixed
cluster of mons might forward a client request with the wrong schema.
To make this work, we make the new code understand both the new and
old schema, and also backport a change to emperor and dumpling to
handle the new schema.
For the previous attempt to do this, see:
337195f0462fe0d0d97a
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
It's legal to give a CephEntityAddr to osd blacklist with no nonce,
so allow it in the valid() method; also add validation of any nonce
given that it's a long >= 0.
Also fix comment on CephEntityAddr type description in MonCommands.h,
and add tests for invalid nonces (while fixing the existing tests to remove
the () around expect_false args).
Fixes: #6425
Signed-off-by: Dan Mick <dan.mick@inktank.com>
[Also move into a separatate test script; validate result -sage]
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
A monc/mon connection fault or the dup command test flag may mean an extra
osd id is created that we isn't actually up; reorder so that doesn't screw
up 'osd ls'.
Signed-off-by: Sage Weil <sage@inktank.com>
Test case for failure in #5467. Supplying new auth info overwrites.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
We can get random messages to stderror from socket reconnects and such;
discard those if we are looking at stderr in the test.
Signed-off-by: Sage Weil <sage@inktank.com>
'ceph-conf ...' doesn't give you final/default values, only what is in the
conf file. Use -w output to test this instead.
Fixes: #5327
Signed-off-by: Sage Weil <sage@inktank.com>
Check the integer (fixed-point) value to avoid any worries
about floating-point rounding. Add tests for reweight < 0.
Fixes: #3872
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>