)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"906d787380a2dd48b0e0f3d1da6b102fcde657ba","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: Add heal_instance_mappings command"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"TODO: functional tests and a release note"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This provides a \"nova-manage cell_v2 heal_instance_mappings\""},{"line_number":12,"context_line":"command based on the script provided by Mohammed Naser in"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ffb9cba7_31776005","line":9,"updated":"2019-04-26 13:58:27.000000000","message":"And CLI docs.","commit_id":"fe5d35a71f51fb4caf584d71254c54e8cf62c96e"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"133bfc1326bf3834c0006ff70e67000863e9c4d4","unresolved":false,"context_lines":[{"line_number":245,"context_line":"    Specify ``--instance`` to heal a specific instance given its UUID."},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    Specify ``--verbose`` to execute with verbose output."},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    Return codes:"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    0. All instance mappings have a cell mapping already or were healed."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3fa7e38b_60bde000","line":248,"updated":"2019-09-24 19:15:10.000000000","message":"Include --purge.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"133bfc1326bf3834c0006ff70e67000863e9c4d4","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    Specify ``--verbose`` to execute with verbose output."},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    Return codes:"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    0. All instance mappings have a cell mapping already or were healed."},{"line_number":252,"context_line":"    1. If an instance UUID was specified but no InstanceMapping was found for"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3fa7e38b_c0c4d493","line":249,"updated":"2019-09-24 19:15:10.000000000","message":"Use the table format here that are in other commands.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"}],"nova/cmd/manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1f86a370417c5a2098fc39f9594ffe9f3485f73b","unresolved":false,"context_lines":[{"line_number":1372,"context_line":"                        inst_mapping.save()"},{"line_number":1373,"context_line":"                        output(\u0027Mapped instance %s to cell: %s\u0027 %"},{"line_number":1374,"context_line":"                               (instance_uuid, cell.identity))"},{"line_number":1375,"context_line":"                        healed_count +\u003d 0"},{"line_number":1376,"context_line":"                        break  # stop iterating the cells for this instance"},{"line_number":1377,"context_line":"                    except exception.InstanceNotFound:"},{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."}],"source_content_type":"text/x-python","patch_set":1,"id":"ffb9cba7_51a77450","line":1375,"range":{"start_line":1375,"start_character":40,"end_line":1375,"end_character":41},"updated":"2019-04-26 14:08:52.000000000","message":"1","commit_id":"fe5d35a71f51fb4caf584d71254c54e8cf62c96e"},{"author":{"_account_id":1004,"name":"Mohammed Naser","email":"mnaser@vexxhost.com","username":"mnaser"},"change_message_id":"6349c9522e76c8b8b027e5a769dd9605bbfca8fe","unresolved":false,"context_lines":[{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1379,"context_line":"                        continue"},{"line_number":1380,"context_line":"            else:"},{"line_number":1381,"context_line":"                # We did not find the instance in any cell."},{"line_number":1382,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1383,"context_line":"                not_found_count +\u003d 1"},{"line_number":1384,"context_line":""},{"line_number":1385,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1386,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_1c5590c6","line":1383,"range":{"start_line":1381,"start_character":0,"end_line":1383,"end_character":36},"updated":"2019-04-26 16:55:29.000000000","message":"Why don\u0027t we just delete the instance_mapping at that point instead? It\u0027s an orphan and it has absolutely no purpose?","commit_id":"e79b50a61f41708ab1cc03187b860ca6f2b98344"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3c80b5b1e2a6ae311739d95d00129a1bca8b2718","unresolved":false,"context_lines":[{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1379,"context_line":"                        continue"},{"line_number":1380,"context_line":"            else:"},{"line_number":1381,"context_line":"                # We did not find the instance in any cell."},{"line_number":1382,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1383,"context_line":"                not_found_count +\u003d 1"},{"line_number":1384,"context_line":""},{"line_number":1385,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1386,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_755e5877","line":1383,"range":{"start_line":1381,"start_character":0,"end_line":1383,"end_character":36},"in_reply_to":"9fb8cfa7_afd5611d","updated":"2019-06-19 21:55:30.000000000","message":"https://review.opendev.org/#/c/666438/","commit_id":"e79b50a61f41708ab1cc03187b860ca6f2b98344"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2fc0839e22c4d6d08a5c69f0328357b65587f5be","unresolved":false,"context_lines":[{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1379,"context_line":"                        continue"},{"line_number":1380,"context_line":"            else:"},{"line_number":1381,"context_line":"                # We did not find the instance in any cell."},{"line_number":1382,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1383,"context_line":"                not_found_count +\u003d 1"},{"line_number":1384,"context_line":""},{"line_number":1385,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1386,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_afd5611d","line":1383,"range":{"start_line":1381,"start_character":0,"end_line":1383,"end_character":36},"in_reply_to":"bfb3d3c7_721573e4","updated":"2019-06-19 20:18:08.000000000","message":"I\u0027m reminded of something I found while looking at https://review.opendev.org/#/c/575556/ which is if we get here https://github.com/openstack/nova/blob/74aebe0d4e5a978a40011e890aee9e70e98246c4/nova/conductor/manager.py#L1350 the build request is gone and we don\u0027t create the instance in any cell, not even cell0 (because the user deleted the instance via the build request doppleganger), but we don\u0027t delete the instance mapping so it\u0027s effectively orphaned. Because we didn\u0027t create the instance in a cell that also means the archive_deleted_rows code here:\n\nhttps://github.com/openstack/nova/blob/74aebe0d4e5a978a40011e890aee9e70e98246c4/nova/cmd/manage.py#L563\n\nwon\u0027t clean up the instance mapping either.","commit_id":"e79b50a61f41708ab1cc03187b860ca6f2b98344"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8d325e29ed32fc228202cefcbea3665b3a6ac41","unresolved":false,"context_lines":[{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1379,"context_line":"                        continue"},{"line_number":1380,"context_line":"            else:"},{"line_number":1381,"context_line":"                # We did not find the instance in any cell."},{"line_number":1382,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1383,"context_line":"                not_found_count +\u003d 1"},{"line_number":1384,"context_line":""},{"line_number":1385,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1386,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_97b87976","line":1383,"range":{"start_line":1381,"start_character":0,"end_line":1383,"end_character":36},"in_reply_to":"ffb9cba7_1c5590c6","updated":"2019-04-26 18:31:27.000000000","message":"I get nervous about deleting stuff without an opt-in from the user. We could follow up with an option to purge these, not sure what it would be called, maybe just --purge or --purge-orphans or something.","commit_id":"e79b50a61f41708ab1cc03187b860ca6f2b98344"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"814c7bd8a9a079da999d1a18426a1d768c63f236","unresolved":false,"context_lines":[{"line_number":1378,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1379,"context_line":"                        continue"},{"line_number":1380,"context_line":"            else:"},{"line_number":1381,"context_line":"                # We did not find the instance in any cell."},{"line_number":1382,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1383,"context_line":"                not_found_count +\u003d 1"},{"line_number":1384,"context_line":""},{"line_number":1385,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1386,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_721573e4","line":1383,"range":{"start_line":1381,"start_character":0,"end_line":1383,"end_character":36},"in_reply_to":"ffb9cba7_97b87976","updated":"2019-05-30 13:21:49.000000000","message":"I\u0027ve added a TODO to add a --purge option which can be added in a follow up since this is already a non-trivial amount of code to review.","commit_id":"e79b50a61f41708ab1cc03187b860ca6f2b98344"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"75709cf444e7a77f14bbdbd06e4e6b2d41948704","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                 \u0027instance mappings without a cell mapping are processed.\u0027))"},{"line_number":1290,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":1291,"context_line":"          help\u003d_(\u0027Provide verbose output during execution.\u0027))"},{"line_number":1292,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse):"},{"line_number":1293,"context_line":"        def output(message):"},{"line_number":1294,"context_line":"            if verbose:"},{"line_number":1295,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_5036b0b6","line":1292,"updated":"2019-06-20 19:01:06.000000000","message":"It kinda sucks to have to have yet another command for this, when we could make verify_instance do more of this, and iterate if no specific instance is specified.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1b33b2ce28d1fdf92fca6202f6f343227e04894","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                 \u0027instance mappings without a cell mapping are processed.\u0027))"},{"line_number":1290,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":1291,"context_line":"          help\u003d_(\u0027Provide verbose output during execution.\u0027))"},{"line_number":1292,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse):"},{"line_number":1293,"context_line":"        def output(message):"},{"line_number":1294,"context_line":"            if verbose:"},{"line_number":1295,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_e0b5507f","line":1292,"in_reply_to":"3fa7e38b_6f28a885","updated":"2019-09-24 19:46:30.000000000","message":"I think for now I\u0027m just going to keep them separate for separation of duties / sanity purposes. There is a spot in the verify_instance command that we check the instance mapping to see if it has a cell mapping and if not we return code 2. I\u0027m going to update that message to indicate that if the problem persists you should run this command. I think in the future we could add a --heal option to verify_instance and just make that case call this method, similar to what we do with archive + purge.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"63d2b8ce4f8e9aaccc0be17c775e74ef935fae24","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                 \u0027instance mappings without a cell mapping are processed.\u0027))"},{"line_number":1290,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":1291,"context_line":"          help\u003d_(\u0027Provide verbose output during execution.\u0027))"},{"line_number":1292,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse):"},{"line_number":1293,"context_line":"        def output(message):"},{"line_number":1294,"context_line":"            if verbose:"},{"line_number":1295,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_6f28a885","line":1292,"in_reply_to":"3fa7e38b_d972ca49","updated":"2019-09-20 16:54:59.000000000","message":"I dunno, I can just imagine an operator looking at the help output and not understanding why we have several commands that all seem really similar. I like the names \"verify_instance\" and \"verify_instances\" better than this one too.\n\nAnyway, don\u0027t let me stop you, I\u0027m just complaining at this all becoming a mess.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abea9113adf39d170c404240978005c998f69bac","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                 \u0027instance mappings without a cell mapping are processed.\u0027))"},{"line_number":1290,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":1291,"context_line":"          help\u003d_(\u0027Provide verbose output during execution.\u0027))"},{"line_number":1292,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse):"},{"line_number":1293,"context_line":"        def output(message):"},{"line_number":1294,"context_line":"            if verbose:"},{"line_number":1295,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_d972ca49","line":1292,"in_reply_to":"9fb8cfa7_5036b0b6","updated":"2019-09-20 16:38:40.000000000","message":"True, I didn\u0027t think about that. The problem with that is verify_instance requires an instance uuid right now, so we\u0027d have to change the arg to an option which might get weird. Alternatively you could add a \"verify_instances\" command with an optional uuid and deprecate \"verify_instance\" in favor of the new one - but that seems like a gross option.\n\nI think ideally whatever command we have is something we\u0027d like to make backportable since this is a problem going back to ocata. I\u0027m not saying we\u0027d backport it upstream, or at least not past Queens, but I could see people wanting this that are running older clouds.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"75709cf444e7a77f14bbdbd06e4e6b2d41948704","unresolved":false,"context_lines":[{"line_number":1322,"context_line":"            output(\u0027Looking up instance mappings with no cell mapping.\u0027)"},{"line_number":1323,"context_line":"            inst_mappings \u003d objects.InstanceMappingList.get_unmapped(ctxt)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"        output(\u0027Found %s instance mappings with no cell mapping.\u0027 %"},{"line_number":1326,"context_line":"               len(inst_mappings))"},{"line_number":1327,"context_line":"        # If everything has a cell mapping we\u0027re done."},{"line_number":1328,"context_line":"        if not inst_mappings:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_d0494032","line":1325,"range":{"start_line":1325,"start_character":22,"end_line":1325,"end_character":24},"updated":"2019-06-20 19:01:06.000000000","message":"Why all the %s for integers? I mean, it works, but..","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1b33b2ce28d1fdf92fca6202f6f343227e04894","unresolved":false,"context_lines":[{"line_number":1322,"context_line":"            output(\u0027Looking up instance mappings with no cell mapping.\u0027)"},{"line_number":1323,"context_line":"            inst_mappings \u003d objects.InstanceMappingList.get_unmapped(ctxt)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"        output(\u0027Found %s instance mappings with no cell mapping.\u0027 %"},{"line_number":1326,"context_line":"               len(inst_mappings))"},{"line_number":1327,"context_line":"        # If everything has a cell mapping we\u0027re done."},{"line_number":1328,"context_line":"        if not inst_mappings:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_2007e8cc","line":1325,"range":{"start_line":1325,"start_character":22,"end_line":1325,"end_character":24},"in_reply_to":"3fa7e38b_b9da6e14","updated":"2019-09-24 19:46:30.000000000","message":"Done","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abea9113adf39d170c404240978005c998f69bac","unresolved":false,"context_lines":[{"line_number":1322,"context_line":"            output(\u0027Looking up instance mappings with no cell mapping.\u0027)"},{"line_number":1323,"context_line":"            inst_mappings \u003d objects.InstanceMappingList.get_unmapped(ctxt)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"        output(\u0027Found %s instance mappings with no cell mapping.\u0027 %"},{"line_number":1326,"context_line":"               len(inst_mappings))"},{"line_number":1327,"context_line":"        # If everything has a cell mapping we\u0027re done."},{"line_number":1328,"context_line":"        if not inst_mappings:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_b9da6e14","line":1325,"range":{"start_line":1325,"start_character":22,"end_line":1325,"end_character":24},"in_reply_to":"9fb8cfa7_d0494032","updated":"2019-09-20 16:38:40.000000000","message":"Shrug, I can change it.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abea9113adf39d170c404240978005c998f69bac","unresolved":false,"context_lines":[{"line_number":1348,"context_line":"            try:"},{"line_number":1349,"context_line":"                objects.BuildRequest.get_by_instance_uuid(ctxt, instance_uuid)"},{"line_number":1350,"context_line":"                # Just ignore this instance since there is a build request."},{"line_number":1351,"context_line":"                output(\u0027Build request found for instance %s; assuming the \u0027"},{"line_number":1352,"context_line":"                       \u0027instance is not yet scheduled to a cell. Skipping.\u0027 %"},{"line_number":1353,"context_line":"                       instance_uuid)"},{"line_number":1354,"context_line":"                continue"},{"line_number":1355,"context_line":"            except exception.BuildRequestNotFound:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_f96c6637","line":1352,"range":{"start_line":1351,"start_character":61,"end_line":1352,"end_character":53},"updated":"2019-09-20 16:38:40.000000000","message":"Should we include the vm/task_state from the build request instance in this message? Might be useful for debug.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1b33b2ce28d1fdf92fca6202f6f343227e04894","unresolved":false,"context_lines":[{"line_number":1348,"context_line":"            try:"},{"line_number":1349,"context_line":"                objects.BuildRequest.get_by_instance_uuid(ctxt, instance_uuid)"},{"line_number":1350,"context_line":"                # Just ignore this instance since there is a build request."},{"line_number":1351,"context_line":"                output(\u0027Build request found for instance %s; assuming the \u0027"},{"line_number":1352,"context_line":"                       \u0027instance is not yet scheduled to a cell. Skipping.\u0027 %"},{"line_number":1353,"context_line":"                       instance_uuid)"},{"line_number":1354,"context_line":"                continue"},{"line_number":1355,"context_line":"            except exception.BuildRequestNotFound:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_207b68f5","line":1352,"range":{"start_line":1351,"start_character":61,"end_line":1352,"end_character":53},"in_reply_to":"3fa7e38b_f96c6637","updated":"2019-09-24 19:46:30.000000000","message":"Meh, a build request is pretty short lived and means the thing is building/scheduling so not likely anything interesting from including those values.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"75709cf444e7a77f14bbdbd06e4e6b2d41948704","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"                        output(\u0027Mapped instance %s to cell: %s\u0027 %"},{"line_number":1372,"context_line":"                               (instance_uuid, cell.identity))"},{"line_number":1373,"context_line":"                        healed_count +\u003d 1"},{"line_number":1374,"context_line":"                        break  # stop iterating the cells for this instance"},{"line_number":1375,"context_line":"                    except exception.InstanceNotFound:"},{"line_number":1376,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1377,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_700734cb","line":1374,"updated":"2019-06-20 19:01:06.000000000","message":"And if it\u0027s in multiple cells somehow? Why not use scatter/gather for this so that we can easily check to see if we got back multiple results? We could probably also more efficiently query multiple cells for multiple mappings at once that way. Maybe the efficiency thing isn\u0027t a huge deal because we *expect* few orphaned records at any given point, I dunno.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abea9113adf39d170c404240978005c998f69bac","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"                        output(\u0027Mapped instance %s to cell: %s\u0027 %"},{"line_number":1372,"context_line":"                               (instance_uuid, cell.identity))"},{"line_number":1373,"context_line":"                        healed_count +\u003d 1"},{"line_number":1374,"context_line":"                        break  # stop iterating the cells for this instance"},{"line_number":1375,"context_line":"                    except exception.InstanceNotFound:"},{"line_number":1376,"context_line":"                        # The instance is not in this cell so keep going."},{"line_number":1377,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_791ab67d","line":1374,"in_reply_to":"9fb8cfa7_700734cb","updated":"2019-09-20 16:38:40.000000000","message":"\u003e And if it\u0027s in multiple cells somehow? Why not use scatter/gather\n \u003e for this so that we can easily check to see if we got back multiple\n \u003e results?\n\nI guess I didn\u0027t consider that the instance could be in multiple cells somehow, but it\u0027s probably worth doing something like that since if it happened we\u0027d really want some kind of message for it. I was thinking if somehow cross-cell resize failed you could have a copy of the instance in multiple cells but you can\u0027t even trigger cross-cell resize without having a valid instance mapping pointing at a cell so I don\u0027t think a cross-cell resize failure would get this far.\n\n \u003e We could probably also more efficiently query multiple\n \u003e cells for multiple mappings at once that way. Maybe the efficiency\n \u003e thing isn\u0027t a huge deal because we *expect* few orphaned records at\n \u003e any given point, I dunno.\n\nI\u0027m less concerned about efficiency here since it\u0027s not something we should see a lot of. If operators run this command and routinely find a lot of instance mappings that they have to heal then that\u0027s indicative of a much larger problem and we need to root that out, i.e. have the operators complain about it, report a bug, etc.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"75709cf444e7a77f14bbdbd06e4e6b2d41948704","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                # TODO(mriedem): Add a --purge option to delete orphans."},{"line_number":1380,"context_line":"                # We did not find the instance in any cell."},{"line_number":1381,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1382,"context_line":"                not_found_count +\u003d 1"},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1385,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_1027d866","line":1382,"updated":"2019-06-20 19:01:06.000000000","message":"So, we list the instance uuids that need to be cleaned up (which is actually the point of this command, or at least mnaser\u0027s use) in a not easy to parse form? Seems like adding --purge would be pretty important to make this useful.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"63d2b8ce4f8e9aaccc0be17c775e74ef935fae24","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                # TODO(mriedem): Add a --purge option to delete orphans."},{"line_number":1380,"context_line":"                # We did not find the instance in any cell."},{"line_number":1381,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1382,"context_line":"                not_found_count +\u003d 1"},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1385,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_3414434e","line":1382,"in_reply_to":"3fa7e38b_340f63e2","updated":"2019-09-20 16:54:59.000000000","message":"I dunno, I can see running this without --purge and getting some human-readable messages with an error code, and then going back and re-running with --purge. Either way, but it seems like 90% of the people are going to want --purge.","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1b33b2ce28d1fdf92fca6202f6f343227e04894","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                # TODO(mriedem): Add a --purge option to delete orphans."},{"line_number":1380,"context_line":"                # We did not find the instance in any cell."},{"line_number":1381,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1382,"context_line":"                not_found_count +\u003d 1"},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1385,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_a02998e6","line":1382,"in_reply_to":"3fa7e38b_3414434e","updated":"2019-09-24 19:46:30.000000000","message":"Done","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abea9113adf39d170c404240978005c998f69bac","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                # TODO(mriedem): Add a --purge option to delete orphans."},{"line_number":1380,"context_line":"                # We did not find the instance in any cell."},{"line_number":1381,"context_line":"                output(\u0027Instance %s not found in any cell.\u0027 % instance_uuid)"},{"line_number":1382,"context_line":"                not_found_count +\u003d 1"},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"        # If we were unable to find an instance report it as an error."},{"line_number":1385,"context_line":"        if not_found_count:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_340f63e2","line":1382,"in_reply_to":"9fb8cfa7_1027d866","updated":"2019-09-20 16:38:40.000000000","message":"I can add the --purge option. I definitely want people to opt in to that though, i.e. make it an option rather than just doing it.\n\nIf --purge isn\u0027t specified, would you want to see something else dumped that\u0027s a bit more machine friendly? Like keep track of the instance uuids that are orphans and then dump those at the end in a kind of summary output?","commit_id":"2d6b5e0ce391fdd6ecca612ac75f8ec54426e2c2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6164104070158d583d555dba5e23e9a2422aeb72","unresolved":false,"context_lines":[{"line_number":1381,"context_line":"    @args(\u0027--purge\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027purge\u0027, default\u003dFalse,"},{"line_number":1382,"context_line":"          help\u003d_(\u0027Delete instance mapping records for instances that are not \u0027"},{"line_number":1383,"context_line":"                 \u0027found in any cell.\u0027))"},{"line_number":1384,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse, purge\u003dFalse):"},{"line_number":1385,"context_line":"        def output(message):"},{"line_number":1386,"context_line":"            if verbose:"},{"line_number":1387,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_3c66b757","line":1384,"updated":"2019-11-06 17:16:25.000000000","message":"This is basically like map_instances() but that it optionally takes a single instance right? And looks at cells instead of you having to provide one? Maybe we should just augment the existing one?","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"21f86a536fbfdeb37817a630553a49147a88162f","unresolved":false,"context_lines":[{"line_number":1381,"context_line":"    @args(\u0027--purge\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027purge\u0027, default\u003dFalse,"},{"line_number":1382,"context_line":"          help\u003d_(\u0027Delete instance mapping records for instances that are not \u0027"},{"line_number":1383,"context_line":"                 \u0027found in any cell.\u0027))"},{"line_number":1384,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse, purge\u003dFalse):"},{"line_number":1385,"context_line":"        def output(message):"},{"line_number":1386,"context_line":"            if verbose:"},{"line_number":1387,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_5f24c560","line":1384,"in_reply_to":"3fa7e38b_3c66b757","updated":"2019-11-06 18:02:29.000000000","message":"You brought something like this up before [1] but for verify_instance rather than map_instances.\n\nThere are overlaps, but it\u0027s not all the same, and I haven\u0027t spent the time to try and figure out if this would be better munged into verify_instance or map_instances and how that would work and if it would be better with one of those or standalone. I think if we did munge it in, I\u0027d still basically have this method but private and just called out from whatever existing method is used to call it as an option. I don\u0027t know how clean that is though, or how much duplication we\u0027d still have if done that way.\n\n[1] https://review.opendev.org/#/c/655908/4/nova/cmd/manage.py@1292","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":1381,"context_line":"    @args(\u0027--purge\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027purge\u0027, default\u003dFalse,"},{"line_number":1382,"context_line":"          help\u003d_(\u0027Delete instance mapping records for instances that are not \u0027"},{"line_number":1383,"context_line":"                 \u0027found in any cell.\u0027))"},{"line_number":1384,"context_line":"    def heal_instance_mappings(self, uuid\u003dNone, verbose\u003dFalse, purge\u003dFalse):"},{"line_number":1385,"context_line":"        def output(message):"},{"line_number":1386,"context_line":"            if verbose:"},{"line_number":1387,"context_line":"                print(message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_627f9ddf","line":1384,"in_reply_to":"3fa7e38b_5f24c560","updated":"2019-11-07 15:37:25.000000000","message":"Well, I\u0027d really like to not just keep tacking on \"fix this one scenario\" commands because decoding or refactoring the previous scenario is too much work.\n\nHowever, after more inspection, I do see that this is less a scan for missing _mappings_ as it is missing cell assignments so it makes sense.","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"        else:"},{"line_number":1413,"context_line":"            # Get all instance mappings with no cell_id."},{"line_number":1414,"context_line":"            output(\u0027Looking up instance mappings with no cell mapping.\u0027)"},{"line_number":1415,"context_line":"            inst_mappings \u003d objects.InstanceMappingList.get_unmapped(ctxt)"},{"line_number":1416,"context_line":""},{"line_number":1417,"context_line":"        output(\u0027Found %i instance mappings with no cell mapping.\u0027 %"},{"line_number":1418,"context_line":"               len(inst_mappings))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_0253493b","line":1415,"updated":"2019-11-07 15:37:25.000000000","message":"Thinking about running this automatically, why not make this helper filter out mappings that have a buildrequest automatically? Then you should be able to run this periodically with super minimal impact and not  have to do the one-by-one lookup of buildrequest below.\n\nIf I go to deploy a large application and spin up a thousand instances all at once while this happens to run in cron, I\u0027d generate quite a bit of traffic returning all those and then hitting the db to check for a buildrequest for each one.","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":1418,"context_line":"               len(inst_mappings))"},{"line_number":1419,"context_line":"        # If everything has a cell mapping we\u0027re done."},{"line_number":1420,"context_line":"        if not inst_mappings:"},{"line_number":1421,"context_line":"            output(\u0027All instance mappings have a cell mapping. Nothing to do.\u0027)"},{"line_number":1422,"context_line":"            return 0"},{"line_number":1423,"context_line":""},{"line_number":1424,"context_line":"        # We have some work to do, so first get all cells."}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_e2e06d9a","line":1421,"updated":"2019-11-07 15:37:25.000000000","message":"Maybe move this above L1417? Otherwise we\u0027ll see:\n\n Found 0 mappings with no cell mapping\n All instance mappings have a cell mapping, nothing to do","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":1459,"context_line":"            found_cells \u003d []"},{"line_number":1460,"context_line":"            results \u003d context.scatter_gather_cells("},{"line_number":1461,"context_line":"                ctxt, cells, context.CELL_TIMEOUT,"},{"line_number":1462,"context_line":"                objects.Instance.get_by_uuid, instance_uuid, expected_attrs\u003d[])"},{"line_number":1463,"context_line":"            for cell_uuid, instance in results.items():"},{"line_number":1464,"context_line":"                # is_cell_failure_sentinel will tell us if the query to a cell"},{"line_number":1465,"context_line":"                # failed with a timeout or InstanceNotFound error so we can"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_028ca9d5","line":1462,"updated":"2019-11-07 15:37:25.000000000","message":"You could do this once with get_by_filters(uuid\u003d[uuids_of_instances]) right? I know we\u0027re probably not looking to have a lot of instances here, but you\u0027re hitting every cell once per instance that we find.","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ea5cffd671a21ecc9e03a5351693acacd3df1db7","unresolved":false,"context_lines":[{"line_number":1467,"context_line":"                if not context.is_cell_failure_sentinel(instance):"},{"line_number":1468,"context_line":"                    found_cells.append(cell_uuid)"},{"line_number":1469,"context_line":""},{"line_number":1470,"context_line":"            if len(found_cells) \u003e 1:"},{"line_number":1471,"context_line":"                # The instance is somehow in more than one cell, we can\u0027t"},{"line_number":1472,"context_line":"                # really decide what to do here so we need to record an error"},{"line_number":1473,"context_line":"                # and skip this instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_9b7f2d14","line":1470,"updated":"2019-09-24 20:37:55.000000000","message":"This could happen during a cross-cell resize while we have one instance hidden and the other is not, but to start a cross-cell resize the instance mapping has to be mapped to a source cell so if we get this far and we have the instance in multiple cells without a mapping it can\u0027t be during a cross-cell resize (unless something got screwed up while an operator was doing manual DB surgery after a failed cross cell resize?).","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":1476,"context_line":"                duplicate_cell_count +\u003d 1"},{"line_number":1477,"context_line":"            elif not found_cells:"},{"line_number":1478,"context_line":"                if purge:"},{"line_number":1479,"context_line":"                    output(\u0027Instance %s not found in any cell, purging.\u0027 %"},{"line_number":1480,"context_line":"                           instance_uuid)"},{"line_number":1481,"context_line":"                    try:"},{"line_number":1482,"context_line":"                        inst_mapping.destroy()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_42ab811d","line":1479,"range":{"start_line":1479,"start_character":63,"end_line":1479,"end_character":70},"updated":"2019-11-07 15:37:25.000000000","message":"Maybe say \"purging its mapping\"? Otherwise this sounds a bit scarier than it really is.","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"}],"nova/objects/instance_mapping.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce2f2ec06dee361461ff4eea4f44a7ff72e1e75b","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":"        @db_api.api_context_manager.reader"},{"line_number":404,"context_line":"        def _get_unmapped(ctxt):"},{"line_number":405,"context_line":"            query \u003d ctxt.session.query(api_models.InstanceMapping)"},{"line_number":406,"context_line":"            return query.filter_by(cell_id\u003dnull()).all()"},{"line_number":407,"context_line":"        db_mappings \u003d _get_unmapped(context)"},{"line_number":408,"context_line":"        return base.obj_make_list("},{"line_number":409,"context_line":"            context, cls(), objects.InstanceMapping, db_mappings)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffb9cba7_a3d1c3cf","line":406,"range":{"start_line":405,"start_character":12,"end_line":406,"end_character":56},"updated":"2019-04-26 14:58:11.000000000","message":"This needs to joinedload the cell mapping otherwise obj_make_list blows up. For some reason in my testing I\u0027m also failing to return anything from this even though I have an instance mapping with no cell_id:\n\nb\u0027testtools.matchers._impl.MismatchError: 3 !\u003d 0: Looking up instance mappings with no cell mapping.\u0027\n    b\u0027Found 0 instance mappings with no cell mapping.\u0027\n    b\u0027All instance mappings have a cell mapping. Nothing to do.\u0027\n    b\"InstanceMapping(cell_mapping\u003dNone,created_at\u003d2019-04-26T14:56:33Z,id\u003d1,instance_uuid\u003d84f7d6e0-9def-4629-b227-36060dac74d2,project_id\u003d\u0027fake-project\u0027,queued_for_delete\u003dFalse,updated_at\u003dNone,user_id\u003d\u0027fake-user\u0027)\"","commit_id":"fe5d35a71f51fb4caf584d71254c54e8cf62c96e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f857118e0d891c137e238a0d36eb90edb0bda393","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":"        @db_api.api_context_manager.reader"},{"line_number":404,"context_line":"        def _get_unmapped(ctxt):"},{"line_number":405,"context_line":"            query \u003d ctxt.session.query(api_models.InstanceMapping)"},{"line_number":406,"context_line":"            return query.filter_by(cell_id\u003dnull()).all()"},{"line_number":407,"context_line":"        db_mappings \u003d _get_unmapped(context)"},{"line_number":408,"context_line":"        return base.obj_make_list("},{"line_number":409,"context_line":"            context, cls(), objects.InstanceMapping, db_mappings)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffb9cba7_a609d12c","line":406,"range":{"start_line":405,"start_character":12,"end_line":406,"end_character":56},"in_reply_to":"ffb9cba7_a3d1c3cf","updated":"2019-04-26 15:12:34.000000000","message":"Ah I was using join() but that filters out the instance mapping if there is no cell mapping to join. I just need joinedload.","commit_id":"fe5d35a71f51fb4caf584d71254c54e8cf62c96e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6c30633116ee0328534c2a9b46592f5744f6084b","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        return cls._get_count_by_uuids_and_user_in_db(context, uuids, user_id)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    @classmethod"},{"line_number":459,"context_line":"    def get_unmapped(cls, context):"},{"line_number":460,"context_line":"        \"\"\"Returns all instance mappings whose cell_id is NULL"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        :param context: nova auth RequestContext"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_823c19e2","line":459,"updated":"2019-11-07 15:37:25.000000000","message":"No test added for this?","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a4b2924ce33d8eb125e4085f08c48a27af210e4d","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        return cls._get_count_by_uuids_and_user_in_db(context, uuids, user_id)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    @classmethod"},{"line_number":459,"context_line":"    def get_unmapped(cls, context):"},{"line_number":460,"context_line":"        \"\"\"Returns all instance mappings whose cell_id is NULL"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        :param context: nova auth RequestContext"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_f9d49421","line":459,"in_reply_to":"3fa7e38b_577a5aba","updated":"2019-11-08 14:30:42.000000000","message":"Sure, so are all our database query methods (going to be hit by other tests).\n\nWith the api database object, we were pretty good about functional non-mocked tests that query the database. Since this is querying for a specific state and joinedloading the cell, there seems to be plenty to check. Especially if you turn this into the more efficient version I suggested then it seems totally worth proving on its own.\n\nhttps://github.com/openstack/nova/blob/master/nova/tests/functional/db/test_instance_mapping.py","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"accdda8cca4dba1e450e6ea1f57b006674dbdc0b","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        return cls._get_count_by_uuids_and_user_in_db(context, uuids, user_id)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    @classmethod"},{"line_number":459,"context_line":"    def get_unmapped(cls, context):"},{"line_number":460,"context_line":"        \"\"\"Returns all instance mappings whose cell_id is NULL"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        :param context: nova auth RequestContext"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_577a5aba","line":459,"in_reply_to":"3fa7e38b_823c19e2","updated":"2019-11-07 22:48:59.000000000","message":"It\u0027s going to be hit by the functional test so I didn\u0027t create a redundant (and mocked) unit test for it. For anything that hits the DB like this I prefer to have functional test coverage since it\u0027s easy to have false positives with unit test mocks.","commit_id":"939c36ed0b9d97414ec2fcbda589337d94daf2a4"}]}
