)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3657ee130bee18879bb3f03b78589a01176fe8d4","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Surya Seetharaman \u003csuryaseetharaman.9@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-02-02 14:08:45 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Marker reset option for nova-manage map_instances"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently nova-manage map_instances uses a marker set-up by which repeated"},{"line_number":10,"context_line":"runs of the command will start from where the last run finished. Even"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa0c359_9f28b0e2","line":7,"range":{"start_line":7,"start_character":24,"end_line":7,"end_character":49},"updated":"2018-02-08 03:43:10.000000000","message":"nova-manage cell_v2 map_instances","commit_id":"9a82205c40dd8727a356931400b734c3d638bacd"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3657ee130bee18879bb3f03b78589a01176fe8d4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Marker reset option for nova-manage map_instances"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently nova-manage map_instances uses a marker set-up by which repeated"},{"line_number":10,"context_line":"runs of the command will start from where the last run finished. Even"},{"line_number":11,"context_line":"deleting the cell with the instance_mappings will not remove the marker"},{"line_number":12,"context_line":"since the marker mapping has a NULL cell_mapping field. There needs to be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa0c359_bf232c05","line":9,"range":{"start_line":9,"start_character":10,"end_line":9,"end_character":35},"updated":"2018-02-08 03:43:10.000000000","message":"nova-manage cell_v2 map_instances","commit_id":"9a82205c40dd8727a356931400b734c3d638bacd"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f1d3cc38442f03d365f062f15eac18846628307","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    Repeated runs of the command will start from where the last run finished"},{"line_number":151,"context_line":"    so it is not necessary to increase max-count to finish. A reset option"},{"line_number":152,"context_line":"    can be passed which will reset the marker, thus making the command start"},{"line_number":153,"context_line":"    from the beginning as opposed to the default behaviour of starting from"},{"line_number":154,"context_line":"    where the last run finished. Returns 0 if all instances have been mapped,"},{"line_number":155,"context_line":"    and 1 if there are still instances to be mapped."},{"line_number":156,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"df7087c5_323794b3","line":153,"range":{"start_line":153,"start_character":49,"end_line":153,"end_character":58},"updated":"2018-03-08 18:28:32.000000000","message":"I always complain that we speak \u0027murican english here in nova for consistency :)","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"04c9076d74eebec6a81a791162caf1eb83faf6b1","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    Repeated runs of the command will start from where the last run finished"},{"line_number":151,"context_line":"    so it is not necessary to increase max-count to finish. A reset option"},{"line_number":152,"context_line":"    can be passed which will reset the marker, thus making the command start"},{"line_number":153,"context_line":"    from the beginning as opposed to the default behaviour of starting from"},{"line_number":154,"context_line":"    where the last run finished. Returns 0 if all instances have been mapped,"},{"line_number":155,"context_line":"    and 1 if there are still instances to be mapped."},{"line_number":156,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"df7087c5_fc70dcde","line":153,"range":{"start_line":153,"start_character":49,"end_line":153,"end_character":58},"in_reply_to":"df7087c5_323794b3","updated":"2018-03-12 10:17:23.000000000","message":"Done :)","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"}],"nova/cmd/manage.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f1d3cc38442f03d365f062f15eac18846628307","unresolved":false,"context_lines":[{"line_number":1121,"context_line":"            # There should be only one here"},{"line_number":1122,"context_line":"            marker \u003d marker_mapping[0].instance_uuid.replace(\u0027 \u0027, \u0027-\u0027)"},{"line_number":1123,"context_line":"            if reset_marker:"},{"line_number":1124,"context_line":"                marker \u003d None"},{"line_number":1125,"context_line":"            marker_mapping[0].destroy()"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"        next_marker \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_d2709875","line":1124,"updated":"2018-03-08 18:28:32.000000000","message":"I was going to comment that it seems like we should just skip all the marker lookup above if --reset is passed. However, I assume we do it here so we look it up and delete it. That makes L1122 kinda dead code if --reset is passed, but not a huge deal.","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"04c9076d74eebec6a81a791162caf1eb83faf6b1","unresolved":false,"context_lines":[{"line_number":1121,"context_line":"            # There should be only one here"},{"line_number":1122,"context_line":"            marker \u003d marker_mapping[0].instance_uuid.replace(\u0027 \u0027, \u0027-\u0027)"},{"line_number":1123,"context_line":"            if reset_marker:"},{"line_number":1124,"context_line":"                marker \u003d None"},{"line_number":1125,"context_line":"            marker_mapping[0].destroy()"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"        next_marker \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_dff38a09","line":1124,"in_reply_to":"df7087c5_d2709875","updated":"2018-03-12 10:17:23.000000000","message":"Yea, the reason why I put the check after the look up is because we would anyways have to destroy the existing marker_mapping record from the previous run, else we might have two of such records later if I understand correctly.","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"273fdfc58ab16c7670591b8ee04c9fc88dc41b37","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"               \u0027and run the command until it exits with 0.\u0027)"},{"line_number":1147,"context_line":"    @args(\u0027--reset\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027reset_marker\u0027,"},{"line_number":1148,"context_line":"          help\u003d\u0027The command will start from the beginning as opposed to the \u0027"},{"line_number":1149,"context_line":"               \u0027default behaviour of starting from where the last run \u0027"},{"line_number":1150,"context_line":"               \u0027finished\u0027)"},{"line_number":1151,"context_line":"    def map_instances(self, cell_uuid, max_count\u003dNone, reset_marker\u003dNone):"},{"line_number":1152,"context_line":"        \"\"\"Map instances into the provided cell."}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_794d8cc2","line":1149,"range":{"start_line":1149,"start_character":24,"end_line":1149,"end_character":33},"updated":"2018-03-13 17:07:55.000000000","message":"ooooh.","commit_id":"276e9a892cc445f3255fb28770d7c8eda8542fb2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"6b1e1dc8ba8ef2a8729cf0dc8a236e3885b631b0","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"               \u0027and run the command until it exits with 0.\u0027)"},{"line_number":1147,"context_line":"    @args(\u0027--reset\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027reset_marker\u0027,"},{"line_number":1148,"context_line":"          help\u003d\u0027The command will start from the beginning as opposed to the \u0027"},{"line_number":1149,"context_line":"               \u0027default behaviour of starting from where the last run \u0027"},{"line_number":1150,"context_line":"               \u0027finished\u0027)"},{"line_number":1151,"context_line":"    def map_instances(self, cell_uuid, max_count\u003dNone, reset_marker\u003dNone):"},{"line_number":1152,"context_line":"        \"\"\"Map instances into the provided cell."}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_74fb5346","line":1149,"range":{"start_line":1149,"start_character":24,"end_line":1149,"end_character":33},"in_reply_to":"df7087c5_794d8cc2","updated":"2018-03-13 17:47:19.000000000","message":"Oh man! I will pay more attention to this :/","commit_id":"276e9a892cc445f3255fb28770d7c8eda8542fb2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3c9d65aad975639d027099f7861e0cc72047e0b2","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        for instance in instances:"},{"line_number":1108,"context_line":"            try:"},{"line_number":1109,"context_line":"                mapping \u003d objects.InstanceMapping(ctxt)"},{"line_number":1110,"context_line":"                mapping.instance_uuid \u003d instance.uuid"},{"line_number":1111,"context_line":"                mapping.cell_mapping \u003d cell_mapping"},{"line_number":1112,"context_line":"                mapping.project_id \u003d instance.project_id"},{"line_number":1113,"context_line":"                mapping.create()"},{"line_number":1114,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":1115,"context_line":"                continue"},{"line_number":1116,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_5748edca","line":1113,"range":{"start_line":1109,"start_character":16,"end_line":1113,"end_character":32},"updated":"2018-03-27 00:57:33.000000000","message":"Is this really what we want to do in a world where the marker can be reset? The scenario from the bug is that instances got originally mapped with a NULL cell_mapping for each of them somehow and you want to be able to go back and re-map them to a valid cell. This is going to raise DBDuplicateEntry for instance uuids that have entries, (even ones with cell_mapping \u003d NULL) and not update them to the desired cell.\n\nShouldn\u0027t this be changed to update an existing record\u0027s cell_mapping for the given instance_uuid if one is found?","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"b1da1d20160edec0d3f07ccc2736d9c8f54e1887","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        for instance in instances:"},{"line_number":1108,"context_line":"            try:"},{"line_number":1109,"context_line":"                mapping \u003d objects.InstanceMapping(ctxt)"},{"line_number":1110,"context_line":"                mapping.instance_uuid \u003d instance.uuid"},{"line_number":1111,"context_line":"                mapping.cell_mapping \u003d cell_mapping"},{"line_number":1112,"context_line":"                mapping.project_id \u003d instance.project_id"},{"line_number":1113,"context_line":"                mapping.create()"},{"line_number":1114,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":1115,"context_line":"                continue"},{"line_number":1116,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_a0f6d7f8","line":1113,"range":{"start_line":1109,"start_character":16,"end_line":1113,"end_character":32},"in_reply_to":"bf659307_5748edca","updated":"2018-03-27 09:41:47.000000000","message":"\u003e Is this really what we want to do in a world where the marker can\n \u003e be reset? The scenario from the bug is that instances got\n \u003e originally mapped with a NULL cell_mapping for each of them somehow\n \u003e and you want to be able to go back and re-map them to a valid cell.\n \u003e This is going to raise DBDuplicateEntry for instance uuids that\n \u003e have entries, (even ones with cell_mapping \u003d NULL) and not update\n \u003e them to the desired cell.\n\nWell, from the IRC discussion it was concluded we would nuke our existing NULL pointed instance_mappings and re-create them for our upgrade.\n\n \u003e \n \u003e Shouldn\u0027t this be changed to update an existing record\u0027s\n \u003e cell_mapping for the given instance_uuid if one is found?\n\nWe had talked about a update/overwrite option, but it was decided that \"it could be dangerous\" and hence should not be done.\n\nReference: http://eavesdrop.openstack.org/meetings/nova_cells/2018/nova_cells.2018-01-24-21.00.log.html#l-82\n\nHence we agreed to a reset in any case if someone wanted to go backwards and do mapping from the beginning after nuking a couple of NULL mappings.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d64d19803bab2894fd6b0b5d87a618d234ccccc3","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        for instance in instances:"},{"line_number":1108,"context_line":"            try:"},{"line_number":1109,"context_line":"                mapping \u003d objects.InstanceMapping(ctxt)"},{"line_number":1110,"context_line":"                mapping.instance_uuid \u003d instance.uuid"},{"line_number":1111,"context_line":"                mapping.cell_mapping \u003d cell_mapping"},{"line_number":1112,"context_line":"                mapping.project_id \u003d instance.project_id"},{"line_number":1113,"context_line":"                mapping.create()"},{"line_number":1114,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":1115,"context_line":"                continue"},{"line_number":1116,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_2ecd9130","line":1113,"range":{"start_line":1109,"start_character":16,"end_line":1113,"end_character":32},"in_reply_to":"bf659307_88316a0e","updated":"2018-04-11 13:40:00.000000000","message":"For reset I think it makes sense to just reset the marker but not change any other behavior. I can see a --force or --do-it-again flag that would refresh/recreate existing mappings, which may be used with --reset depending on what you want to do.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"73a46d90b3f4538862258ed640d0e5051e85b2fa","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        for instance in instances:"},{"line_number":1108,"context_line":"            try:"},{"line_number":1109,"context_line":"                mapping \u003d objects.InstanceMapping(ctxt)"},{"line_number":1110,"context_line":"                mapping.instance_uuid \u003d instance.uuid"},{"line_number":1111,"context_line":"                mapping.cell_mapping \u003d cell_mapping"},{"line_number":1112,"context_line":"                mapping.project_id \u003d instance.project_id"},{"line_number":1113,"context_line":"                mapping.create()"},{"line_number":1114,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":1115,"context_line":"                continue"},{"line_number":1116,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_88316a0e","line":1113,"range":{"start_line":1109,"start_character":16,"end_line":1113,"end_character":32},"in_reply_to":"bf659307_a0f6d7f8","updated":"2018-03-27 19:50:52.000000000","message":"I see. Sorry I missed the convo on that -- from the log it looks like I was having a parallel conversation with Belmiro where I was trying to understand whether/how you all ended up with instance_mappings with NULL cell_id.\n\nI see now, we won\u0027t update instance_mappings but operators can use the delete_cell --force command to remove instance_mappings via the CLI. At first I was thinking only manual deletion in mysql was the option (not good) but we have a CLI, so that\u0027s fine.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ee10179f15758ac94ef54ff2f9bbdcd8332a446d","unresolved":false,"context_lines":[{"line_number":1131,"context_line":"               \u0027large number of instances, consider specifying a custom value \u0027"},{"line_number":1132,"context_line":"               \u0027and run the command until it exits with 0.\u0027)"},{"line_number":1133,"context_line":"    @args(\u0027--reset\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027reset_marker\u0027,"},{"line_number":1134,"context_line":"          help\u003d\u0027The command will start from the beginning as opposed to the \u0027"},{"line_number":1135,"context_line":"               \u0027default behavior of starting from where the last run \u0027"},{"line_number":1136,"context_line":"               \u0027finished\u0027)"},{"line_number":1137,"context_line":"    def map_instances(self, cell_uuid, max_count\u003dNone, reset_marker\u003dNone):"},{"line_number":1138,"context_line":"        \"\"\"Map instances into the provided cell."},{"line_number":1139,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_f510bd5b","line":1136,"range":{"start_line":1134,"start_character":10,"end_line":1136,"end_character":26},"updated":"2018-04-11 18:11:22.000000000","message":"From a UX perspective, this would be more useful to me if it mentioned in which scenarios I might need to consider using this option, otherwise it\u0027s unclear why map_instances doesn\u0027t just work as-is.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"}],"nova/tests/unit/test_nova_manage.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f1d3cc38442f03d365f062f15eac18846628307","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        # Now calling reset with map_instances max_count\u003d2 would reset"},{"line_number":1222,"context_line":"        # the marker as expected and start map_instances from the beginning."},{"line_number":1223,"context_line":"        # This implies we end up finding the marker in the same position,"},{"line_number":1224,"context_line":"        # i.e based on second instance."},{"line_number":1225,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1226,"context_line":"                                            reset_marker\u003dTrue)"},{"line_number":1227,"context_line":"        self.assertEqual(1, ret)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_b2cf247e","line":1224,"updated":"2018-03-08 18:28:32.000000000","message":"This is good, although it also makes it hard to tell if we moved the marker at all, right? Wouldn\u0027t it be better to move the marker to 3, then reset\u003dTrue,max_count\u003d2 and make sure it has gone backwards?","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"04c9076d74eebec6a81a791162caf1eb83faf6b1","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        # Now calling reset with map_instances max_count\u003d2 would reset"},{"line_number":1222,"context_line":"        # the marker as expected and start map_instances from the beginning."},{"line_number":1223,"context_line":"        # This implies we end up finding the marker in the same position,"},{"line_number":1224,"context_line":"        # i.e based on second instance."},{"line_number":1225,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1226,"context_line":"                                            reset_marker\u003dTrue)"},{"line_number":1227,"context_line":"        self.assertEqual(1, ret)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_5f221a02","line":1224,"in_reply_to":"df7087c5_b2cf247e","updated":"2018-03-12 10:17:23.000000000","message":"Done","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f1d3cc38442f03d365f062f15eac18846628307","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        # This implies we end up finding the marker in the same position,"},{"line_number":1224,"context_line":"        # i.e based on second instance."},{"line_number":1225,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1226,"context_line":"                                            reset_marker\u003dTrue)"},{"line_number":1227,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_72c98c76","line":1226,"range":{"start_line":1226,"start_character":44,"end_line":1226,"end_character":61},"updated":"2018-03-08 18:28:32.000000000","message":"Alignment is off here and in places you copy/pasted it below.","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"04c9076d74eebec6a81a791162caf1eb83faf6b1","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        # This implies we end up finding the marker in the same position,"},{"line_number":1224,"context_line":"        # i.e based on second instance."},{"line_number":1225,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1226,"context_line":"                                            reset_marker\u003dTrue)"},{"line_number":1227,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_9fcc326b","line":1226,"range":{"start_line":1226,"start_character":44,"end_line":1226,"end_character":61},"in_reply_to":"df7087c5_72c98c76","updated":"2018-03-12 10:17:23.000000000","message":"Done","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3c9d65aad975639d027099f7861e0cc72047e0b2","unresolved":false,"context_lines":[{"line_number":1295,"context_line":"        # Verifying that the marker is now based on third instance"},{"line_number":1296,"context_line":"        # i.e the position of the marker."},{"line_number":1297,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1298,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"},{"line_number":1299,"context_line":"        marker \u003d inst_mappings[0].instance_uuid.replace(\u0027 \u0027, \u0027-\u0027)"},{"line_number":1300,"context_line":"        self.assertEqual(instance_uuids[2], marker)"},{"line_number":1301,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_57778d3b","line":1298,"range":{"start_line":1298,"start_character":40,"end_line":1298,"end_character":67},"updated":"2018-03-27 00:57:33.000000000","message":"Guess we could use a global constant in the module for this (I didn\u0027t know this was a thing until this review).","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"b1da1d20160edec0d3f07ccc2736d9c8f54e1887","unresolved":false,"context_lines":[{"line_number":1295,"context_line":"        # Verifying that the marker is now based on third instance"},{"line_number":1296,"context_line":"        # i.e the position of the marker."},{"line_number":1297,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1298,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"},{"line_number":1299,"context_line":"        marker \u003d inst_mappings[0].instance_uuid.replace(\u0027 \u0027, \u0027-\u0027)"},{"line_number":1300,"context_line":"        self.assertEqual(instance_uuids[2], marker)"},{"line_number":1301,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_ca4c4ca0","line":1298,"range":{"start_line":1298,"start_character":40,"end_line":1298,"end_character":67},"in_reply_to":"bf659307_57778d3b","updated":"2018-03-27 09:41:47.000000000","message":"Done","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3c9d65aad975639d027099f7861e0cc72047e0b2","unresolved":false,"context_lines":[{"line_number":1296,"context_line":"        # i.e the position of the marker."},{"line_number":1297,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1298,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"},{"line_number":1299,"context_line":"        marker \u003d inst_mappings[0].instance_uuid.replace(\u0027 \u0027, \u0027-\u0027)"},{"line_number":1300,"context_line":"        self.assertEqual(instance_uuids[2], marker)"},{"line_number":1301,"context_line":""},{"line_number":1302,"context_line":"        # Now calling reset with map_instances max_count\u003d2 would reset"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_178fd523","line":1299,"updated":"2018-03-27 00:57:33.000000000","message":"Note to self: the marker is an actual extra row in the instance_mappings table with project_id \u003d \u0027INSTANCE_MIGRATION_MARKER\u0027 and instance_uuid \u003d \u003csame as instance_uuid for the last mapped instance in the instance_mappings table except with spaces instead of dashes bc of the unique constraint on instance_uuid column\u003e","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3c9d65aad975639d027099f7861e0cc72047e0b2","unresolved":false,"context_lines":[{"line_number":1304,"context_line":"        # This implies we end up finding the marker based on second instance."},{"line_number":1305,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1306,"context_line":"                                          reset_marker\u003dTrue)"},{"line_number":1307,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1310,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_b7cdc95e","line":1307,"updated":"2018-03-27 00:57:33.000000000","message":"Note to self: if an instance is already mapped to the provided cell, the DBDuplicateEntry exception is caught and ignored and mapping continues on to the next.\n\nI\u0027m not sure what happens if you were to reset_marker and provide a different cell uuid -- instance mapped to more than one cell then?","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"b1da1d20160edec0d3f07ccc2736d9c8f54e1887","unresolved":false,"context_lines":[{"line_number":1304,"context_line":"        # This implies we end up finding the marker based on second instance."},{"line_number":1305,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1306,"context_line":"                                          reset_marker\u003dTrue)"},{"line_number":1307,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1310,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_fd5478cc","line":1307,"in_reply_to":"bf659307_b7cdc95e","updated":"2018-03-27 09:41:47.000000000","message":"\u003e \n \u003e I\u0027m not sure what happens if you were to reset_marker \n\nSo resetting the marker would delete this extra instance_mapping record we have along with the saved instance_uuid and make the map _instances operation to query from the beginning of the instances table for the specified cell. So the marker will be lost.\n\n \u003e and provide a\n \u003e different cell uuid -- instance mapped to more than one cell then?\n\nSince the marker is wiped, for a different cell, it would just run this from the beginning and map only unmapped stuff right ? why would it suddenly change the logic of mapping to more than one cell because we did a reset. The Duplicate Entry exception would ensure we don\u0027t have two mappings for the same instance_uuid right ? Hopefully I am not missing something.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"73a46d90b3f4538862258ed640d0e5051e85b2fa","unresolved":false,"context_lines":[{"line_number":1304,"context_line":"        # This implies we end up finding the marker based on second instance."},{"line_number":1305,"context_line":"        ret \u003d self.commands.map_instances(cell_uuid, max_count\u003d2,"},{"line_number":1306,"context_line":"                                          reset_marker\u003dTrue)"},{"line_number":1307,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        inst_mappings \u003d objects.InstanceMappingList.get_by_project_id(ctxt,"},{"line_number":1310,"context_line":"                                        \u0027INSTANCE_MIGRATION_MARKER\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf659307_28fffe34","line":1307,"in_reply_to":"bf659307_fd5478cc","updated":"2018-03-27 19:50:52.000000000","message":"Gah, sorry, I had meant to delete this comment after I investigated how the behavior works if I changed cell_id. Records are never updated but duplicates are also never created (for a given instance uuid) so getting mapped to more than one cell can\u0027t happen.","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"}],"releasenotes/notes/reset-marker-for-map_instances-0c841ef45e3adc7b.yaml":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f1d3cc38442f03d365f062f15eac18846628307","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Currently the ``nova-manage cell_v2 map_instances`` command uses a marker"},{"line_number":5,"context_line":"    set-up by which repeated runs of the command will start from where the last"},{"line_number":6,"context_line":"    run finished, by default. A ``--reset`` option has been added to this command"},{"line_number":7,"context_line":"    by which the marker can be reset and users can run the command from the"},{"line_number":8,"context_line":"    beginning if needed, instead of the default behaviour."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"df7087c5_b27de41d","line":7,"range":{"start_line":7,"start_character":51,"end_line":7,"end_character":66},"updated":"2018-03-08 18:28:32.000000000","message":"I would change this to \"start the process\" because it\u0027s not the command you\u0027re running from the beginning, but the process of mapping instances, which might be multiple run(s) of the command.","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"04c9076d74eebec6a81a791162caf1eb83faf6b1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Currently the ``nova-manage cell_v2 map_instances`` command uses a marker"},{"line_number":5,"context_line":"    set-up by which repeated runs of the command will start from where the last"},{"line_number":6,"context_line":"    run finished, by default. A ``--reset`` option has been added to this command"},{"line_number":7,"context_line":"    by which the marker can be reset and users can run the command from the"},{"line_number":8,"context_line":"    beginning if needed, instead of the default behaviour."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"df7087c5_5a88e86f","line":7,"range":{"start_line":7,"start_character":51,"end_line":7,"end_character":66},"in_reply_to":"df7087c5_b27de41d","updated":"2018-03-12 10:17:23.000000000","message":"Done","commit_id":"b24896237ce4518e6e596f0ffa4291f96efcedfa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"273fdfc58ab16c7670591b8ee04c9fc88dc41b37","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Currently the ``nova-manage cell_v2 map_instances`` command uses a marker"},{"line_number":5,"context_line":"    set-up by which repeated runs of the command will start from where the last"},{"line_number":6,"context_line":"    run finished, by default. A ``--reset`` option has been added to this command"},{"line_number":7,"context_line":"    by which the marker can be reset and users can start the process from the"},{"line_number":8,"context_line":"    beginning if needed, instead of the default behavior."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"df7087c5_79fb4c46","line":5,"range":{"start_line":5,"start_character":4,"end_line":5,"end_character":10},"updated":"2018-03-13 17:07:55.000000000","message":"I would use \"setup\" here as a noun, but not a huge deal.","commit_id":"276e9a892cc445f3255fb28770d7c8eda8542fb2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ee10179f15758ac94ef54ff2f9bbdcd8332a446d","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    setup by which repeated runs of the command will start from where the last"},{"line_number":6,"context_line":"    run finished, by default. A ``--reset`` option has been added to this command"},{"line_number":7,"context_line":"    by which the marker can be reset and users can start the process from the"},{"line_number":8,"context_line":"    beginning if needed, instead of the default behavior."}],"source_content_type":"text/x-yaml","patch_set":9,"id":"bf659307_7504ad18","line":8,"range":{"start_line":8,"start_character":14,"end_line":8,"end_character":23},"updated":"2018-04-11 18:11:22.000000000","message":"Again, in which scenarios might one need to use this?","commit_id":"98163f98b700840f50c689e4a3aed7e28dd0c1ef"}]}
