diff options
author | ramishra <ramishra@redhat.com> | 2021-02-03 09:42:20 +0530 |
---|---|---|
committer | ramishra <ramishra@redhat.com> | 2021-02-03 10:52:09 +0530 |
commit | 79fb6509a9c6ac5438d00d1eb858a4f5b014e6e3 (patch) | |
tree | 81707513c55e47ad09d7132477842d6fdf030e20 | |
parent | 32f9014207d3a3fa1e248d372f9f1d59c876ee1c (diff) | |
download | heat-79fb6509a9c6ac5438d00d1eb858a4f5b014e6e3.tar.gz |
Don't create deployment when changing transport
Earlier when changing software config transport we used to
create a dummy deployment to push the metadata. However
this would not work with convergence as we take
resource lock for the update which updates the config
transport (another engine would try to update the resource
metadata for deployment when one engine has locked it).
Currently it works when updating transport as we ignore
the error in creating dummy deployment, but if there are
any new depoyments for the server they would fail.
We don't need to push the metadata as it would be pushed
when the there is a new/updated deployment.
Few additional changes in the patch:
- We don't need to ignore the error as servers are now
not replaced if the resource is in ERROR when nova server
is good/ACTIVE.
- Delete the existing tempurls and zaqar queues when
changing transport.
Task: 41744
Change-Id: Id592b29df36320d8697bd370252ada02612ba7d0
-rw-r--r-- | heat/engine/resources/server_base.py | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/heat/engine/resources/server_base.py b/heat/engine/resources/server_base.py index fec88f07a..cce356b0b 100644 --- a/heat/engine/resources/server_base.py +++ b/heat/engine/resources/server_base.py @@ -241,29 +241,14 @@ class BaseServer(stack_user.StackUser): if not self.user_data_software_config(): return try: - metadata = self.metadata_get(True) or {} - self._create_transport_credentials(prop_diff) - self._populate_deployments_metadata(metadata, prop_diff) - # push new metadata to all sources by creating a dummy - # deployment - sc = self.rpc_client().create_software_config( - self.context, 'ignored', 'ignored', '') - sd = self.rpc_client().create_software_deployment( - self.context, self.resource_id, sc['id']) - self.rpc_client().delete_software_deployment( - self.context, sd['id']) - self.rpc_client().delete_software_config( - self.context, sc['id']) + self._delete_queue() + self._delete_temp_url() except Exception: - # Updating the software config transport is on a best-effort - # basis as any raised exception here would result in the resource - # going into an ERROR state, which will be replaced on the next - # stack update. This is not desirable for a server. The old - # transport will continue to work, and the new transport may work - # despite exceptions in the above block. - LOG.exception( - 'Error while updating software config transport' - ) + pass + + metadata = self.metadata_get(True) or {} + self._create_transport_credentials(prop_diff) + self._populate_deployments_metadata(metadata, prop_diff) def metadata_update(self, new_metadata=None): """Refresh the metadata if new_metadata is None.""" @@ -300,6 +285,8 @@ class BaseServer(stack_user.StackUser): headers = swift.head_container(container) if int(headers['x-container-object-count']) == 0: swift.delete_container(container) + self.data_delete('metadata_object_name') + self.data_delete('metadata_put_url') def _delete_queue(self): queue_id = self.data().get('metadata_queue_id') |