From 8a8aaeecdedf61269aa0fadcb4a20ae4cb194f91 Mon Sep 17 00:00:00 2001 From: Elena Taivan Date: Wed, 6 Jun 2018 12:03:44 +0000 Subject: [PATCH] Fix poor volume creation performance from glance images Fixed glance uploads on poor write performing systems: give other greenthreads a chance to schedule. Story: 2002893 Task: 22856 Change-Id: I70c192f1c72d8bb1a9f9b7a0fd2545c49c3acb46 Signed-off-by: Jack Ding --- ...ta-Add-glance-schedulre-greenthreads.patch | 32 ++++++++++++++++++ .../centos/meta_patches/PATCH_ORDER | 1 + ...003-Add-glance-schedule-greenthreads.patch | 33 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch create mode 100644 openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch diff --git a/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch b/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch new file mode 100644 index 00000000..5302f7ac --- /dev/null +++ b/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch @@ -0,0 +1,32 @@ +From fc9b9d397b503eeff6585310d8de177b051a11e9 Mon Sep 17 00:00:00 2001 +From: Elena Taivan +Date: Wed, 6 Jun 2018 10:02:56 +0000 +Subject: [PATCH 1/1] meta Add glance schedulre greenthreads + +--- + SPECS/python-glance-store.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/python-glance-store.spec b/SPECS/python-glance-store.spec +index 0c0d728..977b2bc 100644 +--- a/SPECS/python-glance-store.spec ++++ b/SPECS/python-glance-store.spec +@@ -16,6 +16,7 @@ Source0: https://tarballs.openstack.org/%{upstream_name}/%{upstream_name} + # WRS + Patch0001: 0001-Check-ceph-cluster-free-space-before-creating-image.patch + Patch0002: 0002-Add-glance-driver.patch ++Patch0003: 0003-Add-glance-schedule-greenthreads.patch + + BuildArch: noarch + +@@ -90,6 +91,7 @@ Requires: python3-oslo-privsep >= 1.9.0 + # Apply WRS patches + %patch0001 -p1 + %patch0002 -p1 ++%patch0003 -p1 + + %build + %py2_build +-- +1.8.3.1 + diff --git a/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER b/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER index f63468e9..e0858259 100644 --- a/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER +++ b/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER @@ -1,3 +1,4 @@ 0001-Update-package-versioning-for-TIS-format.patch 0002-meta-patch-Check-ceph-cluster-free-space.patch 0003-meta-patch-Glance-Driver.patch +0004-meta-Add-glance-schedulre-greenthreads.patch diff --git a/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch b/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch new file mode 100644 index 00000000..8d443e48 --- /dev/null +++ b/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch @@ -0,0 +1,33 @@ +From 71f9d9555e0909cbc878d8852cd2c2243abd0b1c Mon Sep 17 00:00:00 2001 +From: Elena Taivan +Date: Wed, 6 Jun 2018 09:41:42 +0000 +Subject: [PATCH 1/1] Add glance schedule greenthreads + +--- + glance_store/_drivers/filesystem.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/glance_store/_drivers/filesystem.py b/glance_store/_drivers/filesystem.py +index 5de011d..4a26d10 100644 +--- a/glance_store/_drivers/filesystem.py ++++ b/glance_store/_drivers/filesystem.py +@@ -23,6 +23,7 @@ import hashlib + import logging + import os + import stat ++import time + + import jsonschema + from oslo_config import cfg +@@ -685,6 +686,8 @@ class Store(glance_store.driver.Store): + if verifier: + verifier.update(buf) + f.write(buf) ++ # Give other greenthreads a chance to schedule. ++ time.sleep(0) + except IOError as e: + if e.errno != errno.EACCES: + self._delete_partial(filepath, image_id) +-- +1.8.3.1 +