]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: s/ceph_osd_mkfs/command_check_call/
authorShangzhong Zhu <zhu.shangzhong@zte.com.cn>
Wed, 19 Jul 2017 14:53:49 +0000 (22:53 +0800)
committerZhu Shangzhong <zhu.shangzhong@zte.com.cn>
Mon, 24 Jul 2017 15:10:36 +0000 (23:10 +0800)
Fixes: http://tracker.ceph.com/issues/20685
Signed-off-by: Zhu Shangzhong <zhu.shangzhong@zte.com.cn>
src/ceph-disk/ceph_disk/main.py
src/ceph-disk/tests/ceph-disk.sh

index ae5267d38a007c885256a8e5a0f5fc38b73b9ae7..d2db4f49e78c78ca47f65d020aa87aa2b5c691ba 100755 (executable)
@@ -3110,36 +3110,6 @@ class PrepareBluestoreData(PrepareData):
         write_one_line(path, 'type', 'bluestore')
 
 
-#
-# Temporary workaround: if ceph-osd --mkfs does not
-# complete within 5 minutes, assume it is blocked
-# because of http://tracker.ceph.com/issues/13522
-# and retry a few times.
-#
-# Remove this function calls with command_check_call
-# when http://tracker.ceph.com/issues/13522 is fixed
-#
-def ceph_osd_mkfs(arguments):
-    timeout = _get_command_executable(['timeout'])
-    mkfs_ok = False
-    error = 'unknown error'
-    for delay in os.environ.get('CEPH_OSD_MKFS_DELAYS',
-                                '300 300 300 300 300').split():
-        try:
-            _check_output(timeout + [delay] + arguments)
-            mkfs_ok = True
-            break
-        except subprocess.CalledProcessError as e:
-            error = e.output
-            if e.returncode == 124:  # timeout fired, retry
-                LOG.debug('%s timed out : %s (retry)'
-                          % (str(arguments), error))
-            else:
-                break
-    if not mkfs_ok:
-        raise Error('%s failed : %s' % (str(arguments), error))
-
-
 def mkfs(
     path,
     cluster,
@@ -3161,7 +3131,7 @@ def mkfs(
     osd_type = read_one_line(path, 'type')
 
     if osd_type == 'bluestore':
-        ceph_osd_mkfs(
+        command_check_call(
             [
                 'ceph-osd',
                 '--cluster', cluster,
@@ -3175,7 +3145,7 @@ def mkfs(
             ],
         )
     elif osd_type == 'filestore':
-        ceph_osd_mkfs(
+        command_check_call(
             [
                 'ceph-osd',
                 '--cluster', cluster,
index f96a9e06d08110442c523c7d99092b8b188f1ca3..54d6017879e9b3fed8f2d424d66b11efa225daa9 100755 (executable)
@@ -382,33 +382,6 @@ function test_keyring_path() {
     grep --quiet "keyring $dir/bootstrap-osd/ceph.keyring" $dir/test_keyring || return 1
 }
 
-# http://tracker.ceph.com/issues/13522
-function ceph_osd_fail_once_fixture() {
-    local dir=$1
-    local command=ceph-osd
-    local fpath=`readlink -f $(which $command)`
-    [ "$fpath" = `readlink -f $CEPH_BIN/$command` ] || [ "$fpath" = `readlink -f $(pwd)/$command` ] || return 1
-
-    cat > $dir/$command <<EOF
-#!/bin/bash
-if echo "\$@" | grep -e --mkfs && ! test -f $dir/used-$command ; then
-   touch $dir/used-$command
-   # sleep longer than the first CEPH_OSD_MKFS_DELAYS value (5) below
-   sleep 600
-else
-   exec $CEPH_BIN/$command "\$@"
-fi
-EOF
-    chmod +x $dir/$command
-}
-
-function test_ceph_osd_mkfs() {
-    local dir=$1
-    ceph_osd_fail_once_fixture $dir || return 1
-    CEPH_OSD_MKFS_DELAYS='5 300 300' use_path $dir test_activate_dir || return 1
-    [ -f $dir/used-ceph-osd ] || return 1
-}
-
 function test_crush_device_class() {
     local dir=$1
     shift
@@ -489,7 +462,6 @@ function run() {
     default_actions+="test_zap "
     [ `uname` != FreeBSD ] && \
       default_actions+="test_activate_dir_bluestore "
-    default_actions+="test_ceph_osd_mkfs "
     default_actions+="test_crush_device_class "
     default_actions+="test_reuse_osd_id "
     local actions=${@:-$default_actions}