From 1af4ed0a76c898c971f47274fb0dd224a4c7b1cc Mon Sep 17 00:00:00 2001 From: Yin Congmin Date: Wed, 10 Jun 2020 14:52:08 +0800 Subject: [PATCH] librbd/image: fix immutable object cache read failed bug when daemon down Fix bug: read child image failed when enabling immutable object cache and daemon down Signed-off-by: Yin Congmin --- .../pool/ceph_and_immutable_object_cache.yaml | 7 ++++--- .../qemu_on_immutable_object_cache_and_thrash.yaml | 4 ++-- qa/tasks/immutable_object_cache.py | 7 ------- qa/tasks/immutable_object_cache_thrash.py | 7 ------- src/librbd/image/OpenRequest.cc | 2 -- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/qa/suites/rbd/immutable-object-cache/pool/ceph_and_immutable_object_cache.yaml b/qa/suites/rbd/immutable-object-cache/pool/ceph_and_immutable_object_cache.yaml index 540e33d0647..e977c1ba6f2 100644 --- a/qa/suites/rbd/immutable-object-cache/pool/ceph_and_immutable_object_cache.yaml +++ b/qa/suites/rbd/immutable-object-cache/pool/ceph_and_immutable_object_cache.yaml @@ -4,8 +4,9 @@ tasks: - ceph: conf: client: - rbd_parent_cache_enabled: true - immutable object cache path: /tmp/ceph-immutable-object-cache - immutable object cache max size: 10G + rbd parent cache enabled: true + rbd plugins: parent_cache + immutable_object_cache_path: /tmp/ceph-immutable-object-cache + immutable_object_cache_max_size: 10G - immutable_object_cache: client.0: diff --git a/qa/suites/rbd/immutable-object-cache/workloads/qemu_on_immutable_object_cache_and_thrash.yaml b/qa/suites/rbd/immutable-object-cache/workloads/qemu_on_immutable_object_cache_and_thrash.yaml index 30cb9f0a16a..33a5cf0b175 100644 --- a/qa/suites/rbd/immutable-object-cache/workloads/qemu_on_immutable_object_cache_and_thrash.yaml +++ b/qa/suites/rbd/immutable-object-cache/workloads/qemu_on_immutable_object_cache_and_thrash.yaml @@ -1,11 +1,11 @@ +tasks: - qemu: client.0: clone: true test: qa/run_xfstests_qemu.sh - image_url: http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-amd64.img + type: block cpus: 4 memory: 4096 disks: 3 -tasks: - immutable_object_cache_thrash: client.0: diff --git a/qa/tasks/immutable_object_cache.py b/qa/tasks/immutable_object_cache.py index 9bbb5659d44..0635c970290 100644 --- a/qa/tasks/immutable_object_cache.py +++ b/qa/tasks/immutable_object_cache.py @@ -1,19 +1,12 @@ """ immutable object cache task """ -from io import StringIO - import contextlib import logging -import os -import yaml -import time from teuthology import misc as teuthology from teuthology import contextutil -from tasks import rbd from teuthology.orchestra import run -from teuthology.config import config as teuth_config log = logging.getLogger(__name__) diff --git a/qa/tasks/immutable_object_cache_thrash.py b/qa/tasks/immutable_object_cache_thrash.py index 46d2ca6ea09..0bf3ad3a040 100644 --- a/qa/tasks/immutable_object_cache_thrash.py +++ b/qa/tasks/immutable_object_cache_thrash.py @@ -1,19 +1,12 @@ """ immutable object cache thrash task """ -from io import StringIO - import contextlib import logging -import os -import yaml -import time from teuthology import misc as teuthology from teuthology import contextutil -from tasks import rbd from teuthology.orchestra import run -from teuthology.config import config as teuth_config DEFAULT_KILL_DAEMON_TIME = 2 DEFAULT_DEAD_TIME = 30 diff --git a/src/librbd/image/OpenRequest.cc b/src/librbd/image/OpenRequest.cc index 9f03857770f..ccca85ff476 100644 --- a/src/librbd/image/OpenRequest.cc +++ b/src/librbd/image/OpenRequest.cc @@ -544,8 +544,6 @@ Context* OpenRequest::handle_init_plugin_registry(int *result) { if (*result < 0) { lderr(cct) << "failed to initialize plugin registry: " << cpp_strerror(*result) << dendl; - send_close_image(*result); - return nullptr; } return send_init_cache(result); -- 2.39.5