[openstack-nova/f19] Updated patches from f19-patches

Xavier Queralt Mateu xqueralt at fedoraproject.org
Wed Oct 23 10:48:21 UTC 2013


commit afaa1d9a2d9f07981b579f9592a459be72de8675
Author: Xavier Queralt <xqueralt at redhat.com>
Date:   Wed Oct 23 12:26:08 2013 +0200

    Updated patches from f19-patches

 ...-add-conf-for-number-of-conductor-workers.patch |   91 ++++++++++++++++++++
 0004-Fix-IPAddress-and-CIDR-type-decorators.patch  |   54 ++++++++++++
 openstack-nova.spec                                |    6 ++
 3 files changed, 151 insertions(+), 0 deletions(-)
---
diff --git a/0003-add-conf-for-number-of-conductor-workers.patch b/0003-add-conf-for-number-of-conductor-workers.patch
new file mode 100644
index 0000000..b9dd4bf
--- /dev/null
+++ b/0003-add-conf-for-number-of-conductor-workers.patch
@@ -0,0 +1,91 @@
+From ef488a7e3dd6b2b0b48f1aebb5348c538d52e7f9 Mon Sep 17 00:00:00 2001
+From: Peter Feiner <peter at gridcentric.ca>
+Date: Tue, 28 May 2013 11:31:01 -0500
+Subject: [PATCH] add conf for number of conductor workers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes bug #1213080 and implements blueprint condutor-workers.
+
+Make it easy to launch a bunch of conductor processes on a host.
+
+Deploying multiple conductor workers per host avoids serialization on
+database accesses caused by libmysqlclient.so blocking eventlet's
+single thread. In an experiment on a 24-core machine, when creating 20
+VMs in parallel, maximum creation time was reduced by approx. 10s when
+using 20 conductor processes vis-a-vis a single conductor process.
+Profiling showed that all of the savings came from faster calls into
+nova.db.sqlalchemy.api.
+
+Note that there are alternative methods for preventing the eventlet
+thread from blocking during database calls. However, none of these
+alternatives performed as well as multiple nova-conductor processes.
+
+    * Instead of using the native database driver like _mysql.so, you
+      can use a pure-python driver, like pymysql by setting
+      sql_connection=mysql+pymysql://... in the [DEFAULT] section of
+      /etc/nova/nova.conf, which eventlet will monkeypatch to avoid
+      blocking. The problem with this approach is the vastly greater
+      CPU demand of the pure-python driver compared to the native
+      driver. Since the pure-python driver is so much more CPU
+      intensive, the eventlet thread spends most of its time talking to
+      the database, which effectively the problem we had before!
+
+    * Instead of making database calls from eventlet’s thread, you can
+      submit them to eventlet’s pool of worker threads and wait for the
+      results. Try this by setting dbapi_use_tpool=True in the
+      [DEFAULT] section of /etc/nova/nova.conf.  The problem I found
+      with this approach was the overhead of synchronizing with the
+      worker threads. In particular, the time elapsed between the
+      worker thread finishing and the waiting coroutine being resumed
+      was typically several times greater than the duration of the
+      database call itself.
+
+Change-Id: I8698997d211d7617ee14a1c6113056a694d70620
+(cherry picked from commit 5450f09370883799fd835fca725a6fb94efcc97c)
+---
+ bin/nova-conductor        | 2 +-
+ etc/nova/nova.conf.sample | 4 ++++
+ nova/conductor/api.py     | 2 ++
+ 3 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/bin/nova-conductor b/bin/nova-conductor
+index 30d426f..56b9232 100755
+--- a/bin/nova-conductor
++++ b/bin/nova-conductor
+@@ -49,5 +49,5 @@ if __name__ == '__main__':
+     server = service.Service.create(binary='nova-conductor',
+                                     topic=CONF.conductor.topic,
+                                     manager=CONF.conductor.manager)
+-    service.serve(server)
++    service.serve(server, workers=CONF.conductor.workers)
+     service.wait()
+diff --git a/etc/nova/nova.conf.sample b/etc/nova/nova.conf.sample
+index 762576e..866e273 100644
+--- a/etc/nova/nova.conf.sample
++++ b/etc/nova/nova.conf.sample
+@@ -2560,6 +2560,10 @@
+ # full class name for the Manager for conductor (string value)
+ #manager=nova.conductor.manager.ConductorManager
+ 
++# Number of workers for OpenStack Conductor service (integer
++# value)
++#workers=<None>
++
+ 
+ [cells]
+ 
+diff --git a/nova/conductor/api.py b/nova/conductor/api.py
+index d57aec8..60b4442 100644
+--- a/nova/conductor/api.py
++++ b/nova/conductor/api.py
+@@ -33,6 +33,8 @@ conductor_opts = [
+     cfg.StrOpt('manager',
+                default='nova.conductor.manager.ConductorManager',
+                help='full class name for the Manager for conductor'),
++    cfg.IntOpt('workers',
++               help='Number of workers for OpenStack Conductor service')
+ ]
+ conductor_group = cfg.OptGroup(name='conductor',
+                                title='Conductor Options')
diff --git a/0004-Fix-IPAddress-and-CIDR-type-decorators.patch b/0004-Fix-IPAddress-and-CIDR-type-decorators.patch
new file mode 100644
index 0000000..c824542
--- /dev/null
+++ b/0004-Fix-IPAddress-and-CIDR-type-decorators.patch
@@ -0,0 +1,54 @@
+From 341fec8da8a30119031703ac288b2389fbe465d9 Mon Sep 17 00:00:00 2001
+From: Roman Podolyaka <rpodolyaka at mirantis.com>
+Date: Mon, 15 Jul 2013 16:47:14 +0300
+Subject: [PATCH] Fix IPAddress and CIDR type decorators
+
+Use load_dialect_impl() user hook instead of calling
+with_variant() on a type implementation in IPAddress
+and CIDR type decorators. This makes this code work
+with SQLAlchemy 0.8.x versions.
+
+Fixes bug 1200231
+
+Change-Id: Ib0eb582f472116bda817d3e35e26888dc116ad58
+(cherry picked from commit cd382933eb5b6b09f34398cf2c963164bc5b6fc7)
+---
+ nova/db/sqlalchemy/types.py | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/nova/db/sqlalchemy/types.py b/nova/db/sqlalchemy/types.py
+index ef91134..f4ab0ee 100644
+--- a/nova/db/sqlalchemy/types.py
++++ b/nova/db/sqlalchemy/types.py
+@@ -25,7 +25,14 @@ from nova import utils
+ 
+ class IPAddress(types.TypeDecorator):
+     """An SQLAlchemy type representing an IP-address."""
+-    impl = types.String(39).with_variant(postgresql.INET(), 'postgresql')
++
++    impl = types.String
++
++    def load_dialect_impl(self, dialect):
++        if dialect.name == 'postgresql':
++            return dialect.type_descriptor(postgresql.INET())
++        else:
++            return dialect.type_descriptor(types.String(39))
+ 
+     def process_bind_param(self, value, dialect):
+         """Process/Formats the value before insert it into the db."""
+@@ -40,7 +47,14 @@ class IPAddress(types.TypeDecorator):
+ 
+ class CIDR(types.TypeDecorator):
+     """An SQLAlchemy type representing a CIDR definition."""
+-    impl = types.String(43).with_variant(postgresql.INET(), 'postgresql')
++
++    impl = types.String
++
++    def load_dialect_impl(self, dialect):
++        if dialect.name == 'postgresql':
++            return dialect.type_descriptor(postgresql.INET())
++        else:
++            return dialect.type_descriptor(types.String(43))
+ 
+     def process_bind_param(self, value, dialect):
+         """Process/Formats the value before insert it into the db."""
diff --git a/openstack-nova.spec b/openstack-nova.spec
index d7b46af..852e581 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -39,6 +39,8 @@ Source30:         openstack-nova-novncproxy.sysconfig
 #
 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
 Patch0002: 0002-avoid-code-path-causing-qpid-exchange-leaks.patch
+Patch0003: 0003-add-conf-for-number-of-conductor-workers.patch
+Patch0004: 0004-Fix-IPAddress-and-CIDR-type-decorators.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -388,6 +390,8 @@ This package contains documentation files for nova.
 
 %patch0001 -p1
 %patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
@@ -845,6 +849,8 @@ fi
 * Wed Oct 23 2013 Xavier Queralt <xqueralt at redhat.com> - 2013.1.4-1
 - Update to stable/grizzly 2013.1.4 release
 - Require bridge-utils on nova-compute package - rhbz#1009065
+- Allow to set the number of conductor workers - rhbz#1012148
+- Fix compatibility issues with sqlalchemy > 8.1
 
 * Thu Sep 12 2013 Pádraig Brady <pbrady at redhat.com> - 2013.1.3-3
 - Depend on genisoimage to support creating guest config drives


More information about the scm-commits mailing list