)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":29,"context_line":"  resource providers. Once an RP is in the provider tree, it is not"},{"line_number":30,"context_line":"  removed."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"This functional test documents the current behaviour, with the idea that"},{"line_number":33,"context_line":"it can be updated as this behaviour is fixed."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"[1] http://paste.openstack.org/show/786272/"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1f493fa4_78ce81b4","line":32,"range":{"start_line":32,"start_character":0,"end_line":32,"end_character":54},"updated":"2020-04-28 08:02:46.000000000","message":"well, I don\u0027t see where host2 deletes the CN record since you only deleted it by hand at startup. But maybe it\u0027s me who is confused... More assertions would definitely help to understand the problem.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"}],"nova/tests/functional/regressions/test_bug_1853009.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    # Make sure we\u0027re using the fake driver that has predictable uuids"},{"line_number":31,"context_line":"    # for each node."},{"line_number":32,"context_line":"    compute_driver \u003d \u0027fake.PredictableNodeUUIDDriver\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _assert_hypervisor_api(self, nodename, expected_host):"},{"line_number":35,"context_line":"        # We should have one compute node shown by the API."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_a3d659f0","line":32,"updated":"2020-04-28 08:02:46.000000000","message":"I\u0027d have preferred to have a fake Ironic driver honestly like we have for libvirt but given this is only for a regression test, fair enough.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    # Make sure we\u0027re using the fake driver that has predictable uuids"},{"line_number":31,"context_line":"    # for each node."},{"line_number":32,"context_line":"    compute_driver \u003d \u0027fake.PredictableNodeUUIDDriver\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _assert_hypervisor_api(self, nodename, expected_host):"},{"line_number":35,"context_line":"        # We should have one compute node shown by the API."}],"source_content_type":"text/x-python","patch_set":5,"id":"a7c873b4_146b8b20","line":32,"in_reply_to":"1f493fa4_a3d659f0","updated":"2021-04-28 14:30:49.000000000","message":"That would be a _lot_ more work. We\u0027d need a functioning simulator of ironic, like the one \u0027FakeLibvirtFixture\u0027 provides for libvirt. This isn\u0027t totally specific to Ironic too, fwict - you\u0027d see the same issue on any compute driver that supports multiple nodes per compute service and provides the ability to re-balance these.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.assertEqual(nodename, hypervisor[\u0027hypervisor_hostname\u0027])"},{"line_number":41,"context_line":"        self.assertEqual(expected_host, hypervisor[\u0027service\u0027][\u0027host\u0027])"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def _start_compute(self, host):"},{"line_number":44,"context_line":"        host \u003d self.start_service(\u0027compute\u0027, host)"},{"line_number":45,"context_line":"        # Ironic compute driver has rebalances_nodes \u003d True."},{"line_number":46,"context_line":"        host.manager.driver.rebalances_nodes \u003d True"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_435dd578","line":43,"updated":"2020-04-28 08:02:46.000000000","message":"nit : could be named _start_ironic_compute for fairness given all the other drivers would just get an exception if calling this method. But again, I wouldn\u0027t bikeshed this for a regression test.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.assertEqual(nodename, hypervisor[\u0027hypervisor_hostname\u0027])"},{"line_number":41,"context_line":"        self.assertEqual(expected_host, hypervisor[\u0027service\u0027][\u0027host\u0027])"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def _start_compute(self, host):"},{"line_number":44,"context_line":"        host \u003d self.start_service(\u0027compute\u0027, host)"},{"line_number":45,"context_line":"        # Ironic compute driver has rebalances_nodes \u003d True."},{"line_number":46,"context_line":"        host.manager.driver.rebalances_nodes \u003d True"}],"source_content_type":"text/x-python","patch_set":5,"id":"ebf48920_77dcf89d","line":43,"in_reply_to":"1f493fa4_435dd578","updated":"2021-04-28 14:30:49.000000000","message":"That seems unnecessary given this test is only for ironic. It\u0027s not a base class","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def _start_compute(self, host):"},{"line_number":44,"context_line":"        host \u003d self.start_service(\u0027compute\u0027, host)"},{"line_number":45,"context_line":"        # Ironic compute driver has rebalances_nodes \u003d True."},{"line_number":46,"context_line":"        host.manager.driver.rebalances_nodes \u003d True"},{"line_number":47,"context_line":"        return host"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_2304097b","line":46,"updated":"2020-04-28 08:02:46.000000000","message":"^ if you were having an Ironic fake driver, then you shouldn\u0027t use it, meh.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def _start_compute(self, host):"},{"line_number":44,"context_line":"        host \u003d self.start_service(\u0027compute\u0027, host)"},{"line_number":45,"context_line":"        # Ironic compute driver has rebalances_nodes \u003d True."},{"line_number":46,"context_line":"        host.manager.driver.rebalances_nodes \u003d True"},{"line_number":47,"context_line":"        return host"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9b67d08e_8e7e2994","line":46,"in_reply_to":"1f493fa4_2304097b","updated":"2021-04-28 14:30:49.000000000","message":"As above.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        # Simulate a service running and then stopping."},{"line_number":55,"context_line":"        # host2 runs, creates fake-node, then is stopped. The fake-node compute"},{"line_number":56,"context_line":"        # node is destroyed. This leaves a soft-deleted node in the DB."},{"line_number":57,"context_line":"        host2 \u003d self._start_compute(\u0027host2\u0027)"},{"line_number":58,"context_line":"        host2.manager.driver._set_nodes([nodename])"},{"line_number":59,"context_line":"        host2.manager.update_available_resource(ctxt)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_23d529ba","line":56,"range":{"start_line":56,"start_character":29,"end_line":56,"end_character":71},"updated":"2020-04-28 08:02:46.000000000","message":"you should assert this, in case we change this behaviour.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Simulate a service running and then stopping."},{"line_number":55,"context_line":"        # host2 runs, creates fake-node, then is stopped. The fake-node compute"},{"line_number":56,"context_line":"        # node is destroyed. This leaves a soft-deleted node in the DB."},{"line_number":57,"context_line":"        host2 \u003d self._start_compute(\u0027host2\u0027)"},{"line_number":58,"context_line":"        host2.manager.driver._set_nodes([nodename])"},{"line_number":59,"context_line":"        host2.manager.update_available_resource(ctxt)"},{"line_number":60,"context_line":"        host2.stop()"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_b553f46a","line":57,"range":{"start_line":57,"start_character":36,"end_line":57,"end_character":43},"updated":"2020-04-28 08:02:46.000000000","message":"nit : well, in general we create first a host1 compute before a host2 one, but meh ;)","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Simulate a service running and then stopping."},{"line_number":55,"context_line":"        # host2 runs, creates fake-node, then is stopped. The fake-node compute"},{"line_number":56,"context_line":"        # node is destroyed. This leaves a soft-deleted node in the DB."},{"line_number":57,"context_line":"        host2 \u003d self._start_compute(\u0027host2\u0027)"},{"line_number":58,"context_line":"        host2.manager.driver._set_nodes([nodename])"},{"line_number":59,"context_line":"        host2.manager.update_available_resource(ctxt)"},{"line_number":60,"context_line":"        host2.stop()"}],"source_content_type":"text/x-python","patch_set":5,"id":"d8d1ba0a_fc0f1d36","line":57,"range":{"start_line":57,"start_character":36,"end_line":57,"end_character":43},"in_reply_to":"1f493fa4_b553f46a","updated":"2021-04-28 14:30:49.000000000","message":"Done","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # host2 runs, creates fake-node, then is stopped. The fake-node compute"},{"line_number":56,"context_line":"        # node is destroyed. This leaves a soft-deleted node in the DB."},{"line_number":57,"context_line":"        host2 \u003d self._start_compute(\u0027host2\u0027)"},{"line_number":58,"context_line":"        host2.manager.driver._set_nodes([nodename])"},{"line_number":59,"context_line":"        host2.manager.update_available_resource(ctxt)"},{"line_number":60,"context_line":"        host2.stop()"},{"line_number":61,"context_line":"        cn \u003d objects.ComputeNode.get_by_host_and_nodename("}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_95ceb82a","line":58,"updated":"2020-04-28 08:02:46.000000000","message":"you could have moved this call to _start_compute() since you define this method here for only Ironic.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # host2 runs, creates fake-node, then is stopped. The fake-node compute"},{"line_number":56,"context_line":"        # node is destroyed. This leaves a soft-deleted node in the DB."},{"line_number":57,"context_line":"        host2 \u003d self._start_compute(\u0027host2\u0027)"},{"line_number":58,"context_line":"        host2.manager.driver._set_nodes([nodename])"},{"line_number":59,"context_line":"        host2.manager.update_available_resource(ctxt)"},{"line_number":60,"context_line":"        host2.stop()"},{"line_number":61,"context_line":"        cn \u003d objects.ComputeNode.get_by_host_and_nodename("}],"source_content_type":"text/x-python","patch_set":5,"id":"ff66c325_203584e4","line":58,"in_reply_to":"1f493fa4_95ceb82a","updated":"2021-04-28 14:30:49.000000000","message":"I think this one actually warrants being kept separate since it makes things very explicit. We could rename \u0027_start_compute\u0027 to \u0027_start_compute_and_set_nodes\u0027 but that\u0027s rather wordy 😉","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        cn.destroy()"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_node_rebalance_deleted_compute_node_race(self):"},{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_157e28ae","line":66,"range":{"start_line":66,"start_character":8,"end_line":66,"end_character":30},"updated":"2020-04-28 08:02:46.000000000","message":"since the problem is because both hosts have the same nodename, I think this variable should be global (either as a class attribute or defined by setUp as a class object).","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        cn.destroy()"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_node_rebalance_deleted_compute_node_race(self):"},{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."}],"source_content_type":"text/x-python","patch_set":5,"id":"ca73fff3_dd39bcbe","line":66,"range":{"start_line":66,"start_character":8,"end_line":66,"end_character":30},"in_reply_to":"1f493fa4_157e28ae","updated":"2021-04-28 14:30:49.000000000","message":"Agreed. Done.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_node_rebalance_deleted_compute_node_race(self):"},{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_d5604004","line":67,"updated":"2020-04-28 08:02:46.000000000","message":"no need to create twice a fake context, just create it once in setUp and make it a class attribute.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_node_rebalance_deleted_compute_node_race(self):"},{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"}],"source_content_type":"text/x-python","patch_set":5,"id":"377bdf79_517d32c5","line":67,"in_reply_to":"1f493fa4_d5604004","updated":"2021-04-28 14:30:49.000000000","message":"Done","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"},{"line_number":71,"context_line":"        # to delete that and inject our fake node into the driver which will"},{"line_number":72,"context_line":"        # be re-balanced to another host later."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_3537e401","line":69,"range":{"start_line":69,"start_character":10,"end_line":69,"end_character":63},"updated":"2020-04-28 08:02:46.000000000","message":"I\u0027m unclear, since setUp() ran *before*, technically you already created host2 before this one. Is it OK ?","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        nodename \u003d \u0027fake-node\u0027"},{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"},{"line_number":71,"context_line":"        # to delete that and inject our fake node into the driver which will"},{"line_number":72,"context_line":"        # be re-balanced to another host later."}],"source_content_type":"text/x-python","patch_set":5,"id":"3ccb0eaa_6f4874e7","line":69,"range":{"start_line":69,"start_character":10,"end_line":69,"end_character":63},"in_reply_to":"1f493fa4_3537e401","updated":"2021-04-28 14:30:49.000000000","message":"Yes, the wording of this was weird. Fixed.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"},{"line_number":71,"context_line":"        # to delete that and inject our fake node into the driver which will"},{"line_number":72,"context_line":"        # be re-balanced to another host later."},{"line_number":73,"context_line":"        host1 \u003d self._start_compute(\u0027host1\u0027)"},{"line_number":74,"context_line":"        host1.manager.driver._set_nodes([nodename])"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_953878ee","line":71,"range":{"start_line":70,"start_character":71,"end_line":71,"end_character":24},"updated":"2020-04-28 08:02:46.000000000","message":"I don\u0027t see where you delete the host1 ComputeNode record ?","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # First we create a compute service to manage our node."},{"line_number":70,"context_line":"        # When start_service runs, it will create a host1 ComputeNode. We want"},{"line_number":71,"context_line":"        # to delete that and inject our fake node into the driver which will"},{"line_number":72,"context_line":"        # be re-balanced to another host later."},{"line_number":73,"context_line":"        host1 \u003d self._start_compute(\u0027host1\u0027)"},{"line_number":74,"context_line":"        host1.manager.driver._set_nodes([nodename])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5c8550fa_625acec0","line":71,"range":{"start_line":70,"start_character":71,"end_line":71,"end_character":24},"in_reply_to":"1f493fa4_953878ee","updated":"2021-04-28 14:30:49.000000000","message":"This is done via the call to \u0027update_available_resource\u0027 [1]. I\u0027ll add a log check.\n\n[1] https://github.com/openstack/nova/blob/eba9d596daa91d8f702b719afb88cb89f2d5bb32/nova/compute/manager.py#L9914","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        host1.manager.driver._set_nodes([nodename])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        # Run the update_available_resource periodic to register fake-node and"},{"line_number":77,"context_line":"        # have it managed by host1. This will also detect the \"host1\" node as"},{"line_number":78,"context_line":"        # orphaned and delete it along with its resource provider."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # host1[1]: Finds no compute record in RT. Tries to create one"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_95119860","line":77,"range":{"start_line":77,"start_character":51,"end_line":77,"end_character":74},"updated":"2020-04-28 08:02:46.000000000","message":"it will detect host2 node rather, nope?","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        host1.manager.driver._set_nodes([nodename])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        # Run the update_available_resource periodic to register fake-node and"},{"line_number":77,"context_line":"        # have it managed by host1. This will also detect the \"host1\" node as"},{"line_number":78,"context_line":"        # orphaned and delete it along with its resource provider."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # host1[1]: Finds no compute record in RT. Tries to create one"}],"source_content_type":"text/x-python","patch_set":5,"id":"47b8a842_21abead2","line":77,"range":{"start_line":77,"start_character":51,"end_line":77,"end_character":74},"in_reply_to":"1f493fa4_95119860","updated":"2021-04-28 14:30:49.000000000","message":"Nope. That\u0027s already gone since we stopped the service in \u0027setUp\u0027 above. What we\u0027re doing here is updating host1\u0027s compute node to manage a single node, $nodename, instead of the \u0027host1\u0027 node it\u0027s currently managing. This is necessary because \u0027FakeDriver.init_host\u0027 [1] is called with \u0027host\u003dhost1\u0027 at [2], because $CONF.host was set to \u0027host1\u0027 at [3] which was run when we called \u0027start_service\u0027 above.\n\n[1] https://github.com/openstack/nova/blob/eba9d596daa91d8f702b719afb88cb89f2d5bb32/nova/virt/fake.py#L158-L163\n[2] https://github.com/openstack/nova/blob/eba9d596daa91d8f702b719afb88cb89f2d5bb32/nova/compute/manager.py#L1413\n[3] https://github.com/openstack/nova/blob/eba9d596daa91d8f702b719afb88cb89f2d5bb32/nova/test.py#L411","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # host1[1]: Finds no compute record in RT. Tries to create one"},{"line_number":81,"context_line":"        # (_init_compute_node)."},{"line_number":82,"context_line":"        # FIXME(mgoddard): This shows a traceback with SQL rollback due to"},{"line_number":83,"context_line":"        # soft-deleted node. The create seems to succeed but breaks the RT"},{"line_number":84,"context_line":"        # update for this node. See"},{"line_number":85,"context_line":"        # https://bugs.launchpad.net/nova/+bug/1853159."},{"line_number":86,"context_line":"        host1.manager.update_available_resource(ctxt)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_58290588","line":83,"range":{"start_line":82,"start_character":27,"end_line":83,"end_character":27},"updated":"2020-04-28 08:02:46.000000000","message":"could you please assert this raised exception ? I don\u0027t see the evidence below","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        # https://bugs.launchpad.net/nova/+bug/1853159."},{"line_number":86,"context_line":"        host1.manager.update_available_resource(ctxt)"},{"line_number":87,"context_line":"        self._assert_hypervisor_api(nodename, \u0027host1\u0027)"},{"line_number":88,"context_line":"        # There should only be one resource provider (fake-node)."},{"line_number":89,"context_line":"        original_rps \u003d self._get_all_providers()"},{"line_number":90,"context_line":"        self.assertEqual(1, len(original_rps), original_rps)"},{"line_number":91,"context_line":"        self.assertEqual(nodename, original_rps[0][\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_1833fdf7","line":88,"updated":"2020-04-28 08:02:46.000000000","message":"because you deleted host2 ComputeNode record before, right?","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        # https://bugs.launchpad.net/nova/+bug/1853159."},{"line_number":86,"context_line":"        host1.manager.update_available_resource(ctxt)"},{"line_number":87,"context_line":"        self._assert_hypervisor_api(nodename, \u0027host1\u0027)"},{"line_number":88,"context_line":"        # There should only be one resource provider (fake-node)."},{"line_number":89,"context_line":"        original_rps \u003d self._get_all_providers()"},{"line_number":90,"context_line":"        self.assertEqual(1, len(original_rps), original_rps)"},{"line_number":91,"context_line":"        self.assertEqual(nodename, original_rps[0][\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"6eb89b83_b37335dc","line":88,"in_reply_to":"1f493fa4_1833fdf7","updated":"2021-04-28 14:30:49.000000000","message":"Yup","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        # There should only be one resource provider (fake-node)."},{"line_number":89,"context_line":"        original_rps \u003d self._get_all_providers()"},{"line_number":90,"context_line":"        self.assertEqual(1, len(original_rps), original_rps)"},{"line_number":91,"context_line":"        self.assertEqual(nodename, original_rps[0][\u0027name\u0027])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        # Simulate a re-balance by starting host2 and make it manage fake-node."},{"line_number":94,"context_line":"        # At this point both host1 and host2 think they own fake-node."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_38535919","line":91,"updated":"2020-04-28 08:02:46.000000000","message":"you could assert the hostname too to make sure you got the (host1, fake-node) ComputeNode record.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        # There should only be one resource provider (fake-node)."},{"line_number":89,"context_line":"        original_rps \u003d self._get_all_providers()"},{"line_number":90,"context_line":"        self.assertEqual(1, len(original_rps), original_rps)"},{"line_number":91,"context_line":"        self.assertEqual(nodename, original_rps[0][\u0027name\u0027])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        # Simulate a re-balance by starting host2 and make it manage fake-node."},{"line_number":94,"context_line":"        # At this point both host1 and host2 think they own fake-node."}],"source_content_type":"text/x-python","patch_set":5,"id":"14c47ad8_79ae44fc","line":91,"in_reply_to":"1f493fa4_38535919","updated":"2021-04-28 14:30:49.000000000","message":"I added a check for logs","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        self._assert_hypervisor_api(nodename, \u0027host1\u0027)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        # Complete rebalance, as host2 realises it does not own fake-node."},{"line_number":120,"context_line":"        host2.manager.driver._set_nodes([])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # host2[2]: Deletes orphan compute node."},{"line_number":123,"context_line":"        # Mock out the compute node query to simulate a race condition where"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_f85d7115","line":120,"updated":"2020-04-28 08:02:46.000000000","message":"you lost me, why do you need to specify which nodes host2 would have to manage now ?","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        self._assert_hypervisor_api(nodename, \u0027host1\u0027)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        # Complete rebalance, as host2 realises it does not own fake-node."},{"line_number":120,"context_line":"        host2.manager.driver._set_nodes([])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # host2[2]: Deletes orphan compute node."},{"line_number":123,"context_line":"        # Mock out the compute node query to simulate a race condition where"}],"source_content_type":"text/x-python","patch_set":5,"id":"23024d01_0c9069d3","line":120,"in_reply_to":"1f493fa4_f85d7115","updated":"2021-04-28 14:30:49.000000000","message":"This is mimicking re-balancing of compute nodes. In reality, the ironic virt driver would be doing this, but since we\u0027re not doing so we need to do it manually.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8c89abb2ffc5be1bb0f5fa64d5944ceb91f022fa","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # Complete rebalance, as host2 realises it does not own fake-node."},{"line_number":120,"context_line":"        host2.manager.driver._set_nodes([])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # host2[2]: Deletes orphan compute node."},{"line_number":123,"context_line":"        # Mock out the compute node query to simulate a race condition where"},{"line_number":124,"context_line":"        # the list includes an orphan compute node that is taken ownership of"},{"line_number":125,"context_line":"        # by host1 by the time host2 deletes it."}],"source_content_type":"text/x-python","patch_set":5,"id":"1f493fa4_b8ac89ed","line":122,"updated":"2020-04-28 08:02:46.000000000","message":"I don\u0027t see where you delete it. You just mock its existence.","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6914b06b10016322f40c1649537cd81b5df11c92","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # Complete rebalance, as host2 realises it does not own fake-node."},{"line_number":120,"context_line":"        host2.manager.driver._set_nodes([])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # host2[2]: Deletes orphan compute node."},{"line_number":123,"context_line":"        # Mock out the compute node query to simulate a race condition where"},{"line_number":124,"context_line":"        # the list includes an orphan compute node that is taken ownership of"},{"line_number":125,"context_line":"        # by host1 by the time host2 deletes it."}],"source_content_type":"text/x-python","patch_set":5,"id":"f46dab62_83f84602","line":122,"in_reply_to":"1f493fa4_b8ac89ed","updated":"2021-04-28 14:30:49.000000000","message":"As above, this delete is happening in \u0027update_available_resource\u0027 [1]. Log check below points to that\n\n[1] [1] https://github.com/openstack/nova/blob/eba9d596daa91d8f702b719afb88cb89f2d5bb32/nova/compute/manager.py#L9914","commit_id":"600162e7102e102001a348b0f2d429b856d898f4"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b0fcdb893e53c2fc423c26ccd6981d11b3e4c56f","unresolved":true,"context_lines":[{"line_number":92,"context_line":"        host_b.manager.update_available_resource(self.ctxt)"},{"line_number":93,"context_line":"        self.assertIn("},{"line_number":94,"context_line":"            \u0027Deleting orphan compute node %s hypervisor host \u0027"},{"line_number":95,"context_line":"            \u0027is host_b, nodes are\u0027 % cn.id,"},{"line_number":96,"context_line":"            self.stdlog.logger.output)"},{"line_number":97,"context_line":"        self._assert_hypervisor_api(self.nodename, expected_host\u003d\u0027host_b\u0027)"},{"line_number":98,"context_line":"        # There should only be one resource provider (fake-node)."}],"source_content_type":"text/x-python","patch_set":9,"id":"da78c1c6_b9197ff7","line":95,"range":{"start_line":95,"start_character":37,"end_line":95,"end_character":42},"updated":"2021-06-14 23:38:31.000000000","message":"I think the problem is that this cn.id is from the \u0027host_a\u0027 compute node on L65 when this needs it to be referring to the \u0027host_b\u0027 compute node.","commit_id":"d69967d271ba6bbb0c53a37a03ef8cb72a8c9a94"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5557260ccf5907e0470a8d453186fb52873da335","unresolved":true,"context_lines":[{"line_number":92,"context_line":"        host_b.manager.update_available_resource(self.ctxt)"},{"line_number":93,"context_line":"        self.assertIn("},{"line_number":94,"context_line":"            \u0027Deleting orphan compute node %s hypervisor host \u0027"},{"line_number":95,"context_line":"            \u0027is host_b, nodes are\u0027 % cn.id,"},{"line_number":96,"context_line":"            self.stdlog.logger.output)"},{"line_number":97,"context_line":"        self._assert_hypervisor_api(self.nodename, expected_host\u003d\u0027host_b\u0027)"},{"line_number":98,"context_line":"        # There should only be one resource provider (fake-node)."}],"source_content_type":"text/x-python","patch_set":9,"id":"917819e5_9f1ebc23","line":95,"range":{"start_line":95,"start_character":37,"end_line":95,"end_character":42},"in_reply_to":"9dba5cd7_c9a4fb9b","updated":"2021-07-07 21:27:00.000000000","message":"Finally figured out what was wrong and it was indeed the fact that cn.id refers to host_a:fake-node and it needs to refer to host_b:host_b for this assertion. The first time I tried this I used host_b:fake-node which also isn\u0027t correct -- it\u0027s host_b:host_b that gets deleted (four compute nodes get created in all: host_a:host_a, host_a:fake-node, host_b:host_b, host_b:fake-node).\n\nI\u0027ve adjusted it in PS11.","commit_id":"d69967d271ba6bbb0c53a37a03ef8cb72a8c9a94"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c5ae99217d7cde6943319847721ef45bff162294","unresolved":true,"context_lines":[{"line_number":92,"context_line":"        host_b.manager.update_available_resource(self.ctxt)"},{"line_number":93,"context_line":"        self.assertIn("},{"line_number":94,"context_line":"            \u0027Deleting orphan compute node %s hypervisor host \u0027"},{"line_number":95,"context_line":"            \u0027is host_b, nodes are\u0027 % cn.id,"},{"line_number":96,"context_line":"            self.stdlog.logger.output)"},{"line_number":97,"context_line":"        self._assert_hypervisor_api(self.nodename, expected_host\u003d\u0027host_b\u0027)"},{"line_number":98,"context_line":"        # There should only be one resource provider (fake-node)."}],"source_content_type":"text/x-python","patch_set":9,"id":"9dba5cd7_c9a4fb9b","line":95,"range":{"start_line":95,"start_character":37,"end_line":95,"end_character":42},"in_reply_to":"da78c1c6_b9197ff7","updated":"2021-06-15 00:43:23.000000000","message":"\u003e I think the problem is that this cn.id is from the \u0027host_a\u0027 compute node on L65 when this needs it to be referring to the \u0027host_b\u0027 compute node.\n\nI tried this ^ and it didn\u0027t help, still looking.","commit_id":"d69967d271ba6bbb0c53a37a03ef8cb72a8c9a94"}]}
