)]}'
{"nova/objects/flavor.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"08fae2ecc5225b4d2078471f3d0b7bb5f934510a","unresolved":false,"context_lines":[{"line_number":406,"context_line":"                        filter_by(flavorid\u003dmarker).\\"},{"line_number":407,"context_line":"                        first()"},{"line_number":408,"context_line":"            if not marker_row:"},{"line_number":409,"context_line":"                pass"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        query \u003d sqlalchemyutils.paginate_query(query, api_models.Flavors,"},{"line_number":412,"context_line":"                                           limit,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_b2370afe","line":409,"updated":"2016-03-17 20:35:23.000000000","message":"If marker_row is not found here wouldn\u0027t that mean it\u0027s in the cell db and we should bail early here?","commit_id":"1eef00d1b542bc699f57e94fe026fd5118eaca5b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5af1f42f5c384c5cbaba403a8910ecb5547d85af","unresolved":false,"context_lines":[{"line_number":406,"context_line":"                        filter_by(flavorid\u003dmarker).\\"},{"line_number":407,"context_line":"                        first()"},{"line_number":408,"context_line":"            if not marker_row:"},{"line_number":409,"context_line":"                pass"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        query \u003d sqlalchemyutils.paginate_query(query, api_models.Flavors,"},{"line_number":412,"context_line":"                                           limit,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d80e308b","line":409,"in_reply_to":"1af94dfe_b2370afe","updated":"2016-03-17 23:39:28.000000000","message":"Yes? Didn\u0027t I say something about not caring about these details?\n\nI\u0027ll return here.","commit_id":"1eef00d1b542bc699f57e94fe026fd5118eaca5b"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"15f42327e6b17902970afea58b6415108aa8bff8","unresolved":false,"context_lines":[{"line_number":406,"context_line":"                        filter_by(flavorid\u003dmarker).\\"},{"line_number":407,"context_line":"                        first()"},{"line_number":408,"context_line":"            if not marker_row:"},{"line_number":409,"context_line":"                pass"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        query \u003d sqlalchemyutils.paginate_query(query, api_models.Flavors,"},{"line_number":412,"context_line":"                                           limit,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_9d859bd0","line":409,"in_reply_to":"1af94dfe_d80e308b","updated":"2016-03-18 13:50:25.000000000","message":"That\u0027s fair, this shouldn\u0027t come up in practice. But the implementation is so close to looking like it should work that doing the right thing here would be good.","commit_id":"1eef00d1b542bc699f57e94fe026fd5118eaca5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2413dd09655ff72d3dce4db5cf29b1b2f630b780","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                query \u003d query.filter(or_(*the_filter))"},{"line_number":401,"context_line":"            else:"},{"line_number":402,"context_line":"                query \u003d query.filter(the_filter[0])"},{"line_number":403,"context_line":"        marker_row \u003d None"},{"line_number":404,"context_line":"        if marker is not None:"},{"line_number":405,"context_line":"            marker_row \u003d Flavor._flavor_get_query_from_db(context).\\"},{"line_number":406,"context_line":"                        filter_by(flavorid\u003dmarker).\\"},{"line_number":407,"context_line":"                        first()"},{"line_number":408,"context_line":"            if not marker_row:"},{"line_number":409,"context_line":"                return []"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        query \u003d sqlalchemyutils.paginate_query(query, api_models.Flavors,"},{"line_number":412,"context_line":"                                           limit,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_0ede066d","line":409,"range":{"start_line":403,"start_character":8,"end_line":409,"end_character":25},"updated":"2016-03-21 21:30:55.000000000","message":"I know this is just matching what\u0027s in the cell db api:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L5041\n\nIt just seems weird that we do all of the above work and then check the marker, seems we should do that before the above stuff. But we\u0027re just building query objects, we\u0027re not actually querying the database yet so it\u0027s not like it makes a big perf impact.\n\n--\n\nAlso, we raise a NotFound if the marker isn\u0027t found in the cell DB today:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L5047\n\nBut here we return an empty list to allow us to check the cell DB (maybe we don\u0027t have any flavors migrated to the API DB yet). And if the marker isn\u0027t in the cell DB, we\u0027d still return that MarkerNotFound exception, so we don\u0027t have an API change here that I see, it should all be seamless.\n\n--\n\nHaving said all of this, I think the unit test for the marker case is a bit light, this kind of seems like something we should have a functional test for, where the marker flavor isn\u0027t in the API DB but is in the cell DB so it\u0027s returned, and a case where it\u0027s not in either and fails with a 404.","commit_id":"f20233e7a32a0ed03af9647509ed0e24e40062d8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c766e0a2850ea989f34bb825fbc5436ca5ba2b2a","unresolved":false,"context_lines":[{"line_number":374,"context_line":"            raise exception.MarkerNotFound(marker)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    query \u003d sqlalchemyutils.paginate_query(query, api_models.Flavors,"},{"line_number":377,"context_line":"                                       limit,"},{"line_number":378,"context_line":"                                       [sort_key, \u0027id\u0027],"},{"line_number":379,"context_line":"                                       marker\u003dmarker_row,"},{"line_number":380,"context_line":"                                       sort_dir\u003dsort_dir)"},{"line_number":381,"context_line":"    return [_dict_with_extra_specs(i) for i in query.all()]"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_d4ac6da2","line":380,"range":{"start_line":377,"start_character":39,"end_line":380,"end_character":57},"updated":"2016-03-22 18:24:32.000000000","message":"ahh alignment my eyes!","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f0d1689039231474be976ca65d16adb7b14ccf22","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                                     sort_dir\u003dsort_dir,"},{"line_number":401,"context_line":"                                                     limit\u003dlimit,"},{"line_number":402,"context_line":"                                                     marker\u003dmarker)"},{"line_number":403,"context_line":"            # NOTE(danms): If we were asked for a marker and found it in"},{"line_number":404,"context_line":"            # results from the API DB, we must continue our pagination with"},{"line_number":405,"context_line":"            # just the limit (if any) to the main DB."},{"line_number":406,"context_line":"            marker \u003d None"},{"line_number":407,"context_line":"        except exception.MarkerNotFound:"},{"line_number":408,"context_line":"            api_db_flavors \u003d []"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_741641a8","line":405,"range":{"start_line":403,"start_character":12,"end_line":405,"end_character":53},"updated":"2016-03-22 18:27:39.000000000","message":"I don\u0027t think I understand this, isn\u0027t the marker for paging after that point? And if the marker is in the API DB, then why would we continue paging in the cell DB?","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8f28968fe3e68de9ef358c57b7df2ead51b21405","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                                     sort_dir\u003dsort_dir,"},{"line_number":401,"context_line":"                                                     limit\u003dlimit,"},{"line_number":402,"context_line":"                                                     marker\u003dmarker)"},{"line_number":403,"context_line":"            # NOTE(danms): If we were asked for a marker and found it in"},{"line_number":404,"context_line":"            # results from the API DB, we must continue our pagination with"},{"line_number":405,"context_line":"            # just the limit (if any) to the main DB."},{"line_number":406,"context_line":"            marker \u003d None"},{"line_number":407,"context_line":"        except exception.MarkerNotFound:"},{"line_number":408,"context_line":"            api_db_flavors \u003d []"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_b50d7092","line":405,"range":{"start_line":403,"start_character":12,"end_line":405,"end_character":53},"in_reply_to":"fa0719c6_741641a8","updated":"2016-03-22 20:50:45.000000000","message":"Because we might get a few results from flavors and then need to get a few more from the main db to satisfy limit.\n\nWe could just return a short page, but it\u0027s not any more difficult to do the right thing. The functional tests later in the set cover this pretty well I think, looking for results across the boundary.","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"335a107e44c650de62df5db84cf5fd8a10af30a9","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                                     sort_dir\u003dsort_dir,"},{"line_number":401,"context_line":"                                                     limit\u003dlimit,"},{"line_number":402,"context_line":"                                                     marker\u003dmarker)"},{"line_number":403,"context_line":"            # NOTE(danms): If we were asked for a marker and found it in"},{"line_number":404,"context_line":"            # results from the API DB, we must continue our pagination with"},{"line_number":405,"context_line":"            # just the limit (if any) to the main DB."},{"line_number":406,"context_line":"            marker \u003d None"},{"line_number":407,"context_line":"        except exception.MarkerNotFound:"},{"line_number":408,"context_line":"            api_db_flavors \u003d []"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_809d885b","line":405,"range":{"start_line":403,"start_character":12,"end_line":405,"end_character":53},"in_reply_to":"fa0719c6_953f8cd5","updated":"2016-03-22 21:09:04.000000000","message":"Nevermind, I worked this out with doffm on the whiteboard, I think the scenarios are OK. Plus with flavorid being the default marker and flavorid defaulting to uuid, you could get random results with paging on flavors so it\u0027s not fun to begin with. I was also missing the fact that we\u0027re carrying the id values from the cell db to the API db during the migration, that was messing up my head.","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8efc0ca37e4b2dcc1731913289b4ae13d707af34","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                                     sort_dir\u003dsort_dir,"},{"line_number":401,"context_line":"                                                     limit\u003dlimit,"},{"line_number":402,"context_line":"                                                     marker\u003dmarker)"},{"line_number":403,"context_line":"            # NOTE(danms): If we were asked for a marker and found it in"},{"line_number":404,"context_line":"            # results from the API DB, we must continue our pagination with"},{"line_number":405,"context_line":"            # just the limit (if any) to the main DB."},{"line_number":406,"context_line":"            marker \u003d None"},{"line_number":407,"context_line":"        except exception.MarkerNotFound:"},{"line_number":408,"context_line":"            api_db_flavors \u003d []"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_953f8cd5","line":405,"range":{"start_line":403,"start_character":12,"end_line":405,"end_character":53},"in_reply_to":"fa0719c6_b50d7092","updated":"2016-03-22 20:58:02.000000000","message":"I guess I\u0027m not sure how marker and limit are meant to be used together here, is my point. We don\u0027t have another example of this that we\u0027ve had to handle, so I\u0027m not sure what the right thing is. If the marker is the flavorid and we match that in the API DB, then I\u0027d think that we just return whatever we can under the limit from the API DB, would we need to add more from the cell DB? Maybe I need a scenario to think this through, like we have 5 flavors with flavorids 0, 1, 2, 3, 4. Flavors 0 and 1 are in the API DB and the rest are in the cell DB still. If we ask for all flavors and our marker is 1, we find that in the API DB and return just that one, but I guess the right thing in this case would be to continue to the cell DB and also return 2, 3, and 4 (assuming we have no limit). This gets a bit weird though, at least in that example, since flavorid defaults to a uuid if not provided when creating the flavor:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/flavors.py#L96","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"}],"nova/tests/unit/api/openstack/compute/test_flavor_access.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2413dd09655ff72d3dce4db5cf29b1b2f630b780","unresolved":false,"context_lines":[{"line_number":144,"context_line":"                      fake_get_all_flavors_sorted_list)"},{"line_number":145,"context_line":"        self.stub_out(\u0027nova.db.flavor_access_get_by_flavor_id\u0027,"},{"line_number":146,"context_line":"                      fake_get_flavor_access_by_flavor_id)"},{"line_number":147,"context_line":"        # Simulate no API flavors right now"},{"line_number":148,"context_line":"        self.stub_out(\u0027nova.objects.FlavorList._flavor_get_all_from_db\u0027,"},{"line_number":149,"context_line":"                      classmethod(lambda *a, **k: []))"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_0e7d661c","line":147,"updated":"2016-03-21 21:30:55.000000000","message":"I seem to remember someone saying they didn\u0027t need to globally stub out in the setUp if not all of the test cases needed this... :P","commit_id":"f20233e7a32a0ed03af9647509ed0e24e40062d8"}],"nova/tests/unit/objects/test_flavor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2413dd09655ff72d3dce4db5cf29b1b2f630b780","unresolved":false,"context_lines":[{"line_number":415,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_get_query_from_db\u0027)"},{"line_number":416,"context_line":"    def test_get_no_marker_in_api(self, mock_api_get, mock_main_get):"},{"line_number":417,"context_line":"        mock_api_get.filter_by.return_value.first.return_value \u003d None"},{"line_number":418,"context_line":"        mock_main_get.return_value \u003d []"},{"line_number":419,"context_line":"        flavor_obj.FlavorList.get_all(self.context,"},{"line_number":420,"context_line":"                                      inactive\u003dFalse,"},{"line_number":421,"context_line":"                                      filters\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_6e098295","line":418,"range":{"start_line":418,"start_character":8,"end_line":418,"end_character":39},"updated":"2016-03-21 21:30:55.000000000","message":"This isn\u0027t actually true in the cell DB API right? This would raise a MarkerNotFound, not return an empty list.","commit_id":"f20233e7a32a0ed03af9647509ed0e24e40062d8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8544d75a77a6a432ae409c50eeca3659a8d77559","unresolved":false,"context_lines":[{"line_number":414,"context_line":"    @mock.patch(\u0027nova.db.flavor_get_all\u0027)"},{"line_number":415,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_get_query_from_db\u0027)"},{"line_number":416,"context_line":"    def test_get_no_marker_in_api(self, mock_api_get, mock_main_get):"},{"line_number":417,"context_line":"        mock_api_get.filter_by.return_value.first.return_value \u003d None"},{"line_number":418,"context_line":"        mock_main_get.return_value \u003d []"},{"line_number":419,"context_line":"        flavor_obj.FlavorList.get_all(self.context,"},{"line_number":420,"context_line":"                                      inactive\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_3c4112aa","line":417,"range":{"start_line":417,"start_character":8,"end_line":417,"end_character":69},"updated":"2016-03-23 18:05:12.000000000","message":"Then this should raise MarkerNotFound, right?","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c766e0a2850ea989f34bb825fbc5436ca5ba2b2a","unresolved":false,"context_lines":[{"line_number":415,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_get_query_from_db\u0027)"},{"line_number":416,"context_line":"    def test_get_no_marker_in_api(self, mock_api_get, mock_main_get):"},{"line_number":417,"context_line":"        mock_api_get.filter_by.return_value.first.return_value \u003d None"},{"line_number":418,"context_line":"        mock_main_get.return_value \u003d []"},{"line_number":419,"context_line":"        flavor_obj.FlavorList.get_all(self.context,"},{"line_number":420,"context_line":"                                      inactive\u003dFalse,"},{"line_number":421,"context_line":"                                      filters\u003dNone,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_f49ff14d","line":418,"range":{"start_line":418,"start_character":8,"end_line":418,"end_character":39},"updated":"2016-03-22 18:24:32.000000000","message":"Shouldn\u0027t this result in a MarkerNotFound side_effect?","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9cdee7c3755a9dd730209ce8aac1f39288b01b49","unresolved":false,"context_lines":[{"line_number":415,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_get_query_from_db\u0027)"},{"line_number":416,"context_line":"    def test_get_no_marker_in_api(self, mock_api_get, mock_main_get):"},{"line_number":417,"context_line":"        mock_api_get.filter_by.return_value.first.return_value \u003d None"},{"line_number":418,"context_line":"        mock_main_get.return_value \u003d []"},{"line_number":419,"context_line":"        flavor_obj.FlavorList.get_all(self.context,"},{"line_number":420,"context_line":"                                      inactive\u003dFalse,"},{"line_number":421,"context_line":"                                      filters\u003dNone,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_e1dc46e6","line":418,"range":{"start_line":418,"start_character":8,"end_line":418,"end_character":39},"in_reply_to":"fa0719c6_f49ff14d","updated":"2016-03-22 22:34:18.000000000","message":"No, because we\u0027re just doing this so that we make sure we skip over the notfound in the API DB and run the main query.","commit_id":"b745116119e8022936a3183adf29a8a3b2e75714"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"194cf721d913a723550b36ad7d1506e0356d2a40","unresolved":false,"context_lines":[{"line_number":414,"context_line":"    @mock.patch(\u0027nova.db.flavor_get_all\u0027)"},{"line_number":415,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_get_query_from_db\u0027)"},{"line_number":416,"context_line":"    def test_get_no_marker_in_api(self, mock_api_get, mock_main_get):"},{"line_number":417,"context_line":"        mock_api_get.filter_by.return_value.first.return_value \u003d None"},{"line_number":418,"context_line":"        mock_main_get.return_value \u003d []"},{"line_number":419,"context_line":"        flavor_obj.FlavorList.get_all(self.context,"},{"line_number":420,"context_line":"                                      inactive\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa0719c6_1c888ec4","line":417,"range":{"start_line":417,"start_character":8,"end_line":417,"end_character":69},"updated":"2016-03-23 18:07:16.000000000","message":"OK, so this should trigger the MarkerNotFound for the API DB lookup, which we then handle and just continue on to the cell DB, that\u0027s the part I was missing before.","commit_id":"69cd268fffd90dbe68f89446a0b1360b50852534"}]}
