)]}'
{"nova/scheduler/host_manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ca8714096fc6bebedda25ee3989849ab49e4615","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Update information about a host from a ComputeNode object.\"\"\""},{"line_number":184,"context_line":"        # NOTE(jichenjc): if the compute record is just created but not updated"},{"line_number":185,"context_line":"        # some field such as free_disk_gb can be None"},{"line_number":186,"context_line":"        if compute.updated_at is None:"},{"line_number":187,"context_line":"            return"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        if (self.updated and compute.updated_at"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5201f7_d229d238","line":186,"updated":"2017-01-05 02:48:14.000000000","message":"I\u0027ve been looking at bug 1654102 and bug 1654107 and this doesn\u0027t seem adequate. For example, we still see this failure here because free_disk_gb isn\u0027t set but updated_at is:\n\nhttp://logs.openstack.org/65/416765/1/check/gate-tempest-dsvm-neutron-identity-v3-only-full-ubuntu-xenial-nv/faf1363/logs/screen-n-sch.txt.gz#_2017-01-04_23_18_19_949\n\nThat\u0027s because when we create a new compute node in the resource tracker here:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/compute/resource_tracker.py#L445\n\nwe then shortly after that update it here:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/compute/resource_tracker.py#L451\n\nwhich eventually calls:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/scheduler/client/report.py#L460\n\nwhich calls the DB API here:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/db/sqlalchemy/api.py#L723\n\nwhich always sets the updated_at field even if there are no changes in the compute node record.\n\nSo going back to the resource tracker, we\u0027ve got a new compute node in the database with the updated_at field set but not the free_disk_gb field set, because that happens later here:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/compute/resource_tracker.py#L927\n\nwhich is finally updated in the database when we call _update in the RT here:\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/compute/resource_tracker.py#L610\n\nhttps://github.com/openstack/nova/blob/1bcf3b553ae8665dc6308d1bd11898efb75d3a41/nova/compute/resource_tracker.py#L709\n\nAt that point free_disk_gb is set, but as noted, we could have hit a window where the scheduler pulled the compute node without free_disk_gb being set but updated_at would be set, and we\u0027ll still fail.\n\nSo rather than check updated_at, we should just guard against the thing that breaks us, which is the free_disk_gb not being set yet.","commit_id":"36a0ba9c8141b445f2c6bfc093fde4cc98d229b2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bcbd363762fc47787c260c2e15aa01eec314df5b","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Update information about a host from a ComputeNode object.\"\"\""},{"line_number":184,"context_line":"        # NOTE(jichenjc): if the compute record is just created but not updated"},{"line_number":185,"context_line":"        # some field such as free_disk_gb can be None"},{"line_number":186,"context_line":"        if compute.updated_at is None:"},{"line_number":187,"context_line":"            return"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        if (self.updated and compute.updated_at"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5201f7_15418438","line":186,"in_reply_to":"ba5201f7_d229d238","updated":"2017-01-05 03:14:24.000000000","message":"https://review.openstack.org/#/c/416822/","commit_id":"36a0ba9c8141b445f2c6bfc093fde4cc98d229b2"}],"nova/tests/unit/scheduler/fakes.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"62c9e38db7e8cf174f3764971bb7096d3b0be0e0","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            id\u003d1, local_gb\u003d1024, memory_mb\u003d1024, vcpus\u003d1,"},{"line_number":61,"context_line":"            disk_available_least\u003dNone, free_ram_mb\u003d512, vcpus_used\u003d1,"},{"line_number":62,"context_line":"            free_disk_gb\u003d512, local_gb_used\u003d0,"},{"line_number":63,"context_line":"            updated_at\u003ddatetime.datetime(2015, 11, 11, 11, 0, 0),"},{"line_number":64,"context_line":"            host\u003d\u0027host1\u0027, hypervisor_hostname\u003d\u0027node1\u0027, host_ip\u003d\u0027127.0.0.1\u0027,"},{"line_number":65,"context_line":"            hypervisor_version\u003d0, numa_topology\u003dNone,"},{"line_number":66,"context_line":"            hypervisor_type\u003d\u0027foo\u0027, supported_hv_specs\u003d[],"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_bc3aedcb","line":63,"range":{"start_line":63,"start_character":23,"end_line":63,"end_character":64},"updated":"2016-10-11 12:49:06.000000000","message":"nit: Are we sure there\u0027s not shorter way to do this? A get_dummy_date function in test utils or similar?","commit_id":"36a0ba9c8141b445f2c6bfc093fde4cc98d229b2"}],"nova/tests/unit/scheduler/test_host_manager.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"62c9e38db7e8cf174f3764971bb7096d3b0be0e0","unresolved":false,"context_lines":[{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"        host \u003d host_manager.HostState(\"fakehost\", \"fakenode\")"},{"line_number":1165,"context_line":"        host._update_from_compute_node(compute)"},{"line_number":1166,"context_line":"        # Because compute record not ready, the update of free ram"},{"line_number":1167,"context_line":"        # will not happen and the value will still be 0"},{"line_number":1168,"context_line":"        self.assertEqual(0, host.free_ram_mb)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_5c047114","line":1168,"range":{"start_line":1166,"start_character":0,"end_line":1168,"end_character":45},"updated":"2016-10-11 12:49:06.000000000","message":"nit: I wonder if we should assert of some functions not being called instead?","commit_id":"36a0ba9c8141b445f2c6bfc093fde4cc98d229b2"}]}
