Commit Graph

336 Commits

Author SHA1 Message Date
Kefu Chai
36bf16d073 Merge pull request #11293 from liewegas/wip-mon-markout
mon: preserve osd weight when marking osd out, then in

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-11-11 22:00:39 +08:00
Kefu Chai
37f3897c55 Merge pull request #11702 from wjwithagen/wip-wjw-freebsd-cephtool-test
qa/workunits/cephtool/test.sh: FreeBSD has no distro.

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-11-10 10:18:23 +08:00
Sage Weil
73a2c11e94 mon/OSDMonitor: remember old weight on 'osd out'
If we have an OSD with a weight that's not 1.0 and mark it out,
we should restore the same weight when we mark it back in. We
already do this when an OSD is automatically marked out, just
not when it is explicitly marked out.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-11-07 11:28:43 -05:00
Willem Jan Withagen
e1993eab6d qa/workunits/cephtool/test.sh: FreeBSD has no distro.
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2016-11-02 14:37:32 +01:00
David Zafman
b4c080b1b4 test.sh: Make check for flags more robust
Low space broke test, saw "flags nearfull,pauserd,pausewr...."

Signed-off-by: David Zafman <dzafman@redhat.com>
2016-10-27 22:42:11 -07:00
Kefu Chai
d2b6b34215 Merge pull request #10916 from jordan41177/fix-17169
mon: OSDMonitor: fix the check error of pg creating

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-10-10 14:39:56 +08:00
DesmondS
179d3d1659 mon: OSDMonitor: fix the check error of pg creating
The variable 'pgs_per_osd' set value from 'new_pgs' divided by 'expected_osds',
and its type is integer. So it would remove the decimal point and get smaller value.
This would have problem in some situations, for exmaple:

The limitation of pg creating for one OSD is '32'.
There have 3 OSDs and I want to increase pgs for a pool.
It should be the limitation for creating new pgs up to '96(32 * 3)' at once.
Now, I create '98' pgs for a pool.

In original code, '98' would be divided by 'expected_osds' and get the floating value '32....'
Because of the type which is integer, the 'pgs_per_osd' would be set to 32.
Then the value won't bigger than the limitation and get the wrong result.

Signed-off-by: DesmondS <desmond.s@inwinstack.com>
Fixes: http://tracker.ceph.com/issues/17169
2016-09-19 17:59:01 +08:00
Willem Jan Withagen
6f0e717e6b qa/workunits/cephtool/test.sh: fix omision of ceph-command
- The script fails with these commands, but not for the correct reason.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2016-09-05 12:04:55 +02:00
xie xingguo
3b160df0aa mon/OSDMonitor: expose require_kraken_osds flag to user
For newly created cluster the CEPH_OSDMAP_REQUIRE_KRAKEN will be
automatically set, while for existing clusters it will not.

This change add "require_jewel_osds" to white list, so user
can access it by the "ceph osd set *" command family.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-08-01 12:24:26 +08:00
Kefu Chai
de68fe38e1 qa/workunits/cephtool/test.sh: use absolute path for TEMP_DIR
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 16:58:28 +08:00
Kefu Chai
7c1b456022 qa/workunits/cephtool/test.sh: s/TMPDIR/TEMP_DIR/
this fixes the test failure of
```
2016-07-12T23:29:40.935
INFO:tasks.workunit.client.0.mira101.stderr:/home/ubuntu/cephtest/workunit.client.0/cephtool/test.sh:
line 153: /CEPH_WATCH_9445: Permission denied
```
see
http://pulpito.ceph.com/kchai-2016-07-12_23:09:35-rados-wip-kefu-testing2---basic-mira/311333/

