Skip to content

Commit

Permalink
Don't sync database by default
Browse files Browse the repository at this point in the history
https://review.openstack.org/#/c/76358 introduced a new sync_db
parameter and set it to true by default.  Unfortunately there
seem to be many cases where this causes problems.  One is when
using the OVS plugin with the [database] section stored in
neutron.conf rather than in the ovs_neutron_plugin.ini file.
In such cases the migration will error out with due to being
unable to connect.  This is particularly problematic for users
in that no changes to the composition layer are necessary to
hit the error since sync_db is set to true by default: to avoid
the problem they need to make composition layer change to explicitly
set it to false.  This patch resolves the problem by setting the
parameter to false by default rather than true.  This enables
users who want the migration to run to do so without impacting
users who haven't been expecting the new behavior.

Change-Id: Id8c116212132b6d75ae14019fc6a65447f226c6d
Closes-Bug: #1288975
  • Loading branch information
Mark T. Voelker committed Mar 6, 2014
1 parent efb77ec commit 0229d35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions manifests/server.pp
Expand Up @@ -103,7 +103,7 @@
#
# [*sync_db*]
# (optional) Run neutron-db-manage on api nodes after installing the package.
# Defaults to true
# Defaults to false
#
# [*api_workers*]
# (optional) Number of separate worker processes to spawn.
Expand Down Expand Up @@ -145,7 +145,7 @@
$database_max_retries = 10,
$database_idle_timeout = 3600,
$database_retry_interval = 10,
$sync_db = true,
$sync_db = false,
$api_workers = '0',
$agent_down_time = '9',
$report_interval = '4',
Expand Down
22 changes: 11 additions & 11 deletions spec/classes/neutron_server_spec.rb
Expand Up @@ -23,7 +23,7 @@
:database_max_retries => '10',
:database_idle_timeout => '3600',
:database_retry_interval => '10',
:sync_db => true,
:sync_db => false,
:api_workers => '0',
:agent_down_time => '9',
:report_interval => '4',
Expand Down Expand Up @@ -75,13 +75,7 @@
:ensure => 'running',
:require => 'Class[Neutron]'
)
should contain_exec('neutron-db-sync').with(
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
:path => '/usr/bin',
:before => 'Service[neutron-server]',
:require => 'Neutron_config[database/connection]',
:refreshonly => true
)
should_not contain_exec('neutron-db-sync')
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with(
:ensure => 'absent'
)
Expand Down Expand Up @@ -146,11 +140,17 @@
shared_examples_for 'a neutron server without database synchronization' do
before do
params.merge!(
:sync_db => false
:sync_db => true
)
end
it 'should not exec neutron-db-sync' do
should_not contain_exec('neutron-db-sync')
it 'should exec neutron-db-sync' do
should contain_exec('neutron-db-sync').with(
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
:path => '/usr/bin',
:before => 'Service[neutron-server]',
:require => 'Neutron_config[database/connection]',
:refreshonly => true
)
end
end

Expand Down

0 comments on commit 0229d35

Please sign in to comment.