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 834845 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 4
0001-check-whether-db-needs-to-be-upgraded.patch (text/plain), 6.57 KB, created by
Jakub Libosvar
on 2013-12-10 16:11:34 UTC
(
hide
)
Description:
Patchset 4
Filename:
MIME Type:
Creator:
Jakub Libosvar
Created:
2013-12-10 16:11:34 UTC
Size:
6.57 KB
patch
obsolete
>From 3a4ee90361a85264e64c1f23f8d497de33115688 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 >--- > neutron-db-check | 42 ++++++++++++++++++++++++++++++++++++++++++ > neutron-server.init | 5 +++++ > neutron-server.upstart | 6 ++++++ > openstack-neutron.spec | 22 +++++++++++++++++++--- > openstack-neutron.sysconfig | 2 ++ > 5 files changed, 74 insertions(+), 3 deletions(-) > create mode 100755 neutron-db-check > create mode 100644 openstack-neutron.sysconfig > >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