it's a regression introduced by e5c262b

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-15 16:20:37 +08:00
Kefu Chai
e5c262bfe6 qa/workunits/cephtool/test.sh: use mktemp $TEMP_DIR/XXX instead
mktemp -p is not supported on FreeBSD

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-15 14:21:52 +08:00
Kefu Chai
06195b3476 qa/workunits/cephtool/test.sh: respect $TMPDIR
create temp directory and files in $TMPDIR. the $TMPDIR is hard-wired to
/tmp before this change, we'd better respect the env variable $TMPDIR,
so it would be more consistent, and easier to do the cleanup if any.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-07 12:11:05 +08:00
Kefu Chai
5e16f2379d test: cephtool/test.sh: fix expect_false with pipe
this fixes failures like,

/home/jenkins-build/build/workspace/ceph-pull-requests/qa/workunits/cephtool/test.sh:
line 32: ceph osd blacklist ls | grep 192.168.0.1: command not found

where the failure is not the "failure" we are expecting.

in our tests, following command

expect_false "ceph osd blacklist ls | grep 192.168.0.1"

is designed to to verify that "ceph osd blacklist ls | grep 192.168.0.1"
fails with non-zero return code. but expect_false() evaluates the command
line using plain "$@", which will send the arguments direct to the shell,
and $0 is "ceph auth get client.xx | grep caps | grep mon", which does
not exist and is not built-in command. so we need to check the grep
command instead.

for multiple piped command line, use

expect_false sh <<< "echo foo  | grep bar | grep baz"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-05 15:26:43 +08:00
Samuel Just
c962c72092 Merge pull request #9248 from xiexingguo/xxg-wip-expose-requirejewel
mon: expose require_jewel_osds flag to user

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
2016-06-23 13:03:34 -07:00
Kefu Chai
f3643efc80 qa/workunits/cephtool/test.sh: disable dup test for mds respawn cmd
we set the CEPH_CLI_TEST_DUP_COMMAND enn var to verify the successful
commands are idempotent. but some of them are just not. among the other
things:
- ceph tell mds.a exit
- ceph tell mds.a respawn
the respawn command restart the mds daemon, its bind port changes and
all run-time status are reset. so strictly speaking, even the from the
point of view of client, this command is not idempotent. further more,
it fails the test, if the client sends the 2nd command too soon. because
the monitor might not able to update the re-spawned mds address before
the client asking for the new fsmap. so the cephfs client will just
use the old address of the specified mds, and hence will send the
request to port no one is listening anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-06-17 15:22:26 +08:00
Erwan Velu
2381740542 cephtool/test.sh: Adding iterations numbers in output log
When this test is failing and reach the limits, reading the log doesn't make
obvious that we reach them.

This simple patch adds the iterations numbers inside the output log.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-06-03 14:53:00 +02:00
Samuel Just
542931f69c Merge pull request #9084 from dzafman/wip-dz-misc
Wip dz misc

Reviewed-by: Samuel Just <sjust@redhat.com>
2016-06-01 14:16:32 -07:00
David Zafman
2fb0530a56 test: Fix grouping of mon_cephdf_commands by moving to MON_TESTS
Signed-off-by: David Zafman <dzafman@redhat.com>
2016-05-31 13:07:03 -07:00
Yuri Weinstein
d6b5a4d44f Merge pull request #9222 from xiexingguo/xxg-wip-scrubq-assert
mon: fix assert triggerred by the deprecated "scrubq" state

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2016-05-28 08:50:09 -07:00
Sage Weil
08874ee4d1 Merge pull request #9097 from jcsp/wip-15866
mon: fix 'mon metadata' for lone monitors, and enable listing all metadata at once

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-05-26 14:23:46 -04:00
xie xingguo
83ffc2b761 mon: expose require_jewel_osds flag to user
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-05-24 09:02:19 +08:00
Sage Weil
c46b4cac14 Merge pull request #8840 from tchaikov/wip-opt-u32
common/config: cast OPT_U32 options using uint32_t

