diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py index 77cf6aea7..2b1ecdf14 100644 --- a/cinder/backup/manager.py +++ b/cinder/backup/manager.py @@ -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): diff --git a/cinder/tests/unit/test_backup.py b/cinder/tests/unit/test_backup.py index de1453829..ca93747cd 100644 --- a/cinder/tests/unit/test_backup.py +++ b/cinder/tests/unit/test_backup.py @@ -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) diff --git a/releasenotes/notes/bug-1570845-efdb0206718f4ca4.yaml b/releasenotes/notes/bug-1570845-efdb0206718f4ca4.yaml new file mode 100644 index 000000000..b247a8180 --- /dev/null +++ b/releasenotes/notes/bug-1570845-efdb0206718f4ca4.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - The 'backup_service_inithost_offload' configuration + option now defaults to 'True' instead of 'False'.