Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 834750 Details for
Bug 1031801
Starting neutron before running datbase upgrade can hose database
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patchset 3
0001-check-whether-db-needs-to-be-upgraded.patch (text/plain), 10.40 KB, created by
Jakub Libosvar
on 2013-12-10 13:27:11 UTC
(
hide
)
Description:
Patchset 3
Filename:
MIME Type:
Creator:
Jakub Libosvar
Created:
2013-12-10 13:27:11 UTC
Size:
10.40 KB
patch
obsolete
>From 35656f3e779428b05d9f00868e154b2f01877bc4 Mon Sep 17 00:00:00 2001 >From: Lars Kellogg-Stedman <lars@redhat.com> >Date: Mon, 2 Dec 2013 14:00:18 -0500 >Subject: [PATCH] check whether db needs to be upgraded > >If neutron is upgraded from previous release (Grizzly) there >needs to be run db upgrade before services are started. Starting >services without upgrading db may lead into inconsistent behavior. >Neutron service will not start if db is still from previous release >while packages are from current release. > >Resolves: rhbz#1031801 >--- > ...-use-parallel-installed-versions-in-RHEL6.patch | 54 ---------------------- > ...Add-vpnaas-and-debug-filters-to-setup.cfg.patch | 31 ------------- > neutron-db-check | 42 +++++++++++++++++ > neutron-server.init | 5 ++ > neutron-server.upstart | 6 +++ > openstack-neutron.spec | 22 +++++++-- > openstack-neutron.sysconfig | 2 + > 7 files changed, 74 insertions(+), 88 deletions(-) > delete mode 100644 0001-use-parallel-installed-versions-in-RHEL6.patch > delete mode 100644 0002-Add-vpnaas-and-debug-filters-to-setup.cfg.patch > create mode 100755 neutron-db-check > create mode 100644 openstack-neutron.sysconfig > >diff --git a/0001-use-parallel-installed-versions-in-RHEL6.patch b/0001-use-parallel-installed-versions-in-RHEL6.patch >deleted file mode 100644 >index bc84813..0000000 >--- a/0001-use-parallel-installed-versions-in-RHEL6.patch >+++ /dev/null >@@ -1,54 +0,0 @@ >-From e84eeb3e5a9c12aa60f4666a297bb7ca5a0b8791 Mon Sep 17 00:00:00 2001 >-From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com> >-Date: Fri, 13 Apr 2012 17:24:40 +0100 >-Subject: [PATCH] use parallel installed versions in RHEL6 >- >-of webob sqlalchemy python-routes paste-deploy python-jinja2-26 >- >-Change-Id: I290f56eae61c87893639a9e5d29f7fff760452cf >---- >- neutron/__init__.py | 31 +++++++++++++++++++++++++++++++ >- 1 file changed, 31 insertions(+) >- >-diff --git a/neutron/__init__.py b/neutron/__init__.py >-index b2c81bd..fef4d32 100644 >---- a/neutron/__init__.py >-+++ b/neutron/__init__.py >-@@ -15,6 +15,37 @@ >- # License for the specific language governing permissions and limitations >- # under the License. >- >-+import sys >-+import pkg_resources >-+ >-+# If there is a conflicting non egg module, >-+# i.e. an older standard system module installed, >-+# then replace it with this requirement >-+def replace_dist(requirement): >-+ try: >-+ return pkg_resources.require(requirement) >-+ except pkg_resources.VersionConflict: >-+ e = sys.exc_info()[1] >-+ dist=e.args[0] >-+ req=e.args[1] >-+ if dist.key == req.key and not dist.location.endswith('.egg'): >-+ del pkg_resources.working_set.by_key[dist.key] >-+ # We assume there is no need to adjust sys.path >-+ # and the associated pkg_resources.working_set.entries >-+ return pkg_resources.require(requirement) >-+ >-+replace_dist("WebOb >= 1.2") >-+replace_dist("SQLAlchemy >= 0.6.3") >-+replace_dist("Routes >= 1.12.3") >-+replace_dist("Jinja2 >= 2.6") >-+ >-+replace_dist("PasteDeploy >= 1.5.0") >-+# This hack is needed because replace_dist() results in >-+# the standard paste module path being at the start of __path__. >-+# TODO: See can we get pkg_resources to do the right thing directly >-+import paste >-+paste.__path__.insert(0, paste.__path__.pop(-1)) >-+ >- import gettext >- >- >diff --git a/0002-Add-vpnaas-and-debug-filters-to-setup.cfg.patch b/0002-Add-vpnaas-and-debug-filters-to-setup.cfg.patch >deleted file mode 100644 >index 57989d2..0000000 >--- a/0002-Add-vpnaas-and-debug-filters-to-setup.cfg.patch >+++ /dev/null >@@ -1,31 +0,0 @@ >-From a987c4098316947cbe099b64993f9d23cda76e0c Mon Sep 17 00:00:00 2001 >-From: Terry Wilson <twilson@redhat.com> >-Date: Wed, 4 Dec 2013 16:36:30 -0600 >-Subject: [PATCH] Add vpnaas and debug filters to setup.cfg >- >-Change-Id: I44f7e4a44276a386b6e4d8bfb8370eb103787a21 >-Closes-Bug: 1257523 >---- >- setup.cfg | 2 ++ >- 1 file changed, 2 insertions(+) >- >-diff --git a/setup.cfg b/setup.cfg >-index 59cc67a..de9034f 100644 >---- a/setup.cfg >-+++ b/setup.cfg >-@@ -35,6 +35,7 @@ data_files = >- etc/rootwrap.conf >- etc/vpn_agent.ini >- etc/neutron/rootwrap.d = >-+ etc/neutron/rootwrap.d/debug.filters >- etc/neutron/rootwrap.d/dhcp.filters >- etc/neutron/rootwrap.d/iptables-firewall.filters >- etc/neutron/rootwrap.d/l3.filters >-@@ -43,6 +44,7 @@ data_files = >- etc/neutron/rootwrap.d/nec-plugin.filters >- etc/neutron/rootwrap.d/openvswitch-plugin.filters >- etc/neutron/rootwrap.d/ryu-plugin.filters >-+ etc/neutron/rootwrap.d/vpnaas.filters >- etc/init.d = etc/init.d/neutron-server >- etc/neutron/plugins/bigswitch = etc/neutron/plugins/bigswitch/restproxy.ini >- etc/neutron/plugins/brocade = etc/neutron/plugins/brocade/brocade.ini >diff --git a/neutron-db-check b/neutron-db-check >new file mode 100755 >index 0000000..f0032a4 >--- /dev/null >+++ b/neutron-db-check >@@ -0,0 +1,42 @@ >+#!/bin/sh >+# >+# This script checks to make sure the database used by Neutron is at the >+# correct version. If the database is not at $NEUTRON_EXPECTED_DB_VERSION, as >+# set in /etc/sysconfig/openstack-neutron, log an error and exit with an error >+# code. >+# >+# This script is meant to be called from an init script or via ExecPreStart in >+# a systemd unit. >+ >+RETCODE=0 >+ >+[ -f /etc/sysconfig/openstack-neutron ] && . /etc/sysconfig/openstack-neutron >+ >+[ "$NEUTRON_EXPECTED_DB_VERSION" ] || exit 0 >+ >+neutron_db_version=$( >+ neutron-db-manage \ >+ --config-file /etc/neutron/neutron.conf \ >+ --config-file /etc/neutron/plugin.ini current 2>/dev/null | >+ awk '{print $NF}') >+ >+if [ "x$neutron_db_version" = "x" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: unable to find version information for the neutron database. "\ >+ "Check your logs for additional information." >+ RETCODE=1 >+elif [ "x$neutron_db_version" = "xNone" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: neutron database does not have version information. "\ >+ "You must run the \"neutron-db-manage stamp\" command before "\ >+ "starting neutron services." >+ RETCODE=1 >+elif [ "x$neutron_db_version" != "x$NEUTRON_EXPECTED_DB_VERSION" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: you must upgrade the neutron database before starting "\ >+ "neutron services." >+ RETCODE=1 >+fi >+ >+exit $RETCODE >+ >diff --git a/neutron-server.init b/neutron-server.init >index d5ccc9f..7b0f3e6 100644 >--- a/neutron-server.init >+++ b/neutron-server.init >@@ -11,6 +11,7 @@ > > prog=neutron > exec="/usr/bin/$prog-server" >+dbcheck="/usr/bin/$prog-db-check" > configs=( > "/usr/share/$prog/$prog-dist.conf" \ > "/etc/$prog/$prog.conf" \ >@@ -25,6 +26,10 @@ lockfile=/var/lock/subsys/$prog-server > > start() { > [ -x $exec ] || exit 5 >+ >+ # Make sure database is at the currect version. >+ [ -x $dbcheck ] && $dbcheck || exit 6 >+ > for config in ${configs[@]}; do > [ -f $config ] || exit 6 > done >diff --git a/neutron-server.upstart b/neutron-server.upstart >index ec14e41..4cb1b79 100644 >--- a/neutron-server.upstart >+++ b/neutron-server.upstart >@@ -1,5 +1,11 @@ > description "OpenStack Neutron Server" > >+pre-start >+ if ! /usr/bin/neutron-db-check; then >+ stop; exit 0 >+ fi >+end script >+ > start on stopped rc RUNLEVEL=[2345] > stop on runlevel [S016] > >diff --git a/openstack-neutron.spec b/openstack-neutron.spec >index 4590fd7..cdf4a4f 100644 >--- a/openstack-neutron.spec >+++ b/openstack-neutron.spec >@@ -5,7 +5,7 @@ > > Name: openstack-neutron > Version: 2013.2 >-Release: 14%{?dist} >+Release: 15%{?dist} > Provides: openstack-quantum = %{version}-%{release} > Obsoletes: openstack-quantum < 2013.2-0.3.b3 > >@@ -50,6 +50,9 @@ Source41: neutron-vpn-agent.upstart > Source32: neutron-metering-agent.init > Source42: neutron-metering-agent.upstart > >+Source50: neutron-db-check >+Source51: openstack-neutron.sysconfig >+ > Source90: neutron-dist.conf > # > # patches_base=2013.2+2 >@@ -526,6 +529,11 @@ install -p -m 644 %{SOURCE42} %{buildroot}%{_datadir}/neutron/ > # Install dist conf > install -p -D -m 640 %{SOURCE90} %{buildroot}%{_datadir}/neutron/neutron-dist.conf > >+# Install neutron-db-check >+install -m 755 %{SOURCE50} %{buildroot}%{_bindir}/neutron-db-check >+install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig >+install -m 644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/openstack-neutron >+ > # Install version info file > cat > %{buildroot}%{_sysconfdir}/neutron/release <<EOF > [Neutron] >@@ -603,8 +611,10 @@ if [ -e %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM ];then > ln -sf ${plugin_ini//quantum/neutron} %{_sysconfdir}/neutron/plugin.ini > fi > >- # Stamp the existing db as grizzly to avoid neutron-server breaking db migration >- neutron-db-manage --config-file %{_sysconfdir}/neutron/neutron.conf --config-file %{_sysconfdir}/neutron/plugin.ini stamp grizzly || : >+ # Stamp the existing db as grizzly to enable manual database schema >+ # migration after the upgrade. >+ neutron-db-manage --config-file %{_sysconfdir}/neutron/neutron.conf \ >+ --config-file %{_sysconfdir}/neutron/plugin.ini stamp grizzly || : > > # Restore the enablement of the various neutron services > source %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM >@@ -787,6 +797,8 @@ fi > %{_bindir}/neutron-server-setup > %{_bindir}/neutron-usage-audit > >+%{_bindir}/neutron-db-check >+ > %{_initrddir}/neutron-server > %{_initrddir}/neutron-dhcp-agent > %{_initrddir}/neutron-l3-agent >@@ -811,6 +823,7 @@ fi > %config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/policy.json > %config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/neutron.conf > %config(noreplace) %{_sysconfdir}/neutron/rootwrap.conf >+%config %{_sysconfdir}/sysconfig/openstack-neutron > %dir %{_sysconfdir}/neutron/plugins > %config(noreplace) %{_sysconfdir}/logrotate.d/* > %config(noreplace) %{_sysconfdir}/sudoers.d/neutron >@@ -1008,6 +1021,9 @@ fi > > > %changelog >+* Thu Dec 10 2013 Jakub Libosvar <jlibosva@redhat.com> - 2013.2-15 >+- Check whether db needs to be upgraded (rhbz#1031801) >+ > * Mon Dec 9 2013 Terry Wilson <twilson@redhat.com> - 2013.2-14 > - Add vpnaas/fwaas configs to init scripts rhbz#1032450 > - Fix qpid restart/reconnect issues rhbz#1038711 >diff --git a/openstack-neutron.sysconfig b/openstack-neutron.sysconfig >new file mode 100644 >index 0000000..00368b0 >--- /dev/null >+++ b/openstack-neutron.sysconfig >@@ -0,0 +1,2 @@ >+NEUTRON_EXPECTED_DB_VERSION=havana >+ >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1031801
:
832154
|
832459
|
833198
|
834750
|
834845
|
834870