Reviewed-by: Sage Weil <sage@redhat.com>
2016-05-20 12:57:53 -04:00
xie xingguo
db9ac7ea7e mon: fix assert triggerred by the deprecated "scrubq" state
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-05-20 21:28:24 +08:00
Samuel Just
ac68c7970b Merge pull request #7163 from tchaikov/wip-pr-6085
mon: use CephOsdName for osd args instead of CephInt

Reviewed-by: Sage Weil <sage@redhat.com>
2016-05-17 11:55:34 -07:00
Kefu Chai
b25ceb02b2 osd,mds: return error if injectargs fails
* test_osd_bench: the injectargs call actually fails due to the spaces
  at the beginning. so remove the spaces in args before sending it to
  injectargs
* update/add some injectargs tests accordingly

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2016-05-17 13:41:50 +08:00
John Spray
325ab8085f mon: enable dump all mds metadata at once
Same as mon and osd, leave out ID to get all.

Signed-off-by: John Spray <john.spray@redhat.com>
2016-05-16 10:56:52 +01:00
John Spray
288e11e7da mon: enable dump all mon metadata at once
Same as we already have for osd metadata, where
if you omit the ID you get all daemons.

Signed-off-by: John Spray <john.spray@redhat.com>
2016-05-16 10:56:52 +01:00
Kefu Chai
100231d611 cephtool/test: both osd.n and n should work as osd args
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-03 22:42:30 +08:00
Sage Weil
84bd0dce18 mon/OSDMonitor: max_osds must be > 0 for reweight-by-*
Include a few test cases.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-04-29 22:01:56 -04:00
Sage Weil
c3b595f284 Merge pull request #7942 from xiexingguo/xxg-wip-fixdirtyinc
mon: OSDMonitor: improve pool creation logic

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Xiaoxi Chen <xiaoxchen@ebay.com>
2016-04-22 20:21:57 -04:00
Kefu Chai
558863ad6d test: set a default $CEPH_ROOT env variable
in cf24535, we use $CEPH_ROOT to specify the $top_srcdir to unify
cmake and autotools, but this breaks ceph-qa-suite/tasks/workunit.py,
as it only clones the necessary qa/workunits directory, and does not
pass $CEPH_ROOT to the test scripts. so we need to set a default
$CEPH_ROOT if it is not set.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-04-19 00:19:07 +08:00
Ali Maredia
cf24535ed7 cmake: cephtool-test-rados/mds/osd passing in cmake
Replaced relative paths in test/cephtool-test-mon.sh,
qa/workunits/cephtool/test.sh, and test/cephtool-test-mon.sh
to work with CEPH_FOO environment variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2016-04-14 20:48:21 -04:00
Greg Farnum
f6209798f8 Merge remote-tracking branch 'github/wip-fs-lockouts' into greg-fs-testing
Protect a number of unstable/experimental features behind durable flags

https://github.com/ceph/ceph/pull/8383

Reviewed-by: John Spray <john.spray@redhat.com>
2016-04-07 17:07:16 -07:00
Greg Farnum
ea1b276e7e test: update tests for new flag requirements
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2016-04-07 16:40:23 -07:00
xie xingguo
be07a418b5 mon: OSDMonitor: add a guard for prepare_remove_snaps()
Method preprocess_remove_snaps() is designed to fast check whether
we can safely handle a remove-snaps-request without changing the osdmap.
The original design is to be able to handle snaps from multiple pools,
including those snaps even from a non-existent pool by simply skipping
over them. However, this method will quit on successfully detecting
any vaild snap which is truly needed to be removed and forward this
request to prepare_remove_snaps() for further processing.

From the above analysis, the prepare_remove_snaps() method will
theoretically also encounter some snaps which possibly belong to
non-existent pools.

