)]}'
{"nova/api/openstack/compute/services.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"042e7e69c2c301ccc2d0261cb36b67b3e6793f57","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                                                  service.host)"},{"line_number":244,"context_line":"                # remove the corresponding resource provider record from"},{"line_number":245,"context_line":"                # placement for this compute node"},{"line_number":246,"context_line":"                self.placementclient.delete_resource_provider("},{"line_number":247,"context_line":"                    context, service.compute_node, cascade\u003dTrue)"},{"line_number":248,"context_line":"                # remove the host_mapping of this host."},{"line_number":249,"context_line":"                try:"},{"line_number":250,"context_line":"                    hm \u003d objects.HostMapping.get_by_host(context, service.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f769fc5_25c99177","side":"PARENT","line":247,"range":{"start_line":246,"start_character":16,"end_line":247,"end_character":64},"updated":"2018-12-29 03:46:41.000000000","message":"I don\u0027t see how this is related, seems placementclient.detete_resource_provider() uses service uuid as the rp_uuid for filtering, I don\u0027t see how chaning the service hostname or driver will affect this. Also, even if this is somehow the case, we should try to find the correct rp in placement and delete it, otherwise we will be having two orphan RP record.","commit_id":"05d3c01a685de45dd8f98a46bc5c52f6bd08e7cd"},{"author":{"_account_id":2062,"name":"Ralf Haferkamp","email":"rhafer@suse.com","username":"rhafer"},"change_message_id":"fdf6512f6aee17b71488a8f0ef56067217f6e513","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                                                  service.host)"},{"line_number":244,"context_line":"                # remove the corresponding resource provider record from"},{"line_number":245,"context_line":"                # placement for this compute node"},{"line_number":246,"context_line":"                self.placementclient.delete_resource_provider("},{"line_number":247,"context_line":"                    context, service.compute_node, cascade\u003dTrue)"},{"line_number":248,"context_line":"                # remove the host_mapping of this host."},{"line_number":249,"context_line":"                try:"},{"line_number":250,"context_line":"                    hm \u003d objects.HostMapping.get_by_host(context, service.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dfd5e7cf_1903bd44","side":"PARENT","line":247,"range":{"start_line":246,"start_character":16,"end_line":247,"end_character":64},"in_reply_to":"1f769fc5_25c99177","updated":"2019-01-07 15:23:06.000000000","message":"Actually AFAICS placementclient.delete_resource_provider is not using the service uuid as the filter. It\u0027s using the uuid of the compute_node as the rp_uuid. (See: http://git.openstack.org/cgit/openstack/nova/tree/nova/scheduler/client/report.py#n2268) if that compute node object is not existing anymore, there is no chance to lookup any associated resource providers anymore I think.\n\nBut if that compute_node object really got remove due to a change of the hostname then the resource providers should have been cleaned up already here:\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n7770\n\nSo unless I am overlooking something we should be fine here.","commit_id":"05d3c01a685de45dd8f98a46bc5c52f6bd08e7cd"},{"author":{"_account_id":26286,"name":"huanhongda","email":"hongda.xun@easystack.cn","username":"huanhongda"},"change_message_id":"57850aaaaabca43e494e1a68e125e391c7ca74f3","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                                                  service.host)"},{"line_number":244,"context_line":"                # remove the corresponding resource provider record from"},{"line_number":245,"context_line":"                # placement for this compute node"},{"line_number":246,"context_line":"                self.placementclient.delete_resource_provider("},{"line_number":247,"context_line":"                    context, service.compute_node, cascade\u003dTrue)"},{"line_number":248,"context_line":"                # remove the host_mapping of this host."},{"line_number":249,"context_line":"                try:"},{"line_number":250,"context_line":"                    hm \u003d objects.HostMapping.get_by_host(context, service.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_f7a68b0f","side":"PARENT","line":247,"range":{"start_line":246,"start_character":16,"end_line":247,"end_character":64},"in_reply_to":"1f769fc5_25c99177","updated":"2019-02-12 12:45:50.000000000","message":"I found a way to reproduce this bug in all_in_one environment：\n1) Make sure the nova-conductor and nova-compute services are running on the same node.\n2) Delete nova-conductor service.\n    openstack compute service delete \u003cnova-conductor service id\u003e\n3) Delete nova-compute service.\n    openstack compute service delete \u003cnova-compute service id\u003e\n\nWhile deleting nova-compute service at step 3, we will get the error.\n\nThe reason is that when we deleted nova-conductor service, the corresponding ComputeNode record will be deleted too.\nhttps://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n406\n\nAnd then we deleted nova-compute service later, nova can\u0027t get service.compute_node anymore.","commit_id":"05d3c01a685de45dd8f98a46bc5c52f6bd08e7cd"},{"author":{"_account_id":21479,"name":"int32bit","email":"krystism@gmail.com","username":"int32bit"},"change_message_id":"4f6221c514a80da4f2a2298c78fc0d433627c883","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                                                  service.host)"},{"line_number":244,"context_line":"                # remove the corresponding resource provider record from"},{"line_number":245,"context_line":"                # placement for this compute node"},{"line_number":246,"context_line":"                self.placementclient.delete_resource_provider("},{"line_number":247,"context_line":"                    context, service.compute_node, cascade\u003dTrue)"},{"line_number":248,"context_line":"                # remove the host_mapping of this host."},{"line_number":249,"context_line":"                try:"},{"line_number":250,"context_line":"                    hm \u003d objects.HostMapping.get_by_host(context, service.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_d5e16a00","side":"PARENT","line":247,"range":{"start_line":246,"start_character":16,"end_line":247,"end_character":64},"in_reply_to":"1f769fc5_25c99177","updated":"2019-01-12 14:38:50.000000000","message":"This will always fail before call `delete_resource_provider` as `service.compute_node` will try to load object attr by host but in fact not in database. The case is really low frequency but can reproduce. I hit this bug when try to change compute driver from libvirt to ironic.","commit_id":"05d3c01a685de45dd8f98a46bc5c52f6bd08e7cd"}],"nova/tests/unit/api/openstack/compute/test_services.py":[{"author":{"_account_id":26286,"name":"huanhongda","email":"hongda.xun@easystack.cn","username":"huanhongda"},"change_message_id":"ea4abdc9a5a2e467c0777d9ccde957d7218d403c","unresolved":false,"context_lines":[{"line_number":742,"context_line":"                side_effect\u003dexception.HostMappingNotFound(name\u003d\u0027host1\u0027))"},{"line_number":743,"context_line":"    @mock.patch(\u0027nova.objects.Service.destroy\u0027)"},{"line_number":744,"context_line":"    def test_compute_service_delete_compute_node_not_found("},{"line_number":745,"context_line":"            self, service_delete, get_instances, get_hm):"},{"line_number":746,"context_line":"        \"\"\"Tests that we are still able to successfully delete a nova-compute"},{"line_number":747,"context_line":"        service even if the ComputeHost is not found."},{"line_number":748,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_282176fc","line":745,"range":{"start_line":745,"start_character":34,"end_line":745,"end_character":55},"updated":"2019-01-22 12:00:32.000000000","message":"These two mock functions are reversed.","commit_id":"acb59e2bdde5d060795407c8784a7d99536d80ac"}]}
