)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4fc6703a38077e1df55ed2e49dd6d511b3868b84","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2015-04-13 11:06:48 -0700"},{"line_number":4,"context_line":"Commit:     Vivekanandan Narasimhan \u003cvivekanandan.narasimhan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-20 05:24:57 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"vm migration needs persistent state for l2pop"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"VM Migrations trigger update_port_postcommit calls."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"dac4157f_849015ee","line":6,"updated":"2015-04-20 13:06:03.000000000","message":"I\u0027d add the necessary context to review this - What is the flow for VM migration with respect to l2pop? How many times is update_port_postcommit expected to be called, with what parameters each time?","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"20487809b3dd8fb5e46b9d3d8b6591d885019cd4","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2015-04-13 11:06:48 -0700"},{"line_number":4,"context_line":"Commit:     Vivekanandan Narasimhan \u003cvivekanandan.narasimhan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-20 05:24:57 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"vm migration needs persistent state for l2pop"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"VM Migrations trigger update_port_postcommit calls."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"dac4157f_a13646e5","line":6,"in_reply_to":"dac4157f_849015ee","updated":"2015-04-21 07:22:01.000000000","message":"update_port_postcommit is invoked twice for a migrated port. \n\nThe first time the update_port_postcommit is triggered because of nova invocation of update_port() that tells neutron that the port is being made available on the new host.  \nNova retains the port-status in ACTIVE state only since nova\u0027s update_port invocation does not alter the port-status. So during this first update-port-postcommit invocation the l2-pop driver uses the opportunity to save the old host information that is available in the existing port-binding (aka original_host in port-context).\n\nThe second time update_port_postcommit is triggered as part of invocation of get_device_details by the neutron agent on the new host. This invocation attempts to bind the port which results in the migrated port-state to transition to BUILD state.  The l2pop driver uses this opportunity to tear down the tunnels from the old host using the saved information in the prior update_port_postcommit.\n\n\nThe update_port_down from the original host would not make it until the update_port_postcommit because, the update_device_down call would return early due to port not bound to this old host.\n\nThe migration workflow would mandate a wiki page and thence would not be good to put into the commit message.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"076b796508831bc6e530424787ec70489fea146f","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2015-04-13 11:06:48 -0700"},{"line_number":4,"context_line":"Commit:     Vivekanandan Narasimhan \u003cvivekanandan.narasimhan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-20 05:24:57 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"vm migration needs persistent state for l2pop"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"VM Migrations trigger update_port_postcommit calls."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bab921fb_ccd08fcc","line":6,"in_reply_to":"dac4157f_a13646e5","updated":"2015-04-22 19:10:42.000000000","message":"In the absence of a wiki page or another form of documentation I think that this information would be great in the commit message!","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"e30411bba99983dfa53abcf29cf249db3c58516d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"handling tunnel cleanup correctly, resulting in"},{"line_number":50,"context_line":"accumulation of tunnels on nodes. So the fix persists"},{"line_number":51,"context_line":"l2pop migrated port state in DB, so the state is visible"},{"line_number":52,"context_line":"to all api/rpc_workers."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"Change-Id: Ia6e9f1615c9baead44a6ae0880563504c18774fe"},{"line_number":55,"context_line":"Closes-Bug: #1443421"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"9a1a9d01_e5888173","line":52,"updated":"2015-09-29 17:22:07.000000000","message":"I would prefer that this detailed explanation go either in a devref that goes along with this patch or via commnts in the code itself - putting this description in the commit message risks it being lost and or forgotten","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"104080cd839293c68a29193aae743448c0db64ba","unresolved":false,"context_lines":[{"line_number":49,"context_line":"handling tunnel cleanup correctly, resulting in"},{"line_number":50,"context_line":"accumulation of tunnels on nodes. So the fix persists"},{"line_number":51,"context_line":"l2pop migrated port state in DB, so the state is visible"},{"line_number":52,"context_line":"to all api/rpc_workers."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"Change-Id: Ia6e9f1615c9baead44a6ae0880563504c18774fe"},{"line_number":55,"context_line":"Closes-Bug: #1443421"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"7a2fa921_d4f0ae93","line":52,"in_reply_to":"9a1a9d01_e5888173","updated":"2015-10-08 09:44:32.000000000","message":"+1 putting this description into the context of code. It is good to record.","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"}],"neutron/db/migration/alembic_migrations/versions/mitaka/expand/f4f282b58baa_l2pop_migrate_vm.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6563b444d05aafaf23dff7a5252ea97d89216074","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"1af94dfe_62ef4b1e","updated":"2016-03-18 14:42:07.000000000","message":"This must now go in the newton versions directory.","commit_id":"e5f884d618b5841a47ed1cbe4a163383cce2415e"}],"neutron/plugins/ml2/drivers/l2pop/db.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4fc6703a38077e1df55ed2e49dd6d511b3868b84","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":127,"context_line":"                                   agent_host)"},{"line_number":128,"context_line":"            return (query1.count() + query2.count())"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def push_migrated_port(self, port_id, host):"},{"line_number":131,"context_line":"        session \u003d db_api.get_session()"},{"line_number":132,"context_line":"        with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"dac4157f_e42591c2","line":129,"updated":"2015-04-20 13:06:03.000000000","message":"Both methods are missing unit tests. Please add tests that do not use mock.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"20487809b3dd8fb5e46b9d3d8b6591d885019cd4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":127,"context_line":"                                   agent_host)"},{"line_number":128,"context_line":"            return (query1.count() + query2.count())"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def push_migrated_port(self, port_id, host):"},{"line_number":131,"context_line":"        session \u003d db_api.get_session()"},{"line_number":132,"context_line":"        with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"dac4157f_41388aa0","line":129,"in_reply_to":"dac4157f_e42591c2","updated":"2015-04-21 07:22:01.000000000","message":"Sure will do.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4fc6703a38077e1df55ed2e49dd6d511b3868b84","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":133,"context_line":"            try:"},{"line_number":134,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":135,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":136,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":137,"context_line":"                # create here"},{"line_number":138,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dac4157f_3f04b413","line":135,"updated":"2015-04-20 13:06:03.000000000","message":"This behavior is raceful. You could get an integrity error here when trying to add the port.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"076b796508831bc6e530424787ec70489fea146f","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":133,"context_line":"            try:"},{"line_number":134,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":135,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":136,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":137,"context_line":"                # create here"},{"line_number":138,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bab921fb_0cee878b","line":135,"in_reply_to":"dac4157f_01cbb2a6","updated":"2015-04-22 19:10:42.000000000","message":"Gotcha. Just wanted to make sure.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"20487809b3dd8fb5e46b9d3d8b6591d885019cd4","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":133,"context_line":"            try:"},{"line_number":134,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":135,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":136,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":137,"context_line":"                # create here"},{"line_number":138,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dac4157f_01cbb2a6","line":135,"in_reply_to":"dac4157f_3f04b413","updated":"2015-04-21 07:22:01.000000000","message":"A race is feasible only when two different controllers (or threads on a given controller) try to add the same migrated port into the DB.\n\nBut the chances for that doesn\u0027t seem to exist in my perspective.\n\nThis is because ports are processed serially by all the OVS Agents.  And so even if a port hops across hosts, the query here will succeed which would result us in safely not executing the migrated-port-addition logic.","commit_id":"d614c8688771cd2fcd85c1ec75422a15e32c1ae8"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"b3a97b94087b04bd9c1d152f54dfde4f7dcb96a0","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class L2popMigratedPort(model_base.BASEV2):"},{"line_number":32,"context_line":"    \"\"\"Represents a port that is being migrated.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    __tablename__ \u003d \u0027l2popmigratedports\u0027"},{"line_number":35,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":36,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":37,"context_line":"                        primary_key\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab921fb_836364b1","line":34,"updated":"2015-04-23 13:08:38.000000000","message":"Nit: It could be l2popmigratedports --\u003e l2pop_migrated_ports\n\nJust for better readability :)","commit_id":"2bd4950333091c27d519866208e796870868566e"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d0c17a3412e486117924ffc04200d66ea7839c7e","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":141,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":142,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":143,"context_line":"                # create here"},{"line_number":144,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_2f9c3d5c","line":141,"updated":"2015-08-28 17:41:22.000000000","message":"don\u0027t you want to update the host here if the record was found?","commit_id":"88d1e6c7fc58d4425beef32219e7a3ea72769138"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"34cab58a0b77d2f746ad8b34adb433da7aec7123","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":141,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":142,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":143,"context_line":"                # create here"},{"line_number":144,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_e38b141d","line":141,"in_reply_to":"da20952f_2f9c3d5c","updated":"2015-09-09 08:10:46.000000000","message":"it is no need, for one port only have the same information.\nif there is the record,it must be repeated call and can be ignored.","commit_id":"88d1e6c7fc58d4425beef32219e7a3ea72769138"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"a275380ad0f914d22c112f3fd1b7c39ea62e0e65","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":141,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":142,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":143,"context_line":"                # create here"},{"line_number":144,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a1a9d01_50c60e9b","line":141,"in_reply_to":"da20952f_e38b141d","updated":"2015-09-28 12:21:42.000000000","message":"Hi Kevin / Pengtao,\n\nFor multiple migrations with the same port-state of ACTIVE, we should retain only the first host that bound the port.  \n\nSubsequent bindings without equivalent transitions from ACTIVE to DOWN/BUILD are harmless.\n\nSo I did not build a stack of migration levels here.","commit_id":"88d1e6c7fc58d4425beef32219e7a3ea72769138"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"104080cd839293c68a29193aae743448c0db64ba","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                   agent_host)"},{"line_number":134,"context_line":"            return (query1.count() + query2.count())"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def push_migrated_port(self, port_id, host):"},{"line_number":137,"context_line":"        session \u003d db_api.get_session()"},{"line_number":138,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":139,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a2fa921_57f10000","line":136,"updated":"2015-10-08 09:44:32.000000000","message":"the context object has an object ref to db session. it is better to make the code consistent.\n\ndef func(self, context, ...):\n    with context.session(...)\n        ...","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"84bb17030d2c0975f1a7198be09684c9fd946442","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                   agent_host)"},{"line_number":134,"context_line":"            return (query1.count() + query2.count())"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def push_migrated_port(self, port_id, host):"},{"line_number":137,"context_line":"        session \u003d db_api.get_session()"},{"line_number":138,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":139,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa69d971_d30657cd","line":136,"in_reply_to":"7a2fa921_57f10000","updated":"2016-01-05 17:19:22.000000000","message":"sure thanks","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"fe914a0d1662706e555989d5d06395aab0ec3cdd","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                mig_port \u003d session.query(L2popMigratedPort).filter("},{"line_number":141,"context_line":"                    L2popMigratedPort.port_id \u003d\u003d port_id).one()"},{"line_number":142,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":143,"context_line":"                # create here"},{"line_number":144,"context_line":"                mig_port \u003d L2popMigratedPort(port_id\u003dport_id, host\u003dhost)"},{"line_number":145,"context_line":"                session.add(mig_port)"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9a1a9d01_21b45280","line":143,"updated":"2015-09-29 00:51:46.000000000","message":"Is this comment really useful? Can you make the comment useful more?","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"104080cd839293c68a29193aae743448c0db64ba","unresolved":false,"context_lines":[{"line_number":145,"context_line":"                session.add(mig_port)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def pop_migrated_port(self, context, port_id):"},{"line_number":148,"context_line":"        session \u003d db_api.get_session()"},{"line_number":149,"context_line":"        host \u003d None"},{"line_number":150,"context_line":"        port \u003d {}"},{"line_number":151,"context_line":"        with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a2fa921_b7f094ff","line":148,"updated":"2015-10-08 09:44:32.000000000","message":"use context.session instead.","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"fe914a0d1662706e555989d5d06395aab0ec3cdd","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def pop_migrated_port(self, context, port_id):"},{"line_number":148,"context_line":"        session \u003d db_api.get_session()"},{"line_number":149,"context_line":"        host \u003d None"},{"line_number":150,"context_line":"        port \u003d {}"},{"line_number":151,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":152,"context_line":"            try:"},{"line_number":153,"context_line":"                port \u003d context._plugin.get_port(context._plugin_context,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a1a9d01_811f5e6b","line":150,"updated":"2015-09-29 00:51:46.000000000","message":"Can you replace this with L153?","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"}],"neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"fe914a0d1662706e555989d5d06395aab0ec3cdd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 OpenStack Foundation, all rights reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":13,"id":"9a1a9d01_010cae3f","line":1,"updated":"2015-09-29 00:51:46.000000000","message":"nit: This line is unnecessary.","commit_id":"aa94096a81b014df44d405831125d7a2e547a99d"}]}