This pr solves the above problem by adding a sanity check against
pool existense associated with the specified snap to be removed, which
shall be considered as a defensive move and makes prepare_remove_snaps()
stronger.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-04-07 17:31:58 +08:00
xie xingguo
c98d97e37c mon: OSDMonitor: return EINVAL if we unable to parse addr
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-04-07 17:29:21 +08:00
xie xingguo
fd6c023f49 mon: OSDMonitor: reply ENOENT if specified osd does not exist
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-04-07 17:29:21 +08:00
Erwan Velu
c5fa83f586 tests: Avoiding a fixed 10sec sleep in test_mon_cephdf_commands()
The current code was waiting 10s to expect the file being put.
If the file was put in a shorter time than 10s, the test just waits for
nothing reducing the execution speed of that test.

This patch simply check if the file is actually available every second
during 10sec to exit prematurely.

This patch saves exactly 10 sec on a local system, surely a little bit
less on an infra but still saves time.
Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-04-05 09:36:25 +02:00
Erwan Velu
62bdde2cd2 tests: Optmizing sleep sequence in cephtool/test.sh
The actual code double the wait time between two calls leading to a
possible 511s of waiting time which sounds a little bit excessive.

This patch offer to reduce the global wait time to 300s and test more
often the rados status to exit the loop earlier. In a local test, that
saves 6 secs per run.
Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-04-05 09:36:25 +02:00
Erwan Velu
8a49a86901 tests: Moving sleep call after action in ceph_watch_wait()
ceph_watch_wait() is doing a sleep _before_ doing the test which could
stop this loop.

It's better doing the action first as it could exit immediately and
avoid a useless sleep.

That's a minor optimization but everything count when trying to get
something smooth.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-04-05 09:36:25 +02:00
Erwan Velu
0d254d8916 tests: Reducing sleep time for osd to be up
OSDs are taking some time to be up but waiting 10 secs seems execessive
here between two loops. In the worst case, we can be in a situation of
waiting 10secs for nothing as we are just a few microsecs after the osd
is up.

This patch simply reduce the sleep from 10 to 1 seconds.
Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-04-05 09:36:25 +02:00
Erwan Velu
f47e06b907 tests: Fixing broken test/cephtool-test-mon.sh test
Since the merge of pr #7693, 'ceph command' to get the help is invalid.
As a result, 'test/cephtool-test-mon.sh' test was broken

This patch simply change the 'ceph command' by a 'ceph --help command'

Since this change the test is passing again.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2016-04-04 16:58:58 +02:00
Sage Weil
052fa90eb7 Merge pull request #7062 from wonzhq/scrub-prio-pool
osd: add the support of per pool scrub priority

Reviewed-by: Sage Weil <sage@redhat.com>
2016-03-30 08:24:43 -04:00
Sage Weil
359d8324a3 qa/workunits/cephtool/test.sh: fix cache mode tests
Signed-off-by: Sage Weil <sage@redhat.com>
2016-03-28 16:57:42 -04:00
Sage Weil
6a80e2df8b qa/workunits: remove 'mds setmap' from workunits
Signed-off-by: Sage Weil <sage@redhat.com>
2016-03-15 09:44:19 -04:00
John Spray
22ff1224fd qa: update cephtool test for CephFS multi filesystems
Includes adding test for the enable_multiple flag.

Signed-off-by: John Spray <john.spray@redhat.com>
2016-03-10 11:18:28 +00:00
Sage Weil
2b9775db2c Merge pull request #7890 from liewegas/wip-reweight
mon: osd [test-]reweight-by-{pg,utilization} command updates

Reviewed-by: Samuel Just <sjust@redhat.com>
2016-03-09 14:06:30 -05:00
Sage Weil
661891aa28 mon: remove range=100 from reweight-by-* commands
Specifying the range makes it skip instead of error when you give
it a bad value.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-03-09 13:25:55 -05:00
Sage Weil
3a72d21e30 Merge pull request #7861 from tchaikov/wip-14910
qa/workunits/cephtool/test.sh: wait longer in ceph_watch_start()

Reviewed-by: Sage Weil <sage@redhat.com>
2016-03-07 12:23:46 -05:00