)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"df5d82894121f99817af247fdcb282b79b5dd5d3","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2Fv1w%3D","line":1840,"updated":"2013-01-07 20:06:25.000000000","message":"I don\u0027t like such approach it will produce N requests to DB.\nI think that it is better to get all metadata at the end. \nOr we should find the reason of such strange behavior. Probably we should first of all write some tests that show us that there is something wrong? r","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4c547ace47858f5b47cdb44f69de9f67488c9b98","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FvyI%3D","line":1840,"in_reply_to":"AAAAM3%2F%2Fv1w%3D","updated":"2013-01-07 20:30:56.000000000","message":"Why does it produce N requests to the DB? The instance was loaded with instance_get_by_uuid(), which joinedload()ed the metadata, which means they should all be already present, and iterating over them doesn\u0027t produce additional DB traffic, right?\n\nThere is already a test that is failing because of this, which is the reason for doing *something* about the problem ASAP. I don\u0027t understand it enough to write a more specific test, but if you do, please propose something.","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"490c2eb3018636943521e25e87b72b650c1f6239","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FvnQ%3D","line":1840,"in_reply_to":"AAAAM3%2F%2FvoE%3D","updated":"2013-01-07 22:35:21.000000000","message":"Also you will need to rename condemned.delete -\u003e condemned.soft_delete see https://review.openstack.org/#/c/19035/","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"b4aedd17ecce659dc7eb127aab155b7e34c9fca8","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FvoE%3D","line":1840,"in_reply_to":"AAAAM3%2F%2FvpI%3D","updated":"2013-01-07 22:26:14.000000000","message":"I agree with Dan.  G-2 comes out on 2013-01-10","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0325becdc38ce1753792d5a54a0da561751b1bce","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FvpI%3D","line":1840,"in_reply_to":"AAAAM3%2F%2FvtY%3D","updated":"2013-01-07 22:23:42.000000000","message":"That\u0027s N/M accesses, but fine :)\n\nYes, please, if you can come up with something better, I\u0027m all for it! I think it needs to be fixed, even if temporary for G-2. If you have something before then, then that\u0027s fine. If not, can we move forward with this and fix it properly if/when you come up with something better?","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"03666367dfe41f3f60c2de93e83e14466f217136","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"# the database to avoid stale data and refresh issues. It assumes the"},{"line_number":1838,"context_line":"# delete\u003dTrue behavior of instance_metadata_update(...)"},{"line_number":1839,"context_line":"def _instance_update_metadata_in_place(context, instance, metadata, session):"},{"line_number":1840,"context_line":"    to_delete \u003d []"},{"line_number":1841,"context_line":"    for keyvalue in instance[\u0027metadata\u0027]:"},{"line_number":1842,"context_line":"        key \u003d keyvalue[\u0027key\u0027]"},{"line_number":1843,"context_line":"        if key in metadata:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FvtY%3D","line":1840,"in_reply_to":"AAAAM3%2F%2FvyI%3D","updated":"2013-01-07 21:35:21.000000000","message":"condemned.delete(session\u003dsession) This will make at least 1 DB request each time.\nAnd each update will make one db request\nAnd each creation will make one db request\nSo there are N DB requests. \n\nI really don\u0027 t know why synchronize_session doesn\u0027t work in this case. Could you give me one or two days to analyze this and make some tests?","commit_id":"f09aa6f5ed2515c640ff6563f3349483f29fdc0d"}]}
