Merge "init_host offload to default to true"

This commit is contained in:
Jenkins 2016-04-21 18:12:22 +00:00 committed by Gerrit Code Review
commit cd03ed0c4d
3 changed files with 13 additions and 4 deletions

View File

@ -61,9 +61,11 @@ backup_manager_opts = [
default='cinder.backup.drivers.swift',
help='Driver to use for backups.',),
cfg.BoolOpt('backup_service_inithost_offload',
default=False,
default=True,
help='Offload pending backup delete during '
'backup service startup.',),
'backup service startup. If false, the backup service '
'will remain down until all pending backups are '
'deleted.',),
]
# This map doesn't need to be extended in the future since it's only
@ -192,7 +194,7 @@ class BackupManager(manager.SchedulerDependentManager):
# from being blocked.
self._add_to_threadpool(self.delete_backup, ctxt, backup)
else:
# By default, delete backups sequentially
# Delete backups sequentially
self.delete_backup(ctxt, backup)
def _detach_all_attachments(self, ctxt, volume):

View File

@ -211,6 +211,8 @@ class BackupTestCase(BaseBackupTest):
def get_admin_context():
return self.ctxt
self.override_config('backup_service_inithost_offload', False)
vol1_id = self._create_volume_db_entry()
self._create_volume_attach(vol1_id)
db.volume_update(self.ctxt, vol1_id, {'status': 'backing-up'})
@ -276,7 +278,6 @@ class BackupTestCase(BaseBackupTest):
def test_init_host_with_service_inithost_offload(self,
mock_add_threadpool,
mock_get_all_by_host):
self.override_config('backup_service_inithost_offload', True)
vol1_id = self._create_volume_db_entry()
db.volume_update(self.ctxt, vol1_id, {'status': 'available'})
backup1 = self._create_backup_db_entry(
@ -410,6 +411,8 @@ class BackupTestCase(BaseBackupTest):
def test_cleanup_one_deleting_backup(self):
"""Test cleanup_one_backup for volume status 'deleting'."""
self.override_config('backup_service_inithost_offload', False)
backup = self._create_backup_db_entry(
status=fields.BackupStatus.DELETING)

View File

@ -0,0 +1,4 @@
---
upgrade:
- The 'backup_service_inithost_offload' configuration
option now defaults to 'True' instead of 'False'.