)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14008ab5080b674aecfe6ac82da1271fdc943207","unresolved":false,"context_lines":[{"line_number":18,"context_line":"- Enable transaction retry upon DBDeadlock errors for set_quota_usage;"},{"line_number":19,"context_line":"- Do not resync quota usage while making reservation. This puts a lot"},{"line_number":20,"context_line":"  of stress on the database and is also wasteful since resource usage"},{"line_number":21,"context_line":"  if very likely to be changing again once the transaction is committed;"},{"line_number":22,"context_line":"- Use autonested_transaction to simplify logic around when the"},{"line_number":23,"context_line":"  nested flag should be used."},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da20952f_d69d8c0b","line":21,"updated":"2015-09-01 22:00:07.000000000","message":"s/if/is/ (I think)","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ecc25bfa81adef90cea5bd9673d445a59873baa3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"- Enable transaction retry upon DBDeadlock errors for set_quota_usage;"},{"line_number":19,"context_line":"- Do not resync quota usage while making reservation. This puts a lot"},{"line_number":20,"context_line":"  of stress on the database and is also wasteful since resource usage"},{"line_number":21,"context_line":"  if very likely to be changing again once the transaction is committed;"},{"line_number":22,"context_line":"- Use autonested_transaction to simplify logic around when the"},{"line_number":23,"context_line":"  nested flag should be used."},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da20952f_e16fe35d","line":21,"in_reply_to":"da20952f_d69d8c0b","updated":"2015-09-07 08:15:02.000000000","message":"Done","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"}],"neutron/db/quota/api.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14008ab5080b674aecfe6ac82da1271fdc943207","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    :param delta: Specifies whether in_use is an absolute number"},{"line_number":98,"context_line":"                  or a delta (default to False)"},{"line_number":99,"context_line":"    \"\"\""},{"line_number":100,"context_line":"    with db_api.autonested_transaction(context.session):"},{"line_number":101,"context_line":"        query \u003d common_db_api.model_query(context, quota_models.QuotaUsage)"},{"line_number":102,"context_line":"        query \u003d query.filter_by(resource\u003dresource).filter_by("},{"line_number":103,"context_line":"            tenant_id\u003dtenant_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_533669b5","line":100,"updated":"2015-09-01 22:00:07.000000000","message":"I\u0027m not sure I understand this autonested_transaction utility.  It tries to call begin_nested and falls back on begin(subtransactions\u003dTrue) if it raises InvalidRequestError.  What I\u0027m not clear on is the conditions under which InvalidRequestError is raised.","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ecc25bfa81adef90cea5bd9673d445a59873baa3","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    :param delta: Specifies whether in_use is an absolute number"},{"line_number":98,"context_line":"                  or a delta (default to False)"},{"line_number":99,"context_line":"    \"\"\""},{"line_number":100,"context_line":"    with db_api.autonested_transaction(context.session):"},{"line_number":101,"context_line":"        query \u003d common_db_api.model_query(context, quota_models.QuotaUsage)"},{"line_number":102,"context_line":"        query \u003d query.filter_by(resource\u003dresource).filter_by("},{"line_number":103,"context_line":"            tenant_id\u003dtenant_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_81bce7dc","line":100,"in_reply_to":"da20952f_533669b5","updated":"2015-09-07 08:15:02.000000000","message":"It\u0027s fairly simple.\nThis is used to use the appropriate mode of subtransactions.\nIf you\u0027re in a nested transaction [ begin(nested\u003dTrue) ], it creates another nested transaction. Otherwise (and that\u0027s where InvalidRequestError is thrown) it calls begin(subtransactions\u003dTrue).\n\nthe autonested_transaction utility routine has been in that module for a while now.\nIt\u0027s worth noting that for this specify change we could have stayed with subtransactions\u003dTrue; Using autonested_transaction is a form of future-proofing, if you wish. I can therefore revert it if you wish so.","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14008ab5080b674aecfe6ac82da1271fdc943207","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        quota_models.ResourceDelta.resource,"},{"line_number":248,"context_line":"        quota_models.Reservation.expiration)"},{"line_number":249,"context_line":"    return dict((resource, total_reserved)"},{"line_number":250,"context_line":"                for (resource, exp, total_reserved) in resv_query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"def remove_expired_reservations(context, tenant_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_b621f8b6","line":250,"updated":"2015-09-01 22:00:07.000000000","message":"nit:  whitespace change","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ecc25bfa81adef90cea5bd9673d445a59873baa3","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        quota_models.ResourceDelta.resource,"},{"line_number":248,"context_line":"        quota_models.Reservation.expiration)"},{"line_number":249,"context_line":"    return dict((resource, total_reserved)"},{"line_number":250,"context_line":"                for (resource, exp, total_reserved) in resv_query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"def remove_expired_reservations(context, tenant_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_41b24f07","line":250,"in_reply_to":"da20952f_b621f8b6","updated":"2015-09-07 08:15:02.000000000","message":"Done","commit_id":"d256cacc2315efcc10e00d66573016497f121ecc"}],"neutron/db/quota/driver.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14008ab5080b674aecfe6ac82da1271fdc943207","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        # locks should be ok to use when support for sending \"hotspot\" writes"},{"line_number":151,"context_line":"        # to a single node will be avaialable."},{"line_number":152,"context_line":"        requested_resources \u003d deltas.keys()"},{"line_number":153,"context_line":"        with context.session.begin():"},{"line_number":154,"context_line":"            # Gather current usage information"},{"line_number":155,"context_line":"            # TODO(salv-orlando): calling count() for every resource triggers"},{"line_number":156,"context_line":"            # multiple queries on quota usage. This should be improved, however"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_b39b4572","side":"PARENT","line":153,"updated":"2015-09-01 22:00:07.000000000","message":"I\u0027m scratching my head over why this didn\u0027t set subtransactions in the first place.","commit_id":"6c70caed7148c821e0a95ed96690e6fa29e21740"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ecc25bfa81adef90cea5bd9673d445a59873baa3","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        # locks should be ok to use when support for sending \"hotspot\" writes"},{"line_number":151,"context_line":"        # to a single node will be avaialable."},{"line_number":152,"context_line":"        requested_resources \u003d deltas.keys()"},{"line_number":153,"context_line":"        with context.session.begin():"},{"line_number":154,"context_line":"            # Gather current usage information"},{"line_number":155,"context_line":"            # TODO(salv-orlando): calling count() for every resource triggers"},{"line_number":156,"context_line":"            # multiple queries on quota usage. This should be improved, however"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_6183d303","side":"PARENT","line":153,"in_reply_to":"da20952f_b39b4572","updated":"2015-09-07 08:15:02.000000000","message":"It\u0027s running in a way such that it does not need subtransactions, because it runs before the dispatch to the plugin, where no transaction has yet begun.\n\nAdopting subtransactions is not necessary, but recommended. And that\u0027s what I\u0027m doing here.","commit_id":"6c70caed7148c821e0a95ed96690e6fa29e21740"}]}
