From f3643efc80f177adab7527af2cdcc956c2a9be81 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 17 Jun 2016 13:54:59 +0800 Subject: [PATCH] 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 --- qa/workunits/cephtool/test.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index fa77bb35193..49e4bfbe940 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -720,6 +720,19 @@ function mds_exists() ceph auth list | grep "^mds" } +# some of the commands are just not idempotent. +function without_test_dup_command() +{ + if [ -z ${CEPH_CLI_TEST_DUP_COMMAND+x} ]; then + $@ + else + local saved=${CEPH_CLI_TEST_DUP_COMMAND} + unset CEPH_CLI_TEST_DUP_COMMAND + $@ + CEPH_CLI_TEST_DUP_COMMAND=saved + fi +} + function test_mds_tell() { FS_NAME=cephfs @@ -744,7 +757,7 @@ function test_mds_tell() expect_false ceph tell mds.a injectargs mds_max_file_recover -1 # Test respawn by rank - ceph tell mds.0 respawn + without_test_dup_command ceph tell mds.0 respawn new_mds_gids=$old_mds_gids while [ $new_mds_gids -eq $old_mds_gids ] ; do sleep 5 @@ -753,7 +766,7 @@ function test_mds_tell() echo New GIDs: $new_mds_gids # Test respawn by ID - ceph tell mds.a respawn + without_test_dup_command ceph tell mds.a respawn new_mds_gids=$old_mds_gids while [ $new_mds_gids -eq $old_mds_gids ] ; do sleep 5 -- 2.47.3