)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d185653bfc29fe22a0e9a3ff47a5e9f16bc1e44","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in cells that the tenant actually has instances landed in. We do this by getting"},{"line_number":11,"context_line":"a list of cell mappings that have instance mappings owned by the project and"},{"line_number":12,"context_line":"limiting the scatter/gather operation to just those cells."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I0e2a9b2460145d3aee92f7fddc4f4da16af63ff8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_7fecedbb","line":13,"updated":"2018-11-01 16:22:48.000000000","message":"Didn\u0027t Belmiro have a bug related to this at one point?\n\nYar: https://bugs.launchpad.net/nova/+bug/1771810","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"c102ea69aa04d1062a0075b0359a8f892acde82f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in cells that the tenant actually has instances landed in. We do this by getting"},{"line_number":11,"context_line":"a list of cell mappings that have instance mappings owned by the project and"},{"line_number":12,"context_line":"limiting the scatter/gather operation to just those cells."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I0e2a9b2460145d3aee92f7fddc4f4da16af63ff8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_52e0ce27","line":13,"in_reply_to":"3f79a3b5_7fecedbb","updated":"2018-11-05 11:11:06.000000000","message":"ack, will include this","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"238c3bee60395e37709a6321677fa86986950ca0","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This makes the _instances_cores_ram_count() method only query for instances"},{"line_number":10,"context_line":"in cells that the tenant actually has instances landed in if"},{"line_number":11,"context_line":"`CONF.api.instance_list_per_project_cells` is set. We do this by getting"},{"line_number":12,"context_line":"a list of cell mappings that have instance mappings owned by the project and"},{"line_number":13,"context_line":"limiting the scatter/gather operation to just those cells."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_45b8d176","line":11,"range":{"start_line":11,"start_character":10,"end_line":11,"end_character":41},"updated":"2018-11-07 13:59:39.000000000","message":"we should make this name more generic if people care.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This makes the _instances_cores_ram_count() method only query for instances"},{"line_number":10,"context_line":"in cells that the tenant actually has instances landed in if"},{"line_number":11,"context_line":"`CONF.api.instance_list_per_project_cells` is set. We do this by getting"},{"line_number":12,"context_line":"a list of cell mappings that have instance mappings owned by the project and"},{"line_number":13,"context_line":"limiting the scatter/gather operation to just those cells."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_067e46e1","line":11,"range":{"start_line":11,"start_character":10,"end_line":11,"end_character":41},"in_reply_to":"3f79a3b5_45b8d176","updated":"2018-11-08 15:31:26.000000000","message":"Yeah, I\u0027m not sure what we\u0027d call it though, maybe \"tenant_cell_affinity\" or \"tenant_cell_isolation\"?","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4cb53ad7d7792f56953bf13dcac5aeaf2e4303b3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This makes the _instances_cores_ram_count() method only query for instances"},{"line_number":10,"context_line":"in cells that the tenant actually has instances landed in if"},{"line_number":11,"context_line":"`CONF.api.instance_list_per_project_cells` is set. We do this by getting"},{"line_number":12,"context_line":"a list of cell mappings that have instance mappings owned by the project and"},{"line_number":13,"context_line":"limiting the scatter/gather operation to just those cells."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_d337abda","line":11,"range":{"start_line":11,"start_character":10,"end_line":11,"end_character":41},"updated":"2018-11-08 15:56:04.000000000","message":"I was wondering if we would need to add any words to the help for this option about how it\u0027s also used for counting quota now, but I think it\u0027s sufficiently generic so we probably don\u0027t need to mention the quota part.","commit_id":"96e2c72ebe99cb2bd622f4d406fcf9bf5140bb46"}],"nova/quota.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"5b8359b7ee47e632742eec1aec5ea7e9a1ff178d","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"    # counting resources if a cell is down. In the future, we should query"},{"line_number":1333,"context_line":"    # placement for cores/ram and InstanceMappings for instances (once we are"},{"line_number":1334,"context_line":"    # deleting InstanceMappings when we delete instances)."},{"line_number":1335,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1336,"context_line":"    # instances."},{"line_number":1337,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1338,"context_line":"                                                              project_id)"},{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_5598b874","line":1338,"range":{"start_line":1335,"start_character":4,"end_line":1338,"end_character":73},"updated":"2018-11-05 12:12:12.000000000","message":"this is possible only if user_id is None :(","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"c5d297c527497ffd87aff923985c3ed12e999c68","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"    # counting resources if a cell is down. In the future, we should query"},{"line_number":1333,"context_line":"    # placement for cores/ram and InstanceMappings for instances (once we are"},{"line_number":1334,"context_line":"    # deleting InstanceMappings when we delete instances)."},{"line_number":1335,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1336,"context_line":"    # instances."},{"line_number":1337,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1338,"context_line":"                                                              project_id)"},{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f5e304d6","line":1338,"range":{"start_line":1335,"start_character":4,"end_line":1338,"end_character":73},"in_reply_to":"3f79a3b5_5598b874","updated":"2018-11-05 12:17:47.000000000","message":"This improvisation is useful for large deployments since its basically reducing going into all cells/instances table and then filtering for \u0027project_id\u0027 owned instances versus going into only those cells which have instances for \u0027project_id\u0027.\n\nHowever maybe for deployments with single cells this query for get_by_project_id is redundant ? so should we maybe reuse https://github.com/openstack/nova/blob/9db1c6061d10617b40dbc1d0d64faed79503cb81/nova/conf/api.py#L252 this config option to also span for this ?","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ed920f09cf02c7a352fa00ea604839875e12709e","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"    # counting resources if a cell is down. In the future, we should query"},{"line_number":1333,"context_line":"    # placement for cores/ram and InstanceMappings for instances (once we are"},{"line_number":1334,"context_line":"    # deleting InstanceMappings when we delete instances)."},{"line_number":1335,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1336,"context_line":"    # instances."},{"line_number":1337,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1338,"context_line":"                                                              project_id)"},{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0d9eb067","line":1338,"range":{"start_line":1335,"start_character":4,"end_line":1338,"end_character":73},"in_reply_to":"3f79a3b5_f5e304d6","updated":"2018-11-05 19:25:01.000000000","message":"You can and should do this filtering even if user_id is not None. See my comment below for why.\n\nAnd agreed, I think you can leverage that config option in the same way to avoid a useless query step in a single cell deployment.","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"7add19177f511a61a8c13ca44b5ef080bb397355","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"},{"line_number":1342,"context_line":"    if user_id:"},{"line_number":1343,"context_line":"        total_counts[\u0027user\u0027] \u003d {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}"},{"line_number":1344,"context_line":"    for result in results.values():"},{"line_number":1345,"context_line":"        if not nova_context.is_cell_failure_sentinel(result):"},{"line_number":1346,"context_line":"            for resource, count in result[\u0027project\u0027].items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_55fc38b5","line":1343,"range":{"start_line":1342,"start_character":4,"end_line":1343,"end_character":69},"updated":"2018-11-05 12:07:34.000000000","message":"does anyone know why we count instances/cores/ram per user per project? Is this used for anything ? I thought quota for instances/ram/cores is only per project (irrespective of user)?","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"7afd3d0c55d91fe98c7982e888b65926858cecf6","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"},{"line_number":1342,"context_line":"    if user_id:"},{"line_number":1343,"context_line":"        total_counts[\u0027user\u0027] \u003d {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}"},{"line_number":1344,"context_line":"    for result in results.values():"},{"line_number":1345,"context_line":"        if not nova_context.is_cell_failure_sentinel(result):"},{"line_number":1346,"context_line":"            for resource, count in result[\u0027project\u0027].items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_6c3f2db2","line":1343,"range":{"start_line":1342,"start_character":4,"end_line":1343,"end_character":69},"in_reply_to":"3f79a3b5_55fc38b5","updated":"2018-11-05 15:16:26.000000000","message":"nvm, I just realized we allow imposing limits on users inside a project as well, okay so I will do the improvisation only if user_id is not set.","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ed920f09cf02c7a352fa00ea604839875e12709e","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"},{"line_number":1342,"context_line":"    if user_id:"},{"line_number":1343,"context_line":"        total_counts[\u0027user\u0027] \u003d {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}"},{"line_number":1344,"context_line":"    for result in results.values():"},{"line_number":1345,"context_line":"        if not nova_context.is_cell_failure_sentinel(result):"},{"line_number":1346,"context_line":"            for resource, count in result[\u0027project\u0027].items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_add69c25","line":1343,"range":{"start_line":1342,"start_character":4,"end_line":1343,"end_character":69},"in_reply_to":"3f79a3b5_6c3f2db2","updated":"2018-11-05 19:25:01.000000000","message":"It is possible for operators/users to set instance/cores/ram quota per project _and_ per user. But note, per user quota is per project, per user. That means if someone sets per user quota, they must do it for a specific project in each case. So you can depend on project being there always.\n\nSo, you are safe to optimize this to query only cells which have instances owned by project_id. In fact, even if we had user_id available in instance_mappings, we\u0027d still have to query cells for project_id only to take care of the per project quota and per project+user quota. Hope that makes sense -- let me know if it doesn\u0027t.","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ff1b4edfbdfe32431f1cdea86e5fb0b998c26a8b","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"    results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1340,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1341,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"},{"line_number":1342,"context_line":"    if user_id:"},{"line_number":1343,"context_line":"        total_counts[\u0027user\u0027] \u003d {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}"},{"line_number":1344,"context_line":"    for result in results.values():"},{"line_number":1345,"context_line":"        if not nova_context.is_cell_failure_sentinel(result):"},{"line_number":1346,"context_line":"            for resource, count in result[\u0027project\u0027].items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_e291d651","line":1343,"range":{"start_line":1342,"start_character":4,"end_line":1343,"end_character":69},"in_reply_to":"3f79a3b5_add69c25","updated":"2018-11-07 11:54:52.000000000","message":"yes it makes total sense, thanks melwitt for clarifying this :) got it!","commit_id":"96354196cb13266a5e33e9f97db856e53c93aef6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"    # counting resources if a cell is down. In the future, we should query"},{"line_number":1169,"context_line":"    # placement for cores/ram and InstanceMappings for instances (once we are"},{"line_number":1170,"context_line":"    # deleting InstanceMappings when we delete instances)."},{"line_number":1171,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1172,"context_line":"    # instances."},{"line_number":1173,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1174,"context_line":"    # instances if CONF.api.instance_list_per_project_cells is True."},{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e6c8ea20","line":1172,"range":{"start_line":1171,"start_character":4,"end_line":1172,"end_character":16},"updated":"2018-11-08 15:31:26.000000000","message":"Remove this - it\u0027s redundant and the note below is more accurate about the logic.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08dc9f5398b04e109df1af22a4f167082213e06a","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"    # counting resources if a cell is down. In the future, we should query"},{"line_number":1169,"context_line":"    # placement for cores/ram and InstanceMappings for instances (once we are"},{"line_number":1170,"context_line":"    # deleting InstanceMappings when we delete instances)."},{"line_number":1171,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1172,"context_line":"    # instances."},{"line_number":1173,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1174,"context_line":"    # instances if CONF.api.instance_list_per_project_cells is True."},{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_01ee301f","line":1172,"range":{"start_line":1171,"start_character":4,"end_line":1172,"end_character":16},"in_reply_to":"3f79a3b5_e6c8ea20","updated":"2018-11-08 15:37:59.000000000","message":"Done","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":1173,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1174,"context_line":"    # instances if CONF.api.instance_list_per_project_cells is True."},{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"},{"line_number":1176,"context_line":"        cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1177,"context_line":"                                                                project_id)"},{"line_number":1178,"context_line":"        results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1179,"context_line":"            objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1180,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e6322a0e","line":1177,"range":{"start_line":1176,"start_character":66,"end_line":1177,"end_character":74},"updated":"2018-11-08 15:31:26.000000000","message":"nit: alignment - just wrap the params to a new line","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08dc9f5398b04e109df1af22a4f167082213e06a","unresolved":false,"context_lines":[{"line_number":1173,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1174,"context_line":"    # instances if CONF.api.instance_list_per_project_cells is True."},{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"},{"line_number":1176,"context_line":"        cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1177,"context_line":"                                                                project_id)"},{"line_number":1178,"context_line":"        results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1179,"context_line":"            objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1180,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a1d89c7f","line":1177,"range":{"start_line":1176,"start_character":66,"end_line":1177,"end_character":74},"in_reply_to":"3f79a3b5_e6322a0e","updated":"2018-11-08 15:37:59.000000000","message":"Done","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"},{"line_number":1176,"context_line":"        cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1177,"context_line":"                                                                project_id)"},{"line_number":1178,"context_line":"        results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1179,"context_line":"            objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1180,"context_line":"    else:"},{"line_number":1181,"context_line":"        results \u003d nova_context.scatter_gather_all_cells(context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2616e259","line":1178,"range":{"start_line":1178,"start_character":76,"end_line":1178,"end_character":78},"updated":"2018-11-08 15:31:26.000000000","message":"Use the context.CELL_TIMEOUT constant here.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08dc9f5398b04e109df1af22a4f167082213e06a","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"    if CONF.api.instance_list_per_project_cells:"},{"line_number":1176,"context_line":"        cell_mappings \u003d objects.CellMappingList.get_by_project_id(context,"},{"line_number":1177,"context_line":"                                                                project_id)"},{"line_number":1178,"context_line":"        results \u003d nova_context.scatter_gather_cells(context, cell_mappings, 60,"},{"line_number":1179,"context_line":"            objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1180,"context_line":"    else:"},{"line_number":1181,"context_line":"        results \u003d nova_context.scatter_gather_all_cells(context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_c1d35862","line":1178,"range":{"start_line":1178,"start_character":76,"end_line":1178,"end_character":78},"in_reply_to":"3f79a3b5_2616e259","updated":"2018-11-08 15:37:59.000000000","message":"Done","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c0eaac7272cf3f78ab686289b850f22ddbe3611","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"    # instances."},{"line_number":1173,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id("},{"line_number":1174,"context_line":"        context, project_id)"},{"line_number":1175,"context_line":"    results \u003d nova_context.scatter_gather_cells("},{"line_number":1176,"context_line":"        context, cell_mappings, nova_context.CELL_TIMEOUT,"},{"line_number":1177,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1178,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8a7fa2ba","line":1175,"range":{"start_line":1175,"start_character":14,"end_line":1175,"end_character":47},"updated":"2018-11-09 16:34:12.000000000","message":"Not for this patch, but we might should make a variant of this that just takes a project_id and can do the query for mappings itself. That would let us do this in more places easily and open the potential for memcache\u0027ing these mappings later if it would be beneficial.","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8397031ac10b6b50974c96fd579bfaabc726a289","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"    # instances."},{"line_number":1173,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id("},{"line_number":1174,"context_line":"        context, project_id)"},{"line_number":1175,"context_line":"    results \u003d nova_context.scatter_gather_cells("},{"line_number":1176,"context_line":"        context, cell_mappings, nova_context.CELL_TIMEOUT,"},{"line_number":1177,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1178,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d7214cb4","line":1175,"range":{"start_line":1175,"start_character":14,"end_line":1175,"end_character":47},"in_reply_to":"3f79a3b5_6e1f935d","updated":"2018-11-19 09:48:15.000000000","message":"ack, will do this in a follow-up","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"55cf6c2ea95a6ed4bc5598c4665c7128ed746444","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"    # instances."},{"line_number":1173,"context_line":"    cell_mappings \u003d objects.CellMappingList.get_by_project_id("},{"line_number":1174,"context_line":"        context, project_id)"},{"line_number":1175,"context_line":"    results \u003d nova_context.scatter_gather_cells("},{"line_number":1176,"context_line":"        context, cell_mappings, nova_context.CELL_TIMEOUT,"},{"line_number":1177,"context_line":"        objects.InstanceList.get_counts, project_id, user_id\u003duser_id)"},{"line_number":1178,"context_line":"    total_counts \u003d {\u0027project\u0027: {\u0027instances\u0027: 0, \u0027cores\u0027: 0, \u0027ram\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6e1f935d","line":1175,"range":{"start_line":1175,"start_character":14,"end_line":1175,"end_character":47},"in_reply_to":"3f79a3b5_8a7fa2ba","updated":"2018-11-13 08:39:14.000000000","message":"I\u0027ll leave that as a TODO in the code.","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"}],"nova/tests/functional/db/test_quota.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        self.assertEqual(2, count[\u0027user\u0027][\u0027server_group_members\u0027])"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_instances_cores_ram_count(self):"},{"line_number":82,"context_line":"        ctxt \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":83,"context_line":"        mapping1 \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":84,"context_line":"                                       uuid\u003duuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e100d401","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":38},"updated":"2018-11-08 15:31:26.000000000","message":"Why does this test need to change at all? instance_list_per_project_cells defaults to False so we shouldn\u0027t have to look up instance mappings in this test, right?","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f639113da2c19dd40acb664b65735072bf4f1b85","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        self.assertEqual(2, count[\u0027user\u0027][\u0027server_group_members\u0027])"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_instances_cores_ram_count(self):"},{"line_number":82,"context_line":"        ctxt \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":83,"context_line":"        mapping1 \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":84,"context_line":"                                       uuid\u003duuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_4716755a","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":38},"in_reply_to":"3f79a3b5_e100d401","updated":"2018-11-09 09:41:22.000000000","message":"yea you are right, I put the mappings when I didn\u0027t introduce the flag check. Forgot to remove this back for this test since the flag is False for this. However probably if I remove the mappings for this test and the fact that it is needed in the test below might be enough proof that we follow the path of instance_mappings.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08dc9f5398b04e109df1af22a4f167082213e06a","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_instances_cores_ram_count_by_project_id(self):"},{"line_number":148,"context_line":"        self.flags(instance_list_per_project_cells\u003dTrue, group\u003d\u0027api\u0027)"},{"line_number":149,"context_line":"        ctxt \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":150,"context_line":"        mapping1 \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":151,"context_line":"                                       uuid\u003duuidutils.generate_uuid(),"},{"line_number":152,"context_line":"                                       database_connection\u003d\u0027cell1\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0155d0c0","line":149,"range":{"start_line":149,"start_character":52,"end_line":149,"end_character":64},"updated":"2018-11-08 15:37:59.000000000","message":"This doesn\u0027t really make sense...but it doesn\u0027t really matter either since we pass in the project_id to the count function.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f639113da2c19dd40acb664b65735072bf4f1b85","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_instances_cores_ram_count_by_project_id(self):"},{"line_number":148,"context_line":"        self.flags(instance_list_per_project_cells\u003dTrue, group\u003d\u0027api\u0027)"},{"line_number":149,"context_line":"        ctxt \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":150,"context_line":"        mapping1 \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":151,"context_line":"                                       uuid\u003duuidutils.generate_uuid(),"},{"line_number":152,"context_line":"                                       database_connection\u003d\u0027cell1\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a74c2997","line":149,"range":{"start_line":149,"start_character":52,"end_line":149,"end_character":64},"in_reply_to":"3f79a3b5_0155d0c0","updated":"2018-11-09 09:41:22.000000000","message":"Done","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08dc9f5398b04e109df1af22a4f167082213e06a","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        count \u003d quota._instances_cores_ram_count(ctxt, \u0027fake-project-1\u0027,"},{"line_number":192,"context_line":"                                                 user_id\u003d\u0027fake-user\u0027)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        self.assertEqual(1, count[\u0027project\u0027][\u0027instances\u0027])"},{"line_number":195,"context_line":"        self.assertEqual(2, count[\u0027project\u0027][\u0027cores\u0027])"},{"line_number":196,"context_line":"        self.assertEqual(512, count[\u0027project\u0027][\u0027ram\u0027])"},{"line_number":197,"context_line":"        self.assertEqual(1, count[\u0027user\u0027][\u0027instances\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_c1efd8f7","line":194,"updated":"2018-11-08 15:37:59.000000000","message":"Wouldn\u0027t these results be the same regardless of the change? In other words, what we\u0027re really trying to do is optimize the number of cells we query, and that would be a different type of assertion here, right? If I removed the code change, I think this test would still pass.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f639113da2c19dd40acb664b65735072bf4f1b85","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        count \u003d quota._instances_cores_ram_count(ctxt, \u0027fake-project-1\u0027,"},{"line_number":192,"context_line":"                                                 user_id\u003d\u0027fake-user\u0027)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        self.assertEqual(1, count[\u0027project\u0027][\u0027instances\u0027])"},{"line_number":195,"context_line":"        self.assertEqual(2, count[\u0027project\u0027][\u0027cores\u0027])"},{"line_number":196,"context_line":"        self.assertEqual(512, count[\u0027project\u0027][\u0027ram\u0027])"},{"line_number":197,"context_line":"        self.assertEqual(1, count[\u0027user\u0027][\u0027instances\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e756a12b","line":194,"in_reply_to":"3f79a3b5_c1efd8f7","updated":"2018-11-09 09:41:22.000000000","message":"I agree, I didn\u0027t want to mock the function to see how many cells we actually go into, but if there was a way it would be nice,","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48b274494ae422b5487f696a5970bb2e1690c109","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        self.assertEqual(1, count[\u0027project\u0027][\u0027instances\u0027])"},{"line_number":195,"context_line":"        self.assertEqual(2, count[\u0027project\u0027][\u0027cores\u0027])"},{"line_number":196,"context_line":"        self.assertEqual(512, count[\u0027project\u0027][\u0027ram\u0027])"},{"line_number":197,"context_line":"        self.assertEqual(1, count[\u0027user\u0027][\u0027instances\u0027])"},{"line_number":198,"context_line":"        self.assertEqual(2, count[\u0027user\u0027][\u0027cores\u0027])"},{"line_number":199,"context_line":"        self.assertEqual(512, count[\u0027user\u0027][\u0027ram\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2149ec64","line":199,"range":{"start_line":197,"start_character":8,"end_line":199,"end_character":51},"updated":"2018-11-08 15:31:26.000000000","message":"This is redundant.","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f639113da2c19dd40acb664b65735072bf4f1b85","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        self.assertEqual(1, count[\u0027project\u0027][\u0027instances\u0027])"},{"line_number":195,"context_line":"        self.assertEqual(2, count[\u0027project\u0027][\u0027cores\u0027])"},{"line_number":196,"context_line":"        self.assertEqual(512, count[\u0027project\u0027][\u0027ram\u0027])"},{"line_number":197,"context_line":"        self.assertEqual(1, count[\u0027user\u0027][\u0027instances\u0027])"},{"line_number":198,"context_line":"        self.assertEqual(2, count[\u0027user\u0027][\u0027cores\u0027])"},{"line_number":199,"context_line":"        self.assertEqual(512, count[\u0027user\u0027][\u0027ram\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_8751ed33","line":199,"range":{"start_line":197,"start_character":8,"end_line":199,"end_character":51},"in_reply_to":"3f79a3b5_2149ec64","updated":"2018-11-09 09:41:22.000000000","message":"Done","commit_id":"7032c1d34e905fa6b0c6c52375abe292a6d43bf1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"cab8017107d9270b1cfedcd84ffb7f1c139bb7be","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                        user_id\u003d\u0027fake-user\u0027,"},{"line_number":99,"context_line":"                                        vcpus\u003d2, memory_mb\u003d512)"},{"line_number":100,"context_line":"            instance.create()"},{"line_number":101,"context_line":"            # create mapping for the instance since we query only those cells"},{"line_number":102,"context_line":"            # in which the project has instances based on the instance_mappings"},{"line_number":103,"context_line":"            im \u003d objects.InstanceMapping(context\u003dctxt,"},{"line_number":104,"context_line":"                                         instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_48d2faff","line":101,"updated":"2018-11-09 10:37:23.000000000","message":"Now that we don\u0027t have the config option, adding the instance_mappings to this test to make it pass it enough proof for the change in logic we do I think. So removed the extra test we had because its redundant as long as we can\u0027t actually check the number of cells we go into.","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"9cf49fc62676b999cb59ca83f6366ebcd39363fe","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                        user_id\u003d\u0027fake-user\u0027,"},{"line_number":99,"context_line":"                                        vcpus\u003d2, memory_mb\u003d512)"},{"line_number":100,"context_line":"            instance.create()"},{"line_number":101,"context_line":"            # create mapping for the instance since we query only those cells"},{"line_number":102,"context_line":"            # in which the project has instances based on the instance_mappings"},{"line_number":103,"context_line":"            im \u003d objects.InstanceMapping(context\u003dctxt,"},{"line_number":104,"context_line":"                                         instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_88f57286","line":101,"in_reply_to":"3f79a3b5_48d2faff","updated":"2018-11-09 10:40:15.000000000","message":"@mriedem: confirm if you are okay with this.","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a08fab98fffaa3abe0e9a2f74f64b782c4f8e39","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                        user_id\u003d\u0027fake-user\u0027,"},{"line_number":99,"context_line":"                                        vcpus\u003d2, memory_mb\u003d512)"},{"line_number":100,"context_line":"            instance.create()"},{"line_number":101,"context_line":"            # create mapping for the instance since we query only those cells"},{"line_number":102,"context_line":"            # in which the project has instances based on the instance_mappings"},{"line_number":103,"context_line":"            im \u003d objects.InstanceMapping(context\u003dctxt,"},{"line_number":104,"context_line":"                                         instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d41c5f66","line":101,"in_reply_to":"3f79a3b5_88f57286","updated":"2018-11-09 14:34:03.000000000","message":"Yes this is OK with me, the other test was redundant after we dropped the config condition.","commit_id":"314dea5d42d2c49bccda076a08545478b3481bd3"}]}
