)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9f3d8582b7f455d6bd8cd8e2c07021be8dca5b1f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove context guard of Agent OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"After OVO transition, context.session.begin(subtransactions\u003dTrue)"},{"line_number":10,"context_line":"is no longer needed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Iee6fbee98fae41d75b4e8eb0fbcf2283da545023"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_2aaabd83","line":10,"range":{"start_line":10,"start_character":3,"end_line":10,"end_character":19},"updated":"2018-10-18 20:28:45.000000000","message":"Perhaps it is helpful to explain a bit more about the rationale. I raised this question because the general approach of switching to new facade is to replace context.session.begin() with\ndb.context_manager.writer(reader).using(context) . I wonder what justifies the different approach proposed in this patch.","commit_id":"044cd19d863920bfba0169cb986b6f82e12d964a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9f3d8582b7f455d6bd8cd8e2c07021be8dca5b1f","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"After OVO transition, context.session.begin(subtransactions\u003dTrue)"},{"line_number":10,"context_line":"is no longer needed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Iee6fbee98fae41d75b4e8eb0fbcf2283da545023"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_69668659","line":11,"updated":"2018-10-18 20:28:45.000000000","message":"Is this change implements this BP: https://blueprints.launchpad.net/neutron/+spec/enginefacade-switch ? If yes, it is better to link the BP in the commit message.","commit_id":"044cd19d863920bfba0169cb986b6f82e12d964a"}],"neutron/db/agents_db.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9f3d8582b7f455d6bd8cd8e2c07021be8dca5b1f","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":274,"context_line":"    def update_agent(self, context, id, agent):"},{"line_number":275,"context_line":"        agent_data \u003d agent[\u0027agent\u0027]"},{"line_number":276,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":277,"context_line":"            agent \u003d self._get_agent(context, id)"},{"line_number":278,"context_line":"            agent.update_fields(agent_data)"},{"line_number":279,"context_line":"            agent.update()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_eaefe5f7","side":"PARENT","line":276,"range":{"start_line":276,"start_character":8,"end_line":276,"end_character":57},"updated":"2018-10-18 20:28:45.000000000","message":"By looking at the pattern of other patches, this is replaced by:\n\n  with db_api.context_manager.writer.using(context):\n      ...\n\nIs there any reason that it is directly removed in here?","commit_id":"5f36615700815bac084d80a330ca2564716508f4"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9d18c1cc0bf386bf6b001bb3f46df44c92797aa4","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":274,"context_line":"    def update_agent(self, context, id, agent):"},{"line_number":275,"context_line":"        agent_data \u003d agent[\u0027agent\u0027]"},{"line_number":276,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":277,"context_line":"            agent \u003d self._get_agent(context, id)"},{"line_number":278,"context_line":"            agent.update_fields(agent_data)"},{"line_number":279,"context_line":"            agent.update()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_78d092c7","side":"PARENT","line":276,"range":{"start_line":276,"start_character":8,"end_line":276,"end_character":57},"in_reply_to":"3f79a3b5_751dfbbd","updated":"2018-11-01 02:25:56.000000000","message":"OK. I get the motivation now. However, there is still one thing I want to confirm.\n\nIt seems there is two DB access in this method. The first one is self._get_agent(...), and the second one is agent.update(). If we remove this transaction guard in here, it seems each DB access will open a DB transaction on its own. Then, the effect is to split one DB transaction into two (_get_agent and agent.update).\n\nIf my interpretation above is correct and the intention is to split a transaction into two, there will be some minor performance penalty, which is the thing I am a bit concerned of.\n\nAny feedback for the reasoning above?","commit_id":"5f36615700815bac084d80a330ca2564716508f4"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"43d3b27b5ef06583c99321beb0787b71b1ad470a","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":274,"context_line":"    def update_agent(self, context, id, agent):"},{"line_number":275,"context_line":"        agent_data \u003d agent[\u0027agent\u0027]"},{"line_number":276,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":277,"context_line":"            agent \u003d self._get_agent(context, id)"},{"line_number":278,"context_line":"            agent.update_fields(agent_data)"},{"line_number":279,"context_line":"            agent.update()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_751dfbbd","side":"PARENT","line":276,"range":{"start_line":276,"start_character":8,"end_line":276,"end_character":57},"in_reply_to":"3f79a3b5_eaefe5f7","updated":"2018-11-01 00:21:44.000000000","message":"It is because .update() has its own context session, so that we do not need a transaction guard anymore. This is what we do for the OVO transition, isn\u0027t it? I am seeing this change as a clean up for Agent OVO switch, obviously we should not keep the transaction guard, when we changed from db layer access to OVO layer access.","commit_id":"5f36615700815bac084d80a330ca2564716508f4"}]}
