)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"47141e6cc37bd6a8bc46e5010cc9c0f0822a949d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add cross cell sort support for get_migrations"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"These will be used be used by migrations cross cell list."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"We can get migrations objects with limit/marker/sort params from"},{"line_number":12,"context_line":"multiple cell using get_migrations_sorted."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"bf8cb3f7_bf3d9abc","line":9,"range":{"start_line":9,"start_character":6,"end_line":9,"end_character":26},"updated":"2017-12-23 06:57:06.000000000","message":"duplicated","commit_id":"cc5bda0ef5326571e6eeca0d264f300149df78f4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"4a3c16020b0f608e8903f097e70c398a34312fdf","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add cross cell sort support for get_migrations"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"These will be used be used by migrations cross cell list."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"We can get migrations objects with limit/marker/sort params from"},{"line_number":12,"context_line":"multiple cell using get_migrations_sorted."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"bf8cb3f7_5f548eca","line":9,"range":{"start_line":9,"start_character":6,"end_line":9,"end_character":26},"in_reply_to":"bf8cb3f7_bf3d9abc","updated":"2017-12-23 07:11:40.000000000","message":"Done","commit_id":"cc5bda0ef5326571e6eeca0d264f300149df78f4"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ea0fc00b4032a8f5f75b4556879727a0e0bc341","unresolved":false,"context_lines":[{"line_number":4009,"context_line":"                       request_spec\u003drequest_spec,"},{"line_number":4010,"context_line":"                       )"},{"line_number":4011,"context_line":""},{"line_number":4012,"context_line":"    def get_migrations(self, context, filters):"},{"line_number":4013,"context_line":"        \"\"\"Get all migrations for the given filters.\"\"\""},{"line_number":4014,"context_line":"        load_cells()"},{"line_number":4015,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_fa961f4c","line":4012,"range":{"start_line":4012,"start_character":8,"end_line":4012,"end_character":22},"updated":"2017-11-29 20:20:49.000000000","message":"Why can\u0027t we just re-use this method and add the optional limit/marker/sort_keys/sort_dirs?","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"36cb9131408467d1401b5a494c7b0131806b5bd1","unresolved":false,"context_lines":[{"line_number":4009,"context_line":"                       request_spec\u003drequest_spec,"},{"line_number":4010,"context_line":"                       )"},{"line_number":4011,"context_line":""},{"line_number":4012,"context_line":"    def get_migrations(self, context, filters):"},{"line_number":4013,"context_line":"        \"\"\"Get all migrations for the given filters.\"\"\""},{"line_number":4014,"context_line":"        load_cells()"},{"line_number":4015,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_be7964c5","line":4012,"range":{"start_line":4012,"start_character":8,"end_line":4012,"end_character":22},"in_reply_to":"ff82abbf_fa961f4c","updated":"2017-11-30 03:20:47.000000000","message":"Yes, we can.I will update soon.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf3233ce32ff726d204f439b45c12e93f65f9597","unresolved":false,"context_lines":[{"line_number":4018,"context_line":"            if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":4019,"context_line":"                continue"},{"line_number":4020,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4021,"context_line":"                migrations.extend(objects.MigrationList.get_by_filters("},{"line_number":4022,"context_line":"                    cctxt, filters).objects)"},{"line_number":4023,"context_line":"        return objects.MigrationList(objects\u003dmigrations)"},{"line_number":4024,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_3ab007dd","line":4021,"range":{"start_line":4021,"start_character":56,"end_line":4021,"end_character":70},"updated":"2017-11-29 20:24:11.000000000","message":"And change this to use this same method that you modified for this series:\n\nhttps://review.openstack.org/#/c/514904/24/nova/objects/migration.py@219\n\nIf we\u0027re at an older microversion, the behavior doesn\u0027t change because the calling code (the REST API handler) doesn\u0027t pass in limit/marker/sort_keys. So we can control the logic of when we need to merge sort by simply checking if sort_keys is provided.\n\nWe\u0027d also need to handle the case that we get a marker and we\u0027d have to iterate the cells until we find results starting with the marker, just like we used to do with instances:\n\nhttps://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2593","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e5930a771b565cbc598428ad8f552b173389b9","unresolved":false,"context_lines":[{"line_number":49,"context_line":"from nova.compute import task_states"},{"line_number":50,"context_line":"from nova.compute import utils as compute_utils"},{"line_number":51,"context_line":"from nova.compute.utils import ObjectSortContext"},{"line_number":52,"context_line":"from nova.compute.utils import ObjectWrapper"},{"line_number":53,"context_line":"from nova.compute.utils import wrap_instance_event"},{"line_number":54,"context_line":"from nova.compute import vm_states"},{"line_number":55,"context_line":"from nova import conductor"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_8cd1c832","line":52,"updated":"2017-11-30 15:45:51.000000000","message":"You need to import modules, nothing less.","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e5930a771b565cbc598428ad8f552b173389b9","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":4102,"context_line":"        return db_migration"},{"line_number":4103,"context_line":""},{"line_number":4104,"context_line":"    def get_migrations(self, context, filters, sort_keys\u003dNone, sort_dirs\u003dNone,"},{"line_number":4105,"context_line":"                       limit\u003dNone, marker\u003dNone):"},{"line_number":4106,"context_line":"        \"\"\"Get all migrations for the given filters.\"\"\""},{"line_number":4107,"context_line":"        marker_migration \u003d None"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_2cc75c48","line":4104,"range":{"start_line":4104,"start_character":47,"end_line":4104,"end_character":77},"updated":"2017-11-30 15:45:51.000000000","message":"Why are we allowing sort keys and directions for migrations? I\u0027d prefer a simple approach of always sorting by a stable direction on created_at or something like that","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38e5d59b98963efced5d8d41ceb6f548148caa97","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":4102,"context_line":"        return db_migration"},{"line_number":4103,"context_line":""},{"line_number":4104,"context_line":"    def get_migrations(self, context, filters, sort_keys\u003dNone, sort_dirs\u003dNone,"},{"line_number":4105,"context_line":"                       limit\u003dNone, marker\u003dNone):"},{"line_number":4106,"context_line":"        \"\"\"Get all migrations for the given filters.\"\"\""},{"line_number":4107,"context_line":"        marker_migration \u003d None"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_2c20bcb0","line":4104,"range":{"start_line":4104,"start_character":47,"end_line":4104,"end_character":77},"in_reply_to":"ff82abbf_2cc75c48","updated":"2017-11-30 16:00:08.000000000","message":"It\u0027s all plumbed through from a hard-coded set in the API handler code at the end of the series:\n\nhttps://review.openstack.org/#/c/330406/67/nova/api/openstack/compute/migrations.py@128","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e5930a771b565cbc598428ad8f552b173389b9","unresolved":false,"context_lines":[{"line_number":4117,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4118,"context_line":"                migrations.extend(objects.MigrationList.get_by_filters("},{"line_number":4119,"context_line":"                    cctxt, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":4120,"context_line":"                    limit\u003dlimit, marker\u003dmarker_migration).objects)"},{"line_number":4121,"context_line":""},{"line_number":4122,"context_line":"        if sort_keys and sort_dirs:"},{"line_number":4123,"context_line":"            sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_0c93785e","line":4120,"range":{"start_line":4120,"start_character":33,"end_line":4120,"end_character":57},"updated":"2017-11-30 15:45:51.000000000","message":"This won\u0027t work because the marker won\u0027t be found in the other cells.","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38e5d59b98963efced5d8d41ceb6f548148caa97","unresolved":false,"context_lines":[{"line_number":4117,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4118,"context_line":"                migrations.extend(objects.MigrationList.get_by_filters("},{"line_number":4119,"context_line":"                    cctxt, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":4120,"context_line":"                    limit\u003dlimit, marker\u003dmarker_migration).objects)"},{"line_number":4121,"context_line":""},{"line_number":4122,"context_line":"        if sort_keys and sort_dirs:"},{"line_number":4123,"context_line":"            sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_cc2cb0ae","line":4120,"range":{"start_line":4120,"start_character":33,"end_line":4120,"end_character":57},"in_reply_to":"ff82abbf_0c93785e","updated":"2017-11-30 16:00:08.000000000","message":"Yeah I thought about this last night too but forgot to leave a comment, or timed out.","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e5930a771b565cbc598428ad8f552b173389b9","unresolved":false,"context_lines":[{"line_number":4122,"context_line":"        if sort_keys and sort_dirs:"},{"line_number":4123,"context_line":"            sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":4124,"context_line":"            migrations \u003d sorted(migrations,"},{"line_number":4125,"context_line":"                                key\u003dlambda x: ObjectWrapper(sort_ctx, x))"},{"line_number":4126,"context_line":""},{"line_number":4127,"context_line":"        if limit:"},{"line_number":4128,"context_line":"            migrations \u003d migrations[0:limit]"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_6cb564cd","line":4125,"updated":"2017-11-30 15:45:51.000000000","message":"Just to be clear, this will sort everything in memory ahead of time and be rather inefficient if a limit is provided.","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"e201d28f14bfa3bbf8daeaf2532a538fabb957e6","unresolved":false,"context_lines":[{"line_number":4005,"context_line":"                       request_spec\u003drequest_spec,"},{"line_number":4006,"context_line":"                       )"},{"line_number":4007,"context_line":""},{"line_number":4008,"context_line":"    def get_migrations(self, context, filters):"},{"line_number":4009,"context_line":"        \"\"\"Get all migrations for the given filters.\"\"\""},{"line_number":4010,"context_line":"        load_cells()"},{"line_number":4011,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"ff82abbf_442dbea6","line":4008,"range":{"start_line":4008,"start_character":8,"end_line":4008,"end_character":22},"updated":"2017-12-01 09:38:09.000000000","message":"It seems we should left this for the old microversion.","commit_id":"68001565887df5c7c1c90324eeed08a53c4fffcf"}],"nova/compute/migration_list.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"fef33a4892dcef83d50a6f1381e4af10aa785010","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return r \u003d\u003d -1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def _get_marker_migration(ctx, marker):"},{"line_number":66,"context_line":"    \"\"\"Get the marker migration from its cell."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    This returns the marker migration from the cell in which it lives"},{"line_number":69,"context_line":"    \"\"\""},{"line_number":70,"context_line":"    results \u003d nova_context.scatter_gather_all_cells(ctx,"},{"line_number":71,"context_line":"                                                    db.migration_get_by_uuid,"},{"line_number":72,"context_line":"                                                    marker)"},{"line_number":73,"context_line":"    db_migration \u003d None"},{"line_number":74,"context_line":"    for cell_uuid, result in results.items():"},{"line_number":75,"context_line":"        if result not in (nova_context.did_not_respond_sentinel,"},{"line_number":76,"context_line":"                          nova_context.raised_exception_sentinel):"},{"line_number":77,"context_line":"            db_migration \u003d result"},{"line_number":78,"context_line":"            break"},{"line_number":79,"context_line":"    if not db_migration:"},{"line_number":80,"context_line":"        raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":81,"context_line":"    return db_migration"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"def get_migrations_sorted(ctx, filters, limit, marker, sort_keys, sort_dirs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_d1854f5b","line":81,"range":{"start_line":65,"start_character":0,"end_line":81,"end_character":23},"updated":"2017-11-07 13:02:50.000000000","message":"Without something like instance_mapping(records the every instance\u0027s position), we have to travel all cells to find the specific cell of the global marker. \n\nIf we find it, we will return it, otherwise raise NotFound exception.","commit_id":"dfd1b1337af60478e842126540df9e87da498ec5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bce2eda853b86bc734cfec83db7f52282ab505eb","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return r \u003d\u003d -1"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def _get_marker_migration(ctx, marker):"},{"line_number":66,"context_line":"    \"\"\"Get the marker migration from its cell."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    This returns the marker migration from the cell in which it lives"},{"line_number":69,"context_line":"    \"\"\""},{"line_number":70,"context_line":"    results \u003d nova_context.scatter_gather_all_cells(ctx,"},{"line_number":71,"context_line":"                                                    db.migration_get_by_uuid,"},{"line_number":72,"context_line":"                                                    marker)"},{"line_number":73,"context_line":"    db_migration \u003d None"},{"line_number":74,"context_line":"    for cell_uuid, result in results.items():"},{"line_number":75,"context_line":"        if result not in (nova_context.did_not_respond_sentinel,"},{"line_number":76,"context_line":"                          nova_context.raised_exception_sentinel):"},{"line_number":77,"context_line":"            db_migration \u003d result"},{"line_number":78,"context_line":"            break"},{"line_number":79,"context_line":"    if not db_migration:"},{"line_number":80,"context_line":"        raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":81,"context_line":"    return db_migration"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"def get_migrations_sorted(ctx, filters, limit, marker, sort_keys, sort_dirs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_47351a44","line":81,"range":{"start_line":65,"start_character":0,"end_line":81,"end_character":23},"in_reply_to":"3f4b6375_d1854f5b","updated":"2017-11-07 22:01:07.000000000","message":"That\u0027s fine, and that\u0027s how we handled listing instances in pike across multiple cells. It\u0027s not the most efficient but I think it\u0027s OK - one would have far fewer migration records than instances in a cloud.","commit_id":"dfd1b1337af60478e842126540df9e87da498ec5"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def get_migrations_sorted(ctx, filters, limit, marker, sort_keys, sort_dirs):"},{"line_number":46,"context_line":"    \"\"\"Get a cross-cell list of instances matching filters."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    This iterates cells in parallel generating a unified and sorted"},{"line_number":49,"context_line":"    list of instances as efficiently as possible. It takes care to"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_bf143545","line":46,"range":{"start_line":46,"start_character":32,"end_line":46,"end_character":41},"updated":"2017-11-16 02:55:54.000000000","message":"migrations?","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    \"\"\"Get a cross-cell list of instances matching filters."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    This iterates cells in parallel generating a unified and sorted"},{"line_number":49,"context_line":"    list of instances as efficiently as possible. It takes care to"},{"line_number":50,"context_line":"    iterate the list as infrequently as possible. We wrap the results"},{"line_number":51,"context_line":"    in InstanceWrapper objects so that they are sortable by"},{"line_number":52,"context_line":"    heapq.merge(), which requires that the \u0027\u003c\u0027 operator just works. We"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_9f117955","line":49,"range":{"start_line":49,"start_character":12,"end_line":49,"end_character":21},"updated":"2017-11-16 02:55:54.000000000","message":"ditto","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    This iterates cells in parallel generating a unified and sorted"},{"line_number":49,"context_line":"    list of instances as efficiently as possible. It takes care to"},{"line_number":50,"context_line":"    iterate the list as infrequently as possible. We wrap the results"},{"line_number":51,"context_line":"    in InstanceWrapper objects so that they are sortable by"},{"line_number":52,"context_line":"    heapq.merge(), which requires that the \u0027\u003c\u0027 operator just works. We"},{"line_number":53,"context_line":"    encapsulate our sorting requirements into an InstanceSortContext"},{"line_number":54,"context_line":"    which we pass to all of the wrappers so they behave the way we"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_1f2fc98e","line":51,"range":{"start_line":51,"start_character":6,"end_line":51,"end_character":21},"updated":"2017-11-16 02:55:54.000000000","message":"ditto","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    which we pass to all of the wrappers so they behave the way we"},{"line_number":55,"context_line":"    want."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    This function is a generator of instances from the database like what you"},{"line_number":58,"context_line":"    would get from instance_get_all_by_filters_sort() in the DB API."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    NOTE: Since we do these in parallel, a nonzero limit will be passed"},{"line_number":61,"context_line":"    to each database query, although the limit will be enforced in the"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_bf3d55c5","line":58,"range":{"start_line":57,"start_character":3,"end_line":58,"end_character":67},"updated":"2017-11-16 02:55:54.000000000","message":"should updated","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                                for key in sort_keys]"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def do_query(ctx):"},{"line_number":98,"context_line":"        \"\"\"Generate InstanceWrapper(Instance) objects from a cell."},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        We do this inside the thread (created by"},{"line_number":101,"context_line":"        scatter_gather_all_cells()) so that we return wrappers and"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_1f5469fe","line":98,"range":{"start_line":98,"start_character":19,"end_line":98,"end_character":46},"updated":"2017-11-16 02:55:54.000000000","message":"ditto","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        routine."},{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        # The local marker is a uuid of an instance in a cell that is found"},{"line_number":108,"context_line":"        # by the special method instance_get_by_sort_filters(). It should"},{"line_number":109,"context_line":"        # be the next instance in order according to the sort provided,"},{"line_number":110,"context_line":"        # but after the marker instance which may have been in another cell."}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_bf42f53c","line":107,"range":{"start_line":107,"start_character":43,"end_line":107,"end_character":51},"updated":"2017-11-16 02:55:54.000000000","message":"ditto","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bc354fc52a4b222cebef07f2696cd94ab0688e26","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        # The local marker is a uuid of an instance in a cell that is found"},{"line_number":108,"context_line":"        # by the special method instance_get_by_sort_filters(). It should"},{"line_number":109,"context_line":"        # be the next instance in order according to the sort provided,"},{"line_number":110,"context_line":"        # but after the marker instance which may have been in another cell."},{"line_number":111,"context_line":"        local_marker \u003d None"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1f485f77_9f3f39b3","line":109,"range":{"start_line":109,"start_character":21,"end_line":109,"end_character":31},"updated":"2017-11-16 02:55:54.000000000","message":"ditto","commit_id":"816ba4ce9c8872cf233de6acc6e1f35a34755e1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d9c8160c59d3596cf233dcd4289cd71b0c4006d5","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if marker:"},{"line_number":88,"context_line":"        # A marker UUID was provided from the API. Call this the \u0027global\u0027"},{"line_number":89,"context_line":"        # marker as it determines where we start the process across"},{"line_number":90,"context_line":"        # all cells. Look up the migration in whatever cell it is in and"},{"line_number":91,"context_line":"        # record the values for the sort keys so we can find the marker"},{"line_number":92,"context_line":"        # migration in each cell (called the \u0027local\u0027 marker)."},{"line_number":93,"context_line":"        global_marker_migration \u003d _get_marker_migration(ctx, marker)"},{"line_number":94,"context_line":"        global_marker_values \u003d [global_marker_migration[key]"},{"line_number":95,"context_line":"                                for key in sort_keys]"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def do_query(ctx):"},{"line_number":98,"context_line":"        \"\"\"Generate ObjectWrapper(migration) objects from a cell."}],"source_content_type":"text/x-python","patch_set":21,"id":"ff82abbf_cbef0b1c","line":95,"range":{"start_line":87,"start_character":4,"end_line":95,"end_character":53},"updated":"2017-11-27 22:38:12.000000000","message":"I think this is overly complex for what we need to do with paging migrations across cells. The reason we needed this for the instance paging was because we allow passing in sort_dirs and sort_keys for paging instances, so we need a consistent result set across cells where the user-provided sort_keys/dirs are provided by the user.\n\nBut in the case of GET /os-migrations, we aren\u0027t allowing the user to provide sort keys or direction, we hard-code that in the API.\n\nSo I think all we really need to do is when we get a marker, we find the cell to start paging in by iterating the cells and find the cell that contains the marker migration, and then we start applying limits/filters from there.\n\nI\u0027m thinking about how the instance paging code worked before the instance_list.py module:\n\nhttps://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2563\n\nThe difference is we\u0027d need to merge sort the results at the end but retain our \"next\" marker based on where we ended up in the last cell we processed.\n\nDoes that make sense?","commit_id":"6186443c8b9cc22809a48f50484d4dea2fef57d9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c11aed77d709f917d3ff9b17932af651e0eb14dc","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if marker:"},{"line_number":88,"context_line":"        # A marker UUID was provided from the API. Call this the \u0027global\u0027"},{"line_number":89,"context_line":"        # marker as it determines where we start the process across"},{"line_number":90,"context_line":"        # all cells. Look up the migration in whatever cell it is in and"},{"line_number":91,"context_line":"        # record the values for the sort keys so we can find the marker"},{"line_number":92,"context_line":"        # migration in each cell (called the \u0027local\u0027 marker)."},{"line_number":93,"context_line":"        global_marker_migration \u003d _get_marker_migration(ctx, marker)"},{"line_number":94,"context_line":"        global_marker_values \u003d [global_marker_migration[key]"},{"line_number":95,"context_line":"                                for key in sort_keys]"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def do_query(ctx):"},{"line_number":98,"context_line":"        \"\"\"Generate ObjectWrapper(migration) objects from a cell."}],"source_content_type":"text/x-python","patch_set":21,"id":"ff82abbf_da66bbbb","line":95,"range":{"start_line":87,"start_character":4,"end_line":95,"end_character":53},"in_reply_to":"ff82abbf_4d5468fe","updated":"2017-11-29 20:14:14.000000000","message":"\u003e I think the previous instance paging code is a little wired,see here: https://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2593 we travel all cells only one times, and skip the non-marker cell, so we will miss all results of the non-marker cells. And also here: https://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2601 We break the loop when limit is reach, but we still need more results on other cells, and finally we need do limit and sort, we can get back a global result at the end.\n\nThat code is all working how paging is supposed to work.\n\nREST API users don\u0027t pass in random markers. So what this code is doing:\n\nhttps://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2593\n\nIs iterating the cells until it finds the cell that contains the marker, and that\u0027s where we start paging for that request.\n\nThe limit is applied across cells until we either run out of results or the limit is reached, and we return, and the response to the caller has links for the next page.\n\nSo consider a case like this:\n\n* 2 cells with 10 instances in each cell\n* I list instances with a limit of 7, I should get 3 pages:\n* page1) 7 instances from cell1 with my marker in cell1\n* page2) 7 instances, 3 from cell1, 4 from cell2, marker is in cell2\n* page3) 6 instances, all from cell2, no marker since we\u0027re done (limit \u003e results)\n\nThe only thing that https://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2563 didn\u0027t do was merge sort the results, but merge sorting the results for migration results is going to be simpler for us since we control the sort keys, the user can\u0027t pass in sort keys.","commit_id":"6186443c8b9cc22809a48f50484d4dea2fef57d9"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"8022fb149f8f2fa38cecc0c0356d7a023265b62d","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if marker:"},{"line_number":88,"context_line":"        # A marker UUID was provided from the API. Call this the \u0027global\u0027"},{"line_number":89,"context_line":"        # marker as it determines where we start the process across"},{"line_number":90,"context_line":"        # all cells. Look up the migration in whatever cell it is in and"},{"line_number":91,"context_line":"        # record the values for the sort keys so we can find the marker"},{"line_number":92,"context_line":"        # migration in each cell (called the \u0027local\u0027 marker)."},{"line_number":93,"context_line":"        global_marker_migration \u003d _get_marker_migration(ctx, marker)"},{"line_number":94,"context_line":"        global_marker_values \u003d [global_marker_migration[key]"},{"line_number":95,"context_line":"                                for key in sort_keys]"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def do_query(ctx):"},{"line_number":98,"context_line":"        \"\"\"Generate ObjectWrapper(migration) objects from a cell."}],"source_content_type":"text/x-python","patch_set":21,"id":"ff82abbf_4d5468fe","line":95,"range":{"start_line":87,"start_character":4,"end_line":95,"end_character":53},"in_reply_to":"ff82abbf_cbef0b1c","updated":"2017-11-28 08:05:10.000000000","message":"\u003e So I think all we really need to do is when we get a marker, we find the cell to start paging in by iterating the cells and find the cell that contains the marker migration, and then we start applying limits/filters from there.\n\nYes, very agreed. I made the implement more complex, I pay more attention on local marker stuff in my previous cosideration.\n\n \u003e I\u0027m thinking about how the instance paging code worked before the instance_list.py module:\n \u003e https://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2563\n \u003e The difference is we\u0027d need to merge sort the results at the end but retain our \"next\" marker based on where we ended up in the last cell we processed.\n \u003e Does that make sense?\n\nI think the previous instance paging code is a little wired,see here:\nhttps://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2593\nwe travel all cells only one times, and skip the non-marker cell, so we will miss all results of the non-marker cells.\nAnd also here:\nhttps://github.com/openstack/nova/blob/stable/ocata/nova/compute/api.py#L2601\nWe break the loop when limit is reach, but we still need more results on other cells, and finally we need do limit and sort, we can get back a global result at the end.\n\nAs the first reply, I agreed that, we really need to do is: \n\n1. first, we get a marker, \n\n2. then, travel all cells using this marker, and get all results from all cells\nwe also need do some specific process in db, like:\nhttps://review.openstack.org/#/c/517273/24/nova/db/sqlalchemy/api.py\n\nIt\u0027s okay? The mark can be str(uuid) or real marker, we only get marker by uuid when the marker is str, otherwise, we just use the input marker which we get from here:\nhttps://review.openstack.org/#/c/517273/25/nova/compute/migration_list.py\n\n3. do limit and sort stuff.\n\n\nAnd I do all above steps in PS25, and all cases works well.","commit_id":"6186443c8b9cc22809a48f50484d4dea2fef57d9"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"78e7b6b6773a89ebf4112cb0e2190699fe55752d","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if marker:"},{"line_number":88,"context_line":"        # A marker UUID was provided from the API. Call this the \u0027global\u0027"},{"line_number":89,"context_line":"        # marker as it determines where we start the process across"},{"line_number":90,"context_line":"        # all cells. Look up the migration in whatever cell it is in and"},{"line_number":91,"context_line":"        # record the values for the sort keys so we can find the marker"},{"line_number":92,"context_line":"        # migration in each cell (called the \u0027local\u0027 marker)."},{"line_number":93,"context_line":"        global_marker_migration \u003d _get_marker_migration(ctx, marker)"},{"line_number":94,"context_line":"        global_marker_values \u003d [global_marker_migration[key]"},{"line_number":95,"context_line":"                                for key in sort_keys]"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def do_query(ctx):"},{"line_number":98,"context_line":"        \"\"\"Generate ObjectWrapper(migration) objects from a cell."}],"source_content_type":"text/x-python","patch_set":21,"id":"ff82abbf_51ba89c0","line":95,"range":{"start_line":87,"start_character":4,"end_line":95,"end_character":53},"in_reply_to":"ff82abbf_da66bbbb","updated":"2017-11-30 03:37:08.000000000","message":"I still a bit confusing in instance list(ocata), I think your case assume that all cell1 records is sorted before cell2 records, but what if we find marker in cell2, and we still have some records in cell1 are not given to user.\n\nsuch as:\ncell1: inst0(create at 00:00) inst3(create at 00:03)\ncell2: inst1(create at 00:01) inst2(create at 00:02)\n\nlimit \u003d 2, marker \u003d inst2 sort by desc created_at\nwe need get: inst1, inst0\n\nBut if we use instance list(ocata), we will only get inst1, because we can\u0027t find the marker in cell1, and skip. so inst0 is missed.\n\n(reply in PS21)","commit_id":"6186443c8b9cc22809a48f50484d4dea2fef57d9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ea0fc00b4032a8f5f75b4556879727a0e0bc341","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    nova_context.load_cells()"},{"line_number":70,"context_line":"    migrations \u003d []"},{"line_number":71,"context_line":"    for cell in nova_context.CELLS:"},{"line_number":72,"context_line":"        if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":73,"context_line":"            continue"},{"line_number":74,"context_line":"        with nova_context.target_cell(ctx, cell) as cctx:"},{"line_number":75,"context_line":"            migs \u003d db.migration_get_all_by_filters("},{"line_number":76,"context_line":"                cctx, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":77,"context_line":"                limit\u003dlimit, marker\u003dmarker_migration)"},{"line_number":78,"context_line":"            migrations.extend(migs)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":81,"context_line":"    sort_wrapper \u003d ObjectWrapper"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_1acd0384","line":78,"range":{"start_line":71,"start_character":4,"end_line":78,"end_character":35},"updated":"2017-11-29 20:20:49.000000000","message":"So this is essentially now this method:\n\nhttps://review.openstack.org/#/c/517273/25/nova/compute/api.py@4012\n\nWhy don\u0027t we just do the marker/limit/sort in the existing compute API method? That\u0027s how I originally thought we\u0027d handle this.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf3233ce32ff726d204f439b45c12e93f65f9597","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    nova_context.load_cells()"},{"line_number":70,"context_line":"    migrations \u003d []"},{"line_number":71,"context_line":"    for cell in nova_context.CELLS:"},{"line_number":72,"context_line":"        if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":73,"context_line":"            continue"},{"line_number":74,"context_line":"        with nova_context.target_cell(ctx, cell) as cctx:"},{"line_number":75,"context_line":"            migs \u003d db.migration_get_all_by_filters("},{"line_number":76,"context_line":"                cctx, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":77,"context_line":"                limit\u003dlimit, marker\u003dmarker_migration)"},{"line_number":78,"context_line":"            migrations.extend(migs)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":81,"context_line":"    sort_wrapper \u003d ObjectWrapper"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_7a91af46","line":78,"range":{"start_line":71,"start_character":4,"end_line":78,"end_character":35},"in_reply_to":"ff82abbf_1acd0384","updated":"2017-11-29 20:24:11.000000000","message":"You\u0027re not even using this new MigrationList object method now:\n\nhttps://review.openstack.org/#/c/514904/24/nova/objects/migration.py@219","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"96c022eebab86e669285a5a4077992f99684f588","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    nova_context.load_cells()"},{"line_number":70,"context_line":"    migrations \u003d []"},{"line_number":71,"context_line":"    for cell in nova_context.CELLS:"},{"line_number":72,"context_line":"        if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":73,"context_line":"            continue"},{"line_number":74,"context_line":"        with nova_context.target_cell(ctx, cell) as cctx:"},{"line_number":75,"context_line":"            migs \u003d db.migration_get_all_by_filters("},{"line_number":76,"context_line":"                cctx, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":77,"context_line":"                limit\u003dlimit, marker\u003dmarker_migration)"},{"line_number":78,"context_line":"            migrations.extend(migs)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":81,"context_line":"    sort_wrapper \u003d ObjectWrapper"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_9d302d58","line":78,"range":{"start_line":71,"start_character":4,"end_line":78,"end_character":35},"in_reply_to":"ff82abbf_7a91af46","updated":"2017-11-29 21:23:49.000000000","message":"We talked about this a bit in today\u0027s cellsv2 meeting:\n\nhttp://eavesdrop.openstack.org/meetings/nova_cells/2017/nova_cells.2017-11-29-21.00.log.html#l-59\n\nI can\u0027t say I\u0027m following everything Dan is suggesting in there, so probably need him to comment here.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"36cb9131408467d1401b5a494c7b0131806b5bd1","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    nova_context.load_cells()"},{"line_number":70,"context_line":"    migrations \u003d []"},{"line_number":71,"context_line":"    for cell in nova_context.CELLS:"},{"line_number":72,"context_line":"        if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":73,"context_line":"            continue"},{"line_number":74,"context_line":"        with nova_context.target_cell(ctx, cell) as cctx:"},{"line_number":75,"context_line":"            migs \u003d db.migration_get_all_by_filters("},{"line_number":76,"context_line":"                cctx, filters, sort_keys\u003dsort_keys, sort_dirs\u003dsort_dirs,"},{"line_number":77,"context_line":"                limit\u003dlimit, marker\u003dmarker_migration)"},{"line_number":78,"context_line":"            migrations.extend(migs)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    sort_ctx \u003d ObjectSortContext(sort_keys, sort_dirs)"},{"line_number":81,"context_line":"    sort_wrapper \u003d ObjectWrapper"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_9e57c026","line":78,"range":{"start_line":71,"start_character":4,"end_line":78,"end_character":35},"in_reply_to":"ff82abbf_9d302d58","updated":"2017-11-30 03:20:47.000000000","message":"\u003e You\u0027re not even using this new MigrationList object method now:\n\u003e https://review.openstack.org/#/c/514904/24/nova/objects/migration.py@219\n\nSorry, api needs should call object method. I will fix it and use it in `def get_migrations`.\n\n\u003e We talked about this a bit in today\u0027s cellsv2 meeting:\nhttp://eavesdrop.openstack.org/meetings/nova_cells/2017/nova_cells.2017-11-29-21.00.log.html#l-59\n\u003e I can\u0027t say I\u0027m following everything Dan is suggesting in there, so probably need him to comment here.\n\nMatt, really much thanks for your help, and I think Dans maybe means we can do get_migrations from each cell in parallel using context.scatter_gather_all_cells(), and after this, we can merge all results at end.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"47141e6cc37bd6a8bc46e5010cc9c0f0822a949d","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        This returns the marker migration from the cell in which it lives"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        results \u003d context.scatter_gather_all_cells("},{"line_number":58,"context_line":"            ctx, db.migration_get_by_uuid, marker)"},{"line_number":59,"context_line":"        db_migration \u003d None"},{"line_number":60,"context_line":"        for cell_uuid, result in results.items():"}],"source_content_type":"text/x-python","patch_set":34,"id":"bf8cb3f7_3fa0aaf4","line":57,"range":{"start_line":57,"start_character":26,"end_line":57,"end_character":50},"updated":"2017-12-23 06:57:06.000000000","message":"consider using scatter_gather_skip_cell0()? as there will be no migrations in cell0. But as it is done in parallel maybe it makes no difference","commit_id":"cc5bda0ef5326571e6eeca0d264f300149df78f4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"4a3c16020b0f608e8903f097e70c398a34312fdf","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        This returns the marker migration from the cell in which it lives"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        results \u003d context.scatter_gather_all_cells("},{"line_number":58,"context_line":"            ctx, db.migration_get_by_uuid, marker)"},{"line_number":59,"context_line":"        db_migration \u003d None"},{"line_number":60,"context_line":"        for cell_uuid, result in results.items():"}],"source_content_type":"text/x-python","patch_set":34,"id":"bf8cb3f7_7f5152d8","line":57,"range":{"start_line":57,"start_character":26,"end_line":57,"end_character":50},"in_reply_to":"bf8cb3f7_3fa0aaf4","updated":"2017-12-23 07:11:40.000000000","message":"Done","commit_id":"cc5bda0ef5326571e6eeca0d264f300149df78f4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":26,"context_line":"            sort_keys \u003d [\u0027created_at\u0027, \u0027id\u0027]"},{"line_number":27,"context_line":"            sort_dirs \u003d [\u0027desc\u0027, \u0027desc\u0027]"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        if \u0027uuid\u0027 not in sort_keys:"},{"line_number":30,"context_line":"            # Historically the default sort includes \u0027id\u0027 (see above), which"},{"line_number":31,"context_line":"            # should give us a stable ordering. Since we\u0027re striping across"},{"line_number":32,"context_line":"            # cell databases here, many sort_keys arrangements will yield"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_d8ee8887","line":29,"updated":"2018-01-02 17:21:15.000000000","message":"I\u0027m not sure how much we really need this since we aren\u0027t allowing the user to pass in random sort keys, so we control the sort keys and directions since they get hard-coded in the API patch on top of this, but I guess it doesn\u0027t hurt to leave this in here.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                db_migration \u003d result"},{"line_number":64,"context_line":"                break"},{"line_number":65,"context_line":"        if not db_migration:"},{"line_number":66,"context_line":"            raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":67,"context_line":"        return db_migration"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_marker_by_values(self, ctx, values):"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_7340bf36","line":66,"updated":"2018-01-02 17:21:15.000000000","message":"There is no test for this case.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"0bcfe4b37055b11f45778846dbf0bd56bc073a44","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                db_migration \u003d result"},{"line_number":64,"context_line":"                break"},{"line_number":65,"context_line":"        if not db_migration:"},{"line_number":66,"context_line":"            raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":67,"context_line":"        return db_migration"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_marker_by_values(self, ctx, values):"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_2941470c","line":66,"in_reply_to":"9f91af0f_7340bf36","updated":"2018-01-04 08:05:13.000000000","message":"Done","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            sort_dirs\u003dself.sort_ctx.sort_dirs)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def get_migration_objects_sorted(ctx, filters, limit, marker,"},{"line_number":83,"context_line":"                                 sort_keys, sort_dirs):"},{"line_number":84,"context_line":"    mig_generator \u003d MigrationLister(sort_keys, sort_dirs).get_records_sorted("},{"line_number":85,"context_line":"        ctx, filters, limit, marker)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_9366a3ed","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":52},"updated":"2018-01-02 17:21:15.000000000","message":"I don\u0027t see any test to make sure the limit is enforced.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"0bcfe4b37055b11f45778846dbf0bd56bc073a44","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            sort_dirs\u003dself.sort_ctx.sort_dirs)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def get_migration_objects_sorted(ctx, filters, limit, marker,"},{"line_number":83,"context_line":"                                 sort_keys, sort_dirs):"},{"line_number":84,"context_line":"    mig_generator \u003d MigrationLister(sort_keys, sort_dirs).get_records_sorted("},{"line_number":85,"context_line":"        ctx, filters, limit, marker)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_4944cb1b","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":52},"in_reply_to":"9f91af0f_9366a3ed","updated":"2018-01-04 08:05:13.000000000","message":"Done","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0dc0805ae282bc541d9c4ed6fca2a460be9738a7","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            sort_dirs \u003d [\u0027desc\u0027, \u0027desc\u0027]"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        if \u0027uuid\u0027 not in sort_keys:"},{"line_number":30,"context_line":"            # Historically the default sort includes \u0027id\u0027 (see above), which"},{"line_number":31,"context_line":"            # should give us a stable ordering. Since we\u0027re striping across"},{"line_number":32,"context_line":"            # cell databases here, many sort_keys arrangements will yield"},{"line_number":33,"context_line":"            # nothing unique across all the databases to give us a stable"}],"source_content_type":"text/x-python","patch_set":39,"id":"9f91af0f_954d999b","line":30,"range":{"start_line":30,"start_character":12,"end_line":30,"end_character":76},"updated":"2018-01-09 17:39:55.000000000","message":"This isn\u0027t right since we don\u0027t have any historical behavior for this, AFAIK. So I think this should probably be removed and just roll uuid into the set of keys if it\u0027s not present to avoid ambiguity due to overlapping ids in cells.\n\nCan you follow-up with a tweak to this comment for posterity?","commit_id":"8c093b75162bce0a0a5e027b1aa75896b0d6e4fc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"62948075d06fb7f5da2dc412d0afca4a9d71941a","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            sort_dirs \u003d [\u0027desc\u0027, \u0027desc\u0027]"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        if \u0027uuid\u0027 not in sort_keys:"},{"line_number":30,"context_line":"            # Historically the default sort includes \u0027id\u0027 (see above), which"},{"line_number":31,"context_line":"            # should give us a stable ordering. Since we\u0027re striping across"},{"line_number":32,"context_line":"            # cell databases here, many sort_keys arrangements will yield"},{"line_number":33,"context_line":"            # nothing unique across all the databases to give us a stable"}],"source_content_type":"text/x-python","patch_set":39,"id":"9f91af0f_8a625309","line":30,"range":{"start_line":30,"start_character":12,"end_line":30,"end_character":76},"in_reply_to":"9f91af0f_954d999b","updated":"2018-01-09 20:33:30.000000000","message":"Done","commit_id":"8c093b75162bce0a0a5e027b1aa75896b0d6e4fc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"38279f8d02e0344dfb9c12f61486bbdf192f01e5","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            sort_dirs \u003d [\u0027desc\u0027, \u0027desc\u0027]"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        if \u0027uuid\u0027 not in sort_keys:"},{"line_number":30,"context_line":"            # Add uuid into the list of sort_keys which Since we\u0027re striping"},{"line_number":31,"context_line":"            # across cell databases here, many sort_keys arrangements will"},{"line_number":32,"context_line":"            # yield nothing unique across all the databases to give us a stable"},{"line_number":33,"context_line":"            # ordering, which can mess up expected client pagination behavior."}],"source_content_type":"text/x-python","patch_set":40,"id":"9f91af0f_ed42190f","line":30,"range":{"start_line":30,"start_character":49,"end_line":30,"end_character":62},"updated":"2018-01-09 20:41:09.000000000","message":"Looks like maybe there\u0027s something missing here after splicing things up? :)","commit_id":"55f59172ee708b0f927b08146bc76219715b3662"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d6821d5ffbac25341ea6c5c3438dbcc4b3b9b877","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            sort_dirs \u003d [\u0027desc\u0027, \u0027desc\u0027]"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        if \u0027uuid\u0027 not in sort_keys:"},{"line_number":30,"context_line":"            # Add uuid into the list of sort_keys which Since we\u0027re striping"},{"line_number":31,"context_line":"            # across cell databases here, many sort_keys arrangements will"},{"line_number":32,"context_line":"            # yield nothing unique across all the databases to give us a stable"},{"line_number":33,"context_line":"            # ordering, which can mess up expected client pagination behavior."}],"source_content_type":"text/x-python","patch_set":40,"id":"9f91af0f_db6b4bee","line":30,"range":{"start_line":30,"start_character":49,"end_line":30,"end_character":62},"in_reply_to":"9f91af0f_ed42190f","updated":"2018-01-09 23:00:03.000000000","message":"ugh, will fix it on top","commit_id":"55f59172ee708b0f927b08146bc76219715b3662"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ea0fc00b4032a8f5f75b4556879727a0e0bc341","unresolved":false,"context_lines":[{"line_number":4933,"context_line":"    if \"instance_uuid\" in filters:"},{"line_number":4934,"context_line":"        instance_uuid \u003d filters[\"instance_uuid\"]"},{"line_number":4935,"context_line":"        query \u003d query.filter(models.Migration.instance_uuid \u003d\u003d instance_uuid)"},{"line_number":4936,"context_line":"    if marker and isinstance(marker, six.string_types):"},{"line_number":4937,"context_line":"        try:"},{"line_number":4938,"context_line":"            marker \u003d migration_get_by_uuid(context, marker)"},{"line_number":4939,"context_line":"        except exception.MigrationNotFound:"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_ba9c176a","line":4936,"range":{"start_line":4936,"start_character":14,"end_line":4936,"end_character":54},"updated":"2017-11-29 20:20:49.000000000","message":"What is this check for? When would the marker not be a string?","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a670702439c38ebbaf52afa34efddf3486e5485b","unresolved":false,"context_lines":[{"line_number":4933,"context_line":"    if \"instance_uuid\" in filters:"},{"line_number":4934,"context_line":"        instance_uuid \u003d filters[\"instance_uuid\"]"},{"line_number":4935,"context_line":"        query \u003d query.filter(models.Migration.instance_uuid \u003d\u003d instance_uuid)"},{"line_number":4936,"context_line":"    if marker and isinstance(marker, six.string_types):"},{"line_number":4937,"context_line":"        try:"},{"line_number":4938,"context_line":"            marker \u003d migration_get_by_uuid(context, marker)"},{"line_number":4939,"context_line":"        except exception.MigrationNotFound:"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_fd2939e5","line":4936,"range":{"start_line":4936,"start_character":14,"end_line":4936,"end_character":54},"in_reply_to":"ff82abbf_ba9c176a","updated":"2017-11-29 21:26:00.000000000","message":"I see it now, the scatter/gather code in migration_list is finding the migration record from the cell and passing it in as the marker here, so we don\u0027t need to look it up since we already got it. That\u0027s pretty confusing though.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"36cb9131408467d1401b5a494c7b0131806b5bd1","unresolved":false,"context_lines":[{"line_number":4933,"context_line":"    if \"instance_uuid\" in filters:"},{"line_number":4934,"context_line":"        instance_uuid \u003d filters[\"instance_uuid\"]"},{"line_number":4935,"context_line":"        query \u003d query.filter(models.Migration.instance_uuid \u003d\u003d instance_uuid)"},{"line_number":4936,"context_line":"    if marker and isinstance(marker, six.string_types):"},{"line_number":4937,"context_line":"        try:"},{"line_number":4938,"context_line":"            marker \u003d migration_get_by_uuid(context, marker)"},{"line_number":4939,"context_line":"        except exception.MigrationNotFound:"}],"source_content_type":"text/x-python","patch_set":25,"id":"ff82abbf_3edeb43d","line":4936,"range":{"start_line":4936,"start_character":14,"end_line":4936,"end_character":54},"in_reply_to":"ff82abbf_fd2939e5","updated":"2017-11-30 03:20:47.000000000","message":"This change is used to get records in all cells using a global marker which we get in here:\nhttps://review.openstack.org/#/c/517273/25/nova/compute/migration_list.py@67 \n\nAlthough the global marker is not exsit in your own cell(in other cell),\nwe can also filter the records in your own cell using this marker without MigrationNotFound raising.","commit_id":"02c6cff84178f176988ce35342a22bb1f5fd6eab"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e5930a771b565cbc598428ad8f552b173389b9","unresolved":false,"context_lines":[{"line_number":4933,"context_line":"    if \"instance_uuid\" in filters:"},{"line_number":4934,"context_line":"        instance_uuid \u003d filters[\"instance_uuid\"]"},{"line_number":4935,"context_line":"        query \u003d query.filter(models.Migration.instance_uuid \u003d\u003d instance_uuid)"},{"line_number":4936,"context_line":"    if marker and isinstance(marker, six.string_types):"},{"line_number":4937,"context_line":"        try:"},{"line_number":4938,"context_line":"            marker \u003d migration_get_by_uuid(context, marker)"},{"line_number":4939,"context_line":"        except exception.MigrationNotFound:"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_cc759034","line":4936,"updated":"2017-11-30 15:45:51.000000000","message":"Why is this necessary?","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38e5d59b98963efced5d8d41ceb6f548148caa97","unresolved":false,"context_lines":[{"line_number":4933,"context_line":"    if \"instance_uuid\" in filters:"},{"line_number":4934,"context_line":"        instance_uuid \u003d filters[\"instance_uuid\"]"},{"line_number":4935,"context_line":"        query \u003d query.filter(models.Migration.instance_uuid \u003d\u003d instance_uuid)"},{"line_number":4936,"context_line":"    if marker and isinstance(marker, six.string_types):"},{"line_number":4937,"context_line":"        try:"},{"line_number":4938,"context_line":"            marker \u003d migration_get_by_uuid(context, marker)"},{"line_number":4939,"context_line":"        except exception.MigrationNotFound:"}],"source_content_type":"text/x-python","patch_set":27,"id":"ff82abbf_ff103852","line":4936,"in_reply_to":"ff82abbf_cc759034","updated":"2017-11-30 16:00:08.000000000","message":"I asked the same thing in an earlier patch set. It\u0027s because he\u0027s finding the actual db migration record at the top and passing that as the marker down through here:\n\nhttps://review.openstack.org/#/c/517273/27/nova/compute/api.py@4109\n\nSo like what we\u0027d do here if marker was a UUID passed from the API, but in this case he\u0027s already done that work in the API. I\u0027m not really sure why, because as noted in the API code, this marker won\u0027t exist in other cells.","commit_id":"d50484826c219e2bf68e0b51ceedf22b84c52bda"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":2272,"context_line":"                                      values)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":""},{"line_number":2275,"context_line":"def _model_get_by_sort_filters(context, model, sort_keys, sort_dirs, values):"},{"line_number":2276,"context_line":"    query \u003d context.session.query(model.uuid)"},{"line_number":2277,"context_line":""},{"line_number":2278,"context_line":"    # NOTE(danms): Below is a re-implementation of our"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_186870f3","line":2275,"range":{"start_line":2275,"start_character":4,"end_line":2275,"end_character":30},"updated":"2018-01-02 17:21:15.000000000","message":"nit: this might be better named \"_model_get_uuid_by_sort_filters\"","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"0bcfe4b37055b11f45778846dbf0bd56bc073a44","unresolved":false,"context_lines":[{"line_number":2272,"context_line":"                                      values)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":""},{"line_number":2275,"context_line":"def _model_get_by_sort_filters(context, model, sort_keys, sort_dirs, values):"},{"line_number":2276,"context_line":"    query \u003d context.session.query(model.uuid)"},{"line_number":2277,"context_line":""},{"line_number":2278,"context_line":"    # NOTE(danms): Below is a re-implementation of our"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_8f83b8cc","line":2275,"range":{"start_line":2275,"start_character":4,"end_line":2275,"end_character":30},"in_reply_to":"9f91af0f_186870f3","updated":"2018-01-04 08:05:13.000000000","message":"Done","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":4376,"context_line":"        return []"},{"line_number":4377,"context_line":""},{"line_number":4378,"context_line":"    query \u003d model_query(context, models.Migration)"},{"line_number":4379,"context_line":"    if \"uuid\" in filters:"},{"line_number":4380,"context_line":"        uuid \u003d filters[\"uuid\"]"},{"line_number":4381,"context_line":"        uuid \u003d [uuid] if isinstance(uuid, six.string_types) else uuid"},{"line_number":4382,"context_line":"        query \u003d query.filter(models.Migration.uuid.in_(uuid))"},{"line_number":4383,"context_line":"    if \u0027changes-since\u0027 in filters:"},{"line_number":4384,"context_line":"        changes_since \u003d timeutils.normalize_time(filters[\u0027changes-since\u0027])"},{"line_number":4385,"context_line":"        query \u003d query. \\"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_587d98af","line":4382,"range":{"start_line":4379,"start_character":4,"end_line":4382,"end_character":61},"updated":"2018-01-02 17:21:15.000000000","message":"Why is this in here? And why would uuid not be a string type?","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cbe533bd1fb73d0ad457b36ef580e34c6407bb43","unresolved":false,"context_lines":[{"line_number":4376,"context_line":"        return []"},{"line_number":4377,"context_line":""},{"line_number":4378,"context_line":"    query \u003d model_query(context, models.Migration)"},{"line_number":4379,"context_line":"    if \"uuid\" in filters:"},{"line_number":4380,"context_line":"        uuid \u003d filters[\"uuid\"]"},{"line_number":4381,"context_line":"        uuid \u003d [uuid] if isinstance(uuid, six.string_types) else uuid"},{"line_number":4382,"context_line":"        query \u003d query.filter(models.Migration.uuid.in_(uuid))"},{"line_number":4383,"context_line":"    if \u0027changes-since\u0027 in filters:"},{"line_number":4384,"context_line":"        changes_since \u003d timeutils.normalize_time(filters[\u0027changes-since\u0027])"},{"line_number":4385,"context_line":"        query \u003d query. \\"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_428b301e","line":4382,"range":{"start_line":4379,"start_character":4,"end_line":4382,"end_character":61},"in_reply_to":"9f91af0f_02ac489e","updated":"2018-01-05 00:23:28.000000000","message":"BTW, it would probably be good to leave a comment here if you need to respin, to explain this.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"0bcfe4b37055b11f45778846dbf0bd56bc073a44","unresolved":false,"context_lines":[{"line_number":4376,"context_line":"        return []"},{"line_number":4377,"context_line":""},{"line_number":4378,"context_line":"    query \u003d model_query(context, models.Migration)"},{"line_number":4379,"context_line":"    if \"uuid\" in filters:"},{"line_number":4380,"context_line":"        uuid \u003d filters[\"uuid\"]"},{"line_number":4381,"context_line":"        uuid \u003d [uuid] if isinstance(uuid, six.string_types) else uuid"},{"line_number":4382,"context_line":"        query \u003d query.filter(models.Migration.uuid.in_(uuid))"},{"line_number":4383,"context_line":"    if \u0027changes-since\u0027 in filters:"},{"line_number":4384,"context_line":"        changes_since \u003d timeutils.normalize_time(filters[\u0027changes-since\u0027])"},{"line_number":4385,"context_line":"        query \u003d query. \\"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_8f35f848","line":4382,"range":{"start_line":4379,"start_character":4,"end_line":4382,"end_character":61},"in_reply_to":"9f91af0f_587d98af","updated":"2018-01-04 08:05:13.000000000","message":"I had same question on it, and Dans has replied on here: \nhttps://review.openstack.org/#/c/524302/2/nova/compute/multi_cell_list.py@223\n\nSo, now in migration_get, both `uuid` and `[uuid]` are supported, and in this case, the uuid filters can be list(like `[uuid]`).","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5b75aa942b129462eb57bddc405cb1726dc0b8ea","unresolved":false,"context_lines":[{"line_number":4376,"context_line":"        return []"},{"line_number":4377,"context_line":""},{"line_number":4378,"context_line":"    query \u003d model_query(context, models.Migration)"},{"line_number":4379,"context_line":"    if \"uuid\" in filters:"},{"line_number":4380,"context_line":"        uuid \u003d filters[\"uuid\"]"},{"line_number":4381,"context_line":"        uuid \u003d [uuid] if isinstance(uuid, six.string_types) else uuid"},{"line_number":4382,"context_line":"        query \u003d query.filter(models.Migration.uuid.in_(uuid))"},{"line_number":4383,"context_line":"    if \u0027changes-since\u0027 in filters:"},{"line_number":4384,"context_line":"        changes_since \u003d timeutils.normalize_time(filters[\u0027changes-since\u0027])"},{"line_number":4385,"context_line":"        query \u003d query. \\"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_02ac489e","line":4382,"range":{"start_line":4379,"start_character":4,"end_line":4382,"end_character":61},"in_reply_to":"9f91af0f_8f35f848","updated":"2018-01-05 00:21:52.000000000","message":"OK thanks.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0dc0805ae282bc541d9c4ed6fca2a460be9738a7","unresolved":false,"context_lines":[{"line_number":4407,"context_line":"    if \"uuid\" in filters:"},{"line_number":4408,"context_line":"        uuid \u003d filters[\"uuid\"]"},{"line_number":4409,"context_line":"        uuid \u003d [uuid] if isinstance(uuid, six.string_types) else uuid"},{"line_number":4410,"context_line":"        query \u003d query.filter(models.Migration.uuid.in_(uuid))"},{"line_number":4411,"context_line":"    if \u0027changes-since\u0027 in filters:"},{"line_number":4412,"context_line":"        changes_since \u003d timeutils.normalize_time(filters[\u0027changes-since\u0027])"},{"line_number":4413,"context_line":"        query \u003d query. \\"}],"source_content_type":"text/x-python","patch_set":39,"id":"9f91af0f_30685bb7","line":4410,"updated":"2018-01-09 17:39:55.000000000","message":"Technically this should have been in the previous patch I think, as this affects the rpc interface of the object, and a version bump would be nice to signal that.","commit_id":"8c093b75162bce0a0a5e027b1aa75896b0d6e4fc"}],"nova/tests/functional/compute/test_migration_list.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ccab249b61a3a33d01891d0a4533fa508bc38ec","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        filters \u003d {}"},{"line_number":55,"context_line":"        limit \u003d None"},{"line_number":56,"context_line":"        marker \u003d None"},{"line_number":57,"context_line":"        sort_keys \u003d [\u0027uuid\u0027]"},{"line_number":58,"context_line":"        sort_dirs \u003d [\u0027asc\u0027]"},{"line_number":59,"context_line":"        migs \u003d migration_list.get_migration_objects_sorted("},{"line_number":60,"context_line":"            self.context, filters, limit, marker,"},{"line_number":61,"context_line":"            sort_keys, sort_dirs)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f91af0f_9338e3d3","line":58,"range":{"start_line":57,"start_character":8,"end_line":58,"end_character":27},"updated":"2018-01-02 17:21:15.000000000","message":"Part of me thinks we should use the hard-coded keys/directions from the API patch on top of this in the series, but I know these are used for predictable sort order for this test.","commit_id":"8f013f8ea5bdf4de239840915ff879c831e669a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0dc0805ae282bc541d9c4ed6fca2a460be9738a7","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        start \u003d datetime.datetime(1985, 10, 25, 1, 21, 0)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"        self.cells \u003d objects.CellMappingList.get_all(self.context)"},{"line_number":34,"context_line":"        # Create three migrations in each of the real cells. Leave the"},{"line_number":35,"context_line":"        # first cell empty to make sure we don\u0027t break with an empty"},{"line_number":36,"context_line":"        # one."}],"source_content_type":"text/x-python","patch_set":39,"id":"9f91af0f_70110304","line":33,"updated":"2018-01-09 17:39:55.000000000","message":"Unless you set NUMBER_OF_CELLS, this won\u0027t be enough to test things.","commit_id":"8c093b75162bce0a0a5e027b1aa75896b0d6e4fc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"62948075d06fb7f5da2dc412d0afca4a9d71941a","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        start \u003d datetime.datetime(1985, 10, 25, 1, 21, 0)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"        self.cells \u003d objects.CellMappingList.get_all(self.context)"},{"line_number":34,"context_line":"        # Create three migrations in each of the real cells. Leave the"},{"line_number":35,"context_line":"        # first cell empty to make sure we don\u0027t break with an empty"},{"line_number":36,"context_line":"        # one."}],"source_content_type":"text/x-python","patch_set":39,"id":"9f91af0f_ed71b9a9","line":33,"in_reply_to":"9f91af0f_70110304","updated":"2018-01-09 20:33:30.000000000","message":"Done","commit_id":"8c093b75162bce0a0a5e027b1aa75896b0d6e4fc"}]}
