)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"492cfeb5fcdb389fc735587584b7aaca913ed86a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-24 20:37:19 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_b6f9c8ca","line":7,"updated":"2015-08-24 13:31:58.000000000","message":"s/DOWN/to DOWN/","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"690313d3e52ea8898ba0be987e987142a882e120","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-24 20:37:19 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_ef8f0521","line":7,"in_reply_to":"fa1b9901_b6f9c8ca","updated":"2015-08-26 04:10:11.000000000","message":"Done","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"492cfeb5fcdb389fc735587584b7aaca913ed86a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_562f0c3e","line":9,"updated":"2015-08-24 13:31:58.000000000","message":"s/stauts/status/","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"690313d3e52ea8898ba0be987e987142a882e120","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_8ff769d2","line":9,"in_reply_to":"fa1b9901_562f0c3e","updated":"2015-08-26 04:10:11.000000000","message":"Done","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"492cfeb5fcdb389fc735587584b7aaca913ed86a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_f6aae084","line":10,"updated":"2015-08-24 13:31:58.000000000","message":"I think \"in some cases ...\" should be a new sentence.","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"690313d3e52ea8898ba0be987e987142a882e120","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Update port\u0027s status DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_0f3279a7","line":10,"in_reply_to":"fa1b9901_f6aae084","updated":"2015-08-26 04:10:11.000000000","message":"agree","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"492cfeb5fcdb389fc735587584b7aaca913ed86a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."},{"line_number":14,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":15,"context_line":"DOWN if its binding info has changed."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_36d3783a","line":12,"updated":"2015-08-24 13:31:58.000000000","message":"s/stauts/status/","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"690313d3e52ea8898ba0be987e987142a882e120","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Now if port\u0027s binding info changes, its stauts stays the same,"},{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."},{"line_number":14,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":15,"context_line":"DOWN if its binding info has changed."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_8fe5290a","line":12,"in_reply_to":"fa1b9901_36d3783a","updated":"2015-08-26 04:10:11.000000000","message":"Done","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"492cfeb5fcdb389fc735587584b7aaca913ed86a","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."},{"line_number":14,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":15,"context_line":"DOWN if its binding info has changed."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_d6fd5c3c","line":13,"updated":"2015-08-24 13:31:58.000000000","message":"I\u0027m afraid I don\u0027t understand.  Firstly I don\u0027t think it\u0027s clear what you are saying.  It could be: \"When a VM is live-migrated from one compute node to another, and the port status changes from ACTIVE to BUILD to ACTIVE, L2 population does not work.\"  Or it could be \"When a VM is live-migrated from one compute node to another, the port status changes from ACTIVE to BUILD to ACTIVE, and L2 population does not work.\"  In other words, do you think that the port status is wrong per se, or is it the problem just that L2 population does not work?  Also, can you be more precise about _how_ L2 population does not work?\n\nSecondly, I know of various partners for whom live migration works - so presumably there must be more context details that you need to specify for the case you observe where it doesn\u0027t work.  For example, \"when using the linuxbridge agent and GRE tunnels\", or \"since the change made by commit ...\".","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"690313d3e52ea8898ba0be987e987142a882e120","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in some cases, there have some problems, for example, a"},{"line_number":11,"context_line":"VM live-migrate from one compute node to another, the"},{"line_number":12,"context_line":"process of port\u0027s stauts is ACTIVE-\u003eBUILD-\u003eACTIVE, the l2"},{"line_number":13,"context_line":"pop does not work."},{"line_number":14,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":15,"context_line":"DOWN if its binding info has changed."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_af7eed18","line":13,"in_reply_to":"fa1b9901_d6fd5c3c","updated":"2015-08-26 04:10:11.000000000","message":"I will modify the commit message to describe the scenario","commit_id":"b54d5d5209c025b36b89abe979b242bfd921deaf"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"b8692f451829840c656a921a8124508592f146c6","unresolved":false,"context_lines":[{"line_number":16,"context_line":"will do l2 pop, for these two ports, their status are all"},{"line_number":17,"context_line":"ACTIVE, so l2 pop does not work."},{"line_number":18,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":19,"context_line":"DOWN if its binding info has changed."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-bug: #1483601"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa1b9901_a36916c0","line":19,"updated":"2015-08-26 11:28:28.000000000","message":"Here\u0027s how I would describe this - assuming that I have correctly understood this bug and fix.\n\n\"This fixes the problem that when two or more ports in a network are migrated to a host that did not previously have any ports in the same network, the new host is sometimes not told about the IP/MAC addresses of all the other ports in the network.  In other words, initial L2population does not work, for the new host.\n\n\"This is because the l2pop mechanism driver only sends catch-up information to the host when it thinks it is dealing with the first active port on that host; and currently, when multiple ports are migrated to a new host, there is always more than one active port - so the condition above is never triggered.\n\n\"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when its binding:host_id is changing.\"\n\nWould you find some of that text useful?","commit_id":"0347808059e7fe3ccb72e0bb7ac3e42301891dee"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"4ea0a4dbdf488e4d2ef8a43c28edb96358db07f8","unresolved":false,"context_lines":[{"line_number":16,"context_line":"will do l2 pop, for these two ports, their status are all"},{"line_number":17,"context_line":"ACTIVE, so l2 pop does not work."},{"line_number":18,"context_line":"this patch changes update_port, it changes port\u0027s status"},{"line_number":19,"context_line":"DOWN if its binding info has changed."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-bug: #1483601"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da20952f_389f0905","line":19,"in_reply_to":"fa1b9901_a36916c0","updated":"2015-08-27 06:27:01.000000000","message":"very good suggestion, thx very much","commit_id":"0347808059e7fe3ccb72e0bb7ac3e42301891dee"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dca77322a5b70faff0913a8b74a2de74327d3c80","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-01-11 16:41:54 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status to DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This fixes the problem that when two or more ports in a network"},{"line_number":10,"context_line":"are migrated to a host that did not previously have any ports in"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa69d971_251e8c70","line":7,"updated":"2016-01-11 12:25:05.000000000","message":"Please add ML2: prefix here","commit_id":"e07854ee7cfcf62f423d72f35feca6607794de1f"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"abd216d576b290618ee0be409cd270326d3a59eb","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-01-11 16:41:54 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update port\u0027s status to DOWN if its binding info has changed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This fixes the problem that when two or more ports in a network"},{"line_number":10,"context_line":"are migrated to a host that did not previously have any ports in"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa69d971_105f08e6","line":7,"in_reply_to":"fa69d971_251e8c70","updated":"2016-01-11 12:31:11.000000000","message":"agree","commit_id":"e07854ee7cfcf62f423d72f35feca6607794de1f"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"86f57fd2ab1f05bffd5cfc679078beb0ba19796f","unresolved":false,"context_lines":[{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I342ad910360b21085316c25df2154854fd1001b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa69d971_f4f90f4f","line":25,"updated":"2016-01-11 10:35:05.000000000","message":"You can also set Closes-bug : #1443421","commit_id":"e07854ee7cfcf62f423d72f35feca6607794de1f"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"abd216d576b290618ee0be409cd270326d3a59eb","unresolved":false,"context_lines":[{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I342ad910360b21085316c25df2154854fd1001b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa69d971_30648cb7","line":25,"in_reply_to":"fa69d971_f4f90f4f","updated":"2016-01-11 12:31:11.000000000","message":"agree","commit_id":"e07854ee7cfcf62f423d72f35feca6607794de1f"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"aa94a5b3e8066538058325a37592836d0267dd7e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"migrated to a new host, there is always more than one active port so"},{"line_number":19,"context_line":"the condition above is never triggered."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when"},{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"da6ed579_80ec68f4","line":21,"range":{"start_line":21,"start_character":56,"end_line":21,"end_character":60},"updated":"2016-01-18 13:51:26.000000000","message":"Not sure what would be the best status here. In live migration case port actually remains active, so BUILD might be better status for migrating port.","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ce161c804b63d092215f3e7a7f6eaa5ece540d59","unresolved":false,"context_lines":[{"line_number":18,"context_line":"migrated to a new host, there is always more than one active port so"},{"line_number":19,"context_line":"the condition above is never triggered."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when"},{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"ba63e191_64bacee3","line":21,"range":{"start_line":21,"start_character":56,"end_line":21,"end_character":60},"in_reply_to":"ba63e191_34040e14","updated":"2016-01-19 07:21:55.000000000","message":"I tend to agree, when we\u0027re changing port\u0027s host we\u0027re marking that port as DOWN meaning that it is down on that host.","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"93013decf7da05674c2810128bb30f1f1e9abeba","unresolved":false,"context_lines":[{"line_number":18,"context_line":"migrated to a new host, there is always more than one active port so"},{"line_number":19,"context_line":"the condition above is never triggered."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when"},{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"ba63e191_34040e14","line":21,"range":{"start_line":21,"start_character":56,"end_line":21,"end_character":60},"in_reply_to":"da6ed579_80ec68f4","updated":"2016-01-19 01:20:26.000000000","message":"hi Oleg Bondarev, thx very much for your review, now l2 agent does the work for a port: get_device_details -\u003e update_device_up, the change for port\u0027s status is: BUILD -\u003eACTIVE, so I think the DOWN is the best status for migrated port, what do you think?","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e151440586c20596cb3c05a1b9a60e03c7958400","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":"Closes-bug: #1443421"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Change-Id: I342ad910360b21085316c25df2154854fd1001b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"9a68dd71_271ddabd","line":26,"updated":"2016-01-20 12:04:11.000000000","message":"please also add Closes-Bug: #1522824 and Related-Bug: #1450604","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d925ccb057fc6c4e45178f38548cf736f5547ff7","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":"Closes-bug: #1443421"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Change-Id: I342ad910360b21085316c25df2154854fd1001b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"9a68dd71_a58d197d","line":26,"in_reply_to":"9a68dd71_271ddabd","updated":"2016-01-21 01:15:40.000000000","message":"agree","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9386a3e515175c15c2254abe369895905ef52422","unresolved":false,"context_lines":[{"line_number":19,"context_line":"the condition above is never triggered."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when"},{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":"Closes-bug: #1443421"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a68dd71_049dfe64","line":22,"updated":"2016-01-21 07:20:53.000000000","message":"Sorry, I forgot to mention, please add: \"This also fixes the bug when nova thinks it should not wait for any events from neutron because all ports are already active.\"","commit_id":"170d54bf9acc844845073bca0d2a84a8e046c920"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"7cdef59a4ebe5b1e77c8b258a35402dfde89a44d","unresolved":false,"context_lines":[{"line_number":19,"context_line":"the condition above is never triggered."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The fix is for the ML2 plugin to set a port\u0027s status to DOWN when"},{"line_number":22,"context_line":"its binding info changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-bug: #1483601"},{"line_number":25,"context_line":"Closes-bug: #1443421"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a68dd71_24dcc2e3","line":22,"in_reply_to":"9a68dd71_049dfe64","updated":"2016-01-21 08:16:38.000000000","message":"got it","commit_id":"170d54bf9acc844845073bca0d2a84a8e046c920"}],"neutron/plugins/ml2/drivers/l2pop/mech_driver.py":[{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"4975421100b54ca6893efcec002f091c2778a883","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_b4c5408f","line":128,"updated":"2015-09-15 08:20:51.000000000","message":"AFAIU you\u0027re removing this test because l2pop will be notified of the new status of the port (DOWN), before being notified of the new host.\n\nNow, with this change, it seems that you send the \"fdb remove\" rpc message twice : when the port status goes \"DOWN\" and when the port status goes \"BUILD\". It is not needed, I even think that \"migrated_port\" structure might not be necessary if the status is changed to \"DOWN\" when the port is migrated.","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"80802e42db6822548807917239f84d07caf23c66","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_9c13690d","line":128,"in_reply_to":"ba15a1d1_189f73b5","updated":"2015-09-15 16:43:25.000000000","message":"I did not have time to test but here is my feeling of what is going to happen with this implementation : \n\n- 1 : l2pop will first be called with update_port_postcommit(new_status\u003dDOWN). moving the port status to DOWN state doesn\u0027t trigger the population of the migrated_ports dict. It triggers the fdb_remove message. This message might not be correct because you\u0027ll send a removal for an fdb entry that has not been populated earlier, since remove_fdb_entries() line #140 will calculate fdb entries with the new host and the the previous host.\n\n- 2 : then l2pop will be called another time with update_port_postcommit(new_host), which will populate the migrated_ports dict.\n\n- 3 : then l2 agent of the new host is doing its job, and the port status will be updated to BUILD :  this will trigger the correct remove_fdb_entries call line #143, by poping the migrated_ports dict. and the entry will be removed.\n\n\nWhat I mean is that if we move to an implementation where update_port(host) from nova triggers a modification of the port status, I think that step 1 should send the correct fdb_remove message, hence we won\u0027t need step 2 and step 3. So we won\u0027t need the migrated_ports dict anymore, and \nhttps://review.openstack.org/#/c/175383/ would be fixed too!","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"62ced2a862dd00ea4fd6ee7e1216f845582a0d9a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_be6b7db8","line":128,"in_reply_to":"ba15a1d1_9c13690d","updated":"2015-09-17 02:31:05.000000000","message":"as your analysis 1: \u0027l2pop will first be called with update_port_postcommit(new_status\u003dDOWN). moving the port status to DOWN state doesn\u0027t trigger the population of the migrated_ports dict. It triggers the fdb_remove message\u0027, I think it will not trigger the fdb_remove message, because when l2pop will first be called, it just meet this if statement \u0027context.host !\u003d context.original_host\u0027 then it return, it will not do following check, I am right?","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"7211e06f5dcbf1d307903217327351a89b0013d1","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_189f73b5","line":128,"in_reply_to":"ba15a1d1_b4c5408f","updated":"2015-09-15 12:38:32.000000000","message":"hi Mathieu Rohon, thx very much for your suggestion, for your    question: 1. I think \"fdb remove\" will just send once, because after nova migrating a VM, it just update port\u0027s host_id, then I will port\u0027s status to DOWN, and add this port to self.migrated_ports, in line #143, it will skip this statement, then l2 agent scans this device and get its detail through RPC, now port\u0027s status will be updated to BUILD, it will trigger l2 pop in #143. 2.As description, l2-pop in second port\u0027update, so \"migrated_port\" structure can\u0027t be removed","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"7211e06f5dcbf1d307903217327351a89b0013d1","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                    context, port, context.host)"},{"line_number":141,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":142,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":143,"context_line":"            elif context.status \u003d\u003d const.PORT_STATUS_BUILD:"},{"line_number":144,"context_line":"                orig \u003d self.migrated_ports.pop(port[\u0027id\u0027], None)"},{"line_number":145,"context_line":"                if orig:"},{"line_number":146,"context_line":"                    original_port \u003d orig[0]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_d8a81bde","line":143,"updated":"2015-09-15 12:38:32.000000000","message":"when do l2-pop, self.migrated_ports will pop this port, so it can\u0027t be done twice","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"679ddde28528ec843dbbe63303111f4dd15676e1","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_42fd5daf","line":128,"updated":"2016-01-07 08:48:25.000000000","message":"and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE and context.status \u003d\u003d const.PORT_STATUS_DOWN)\n\nAs we explicitly changing status from ACTIVE to DOWN when host is changed. \n\nOtherwise we will be sending port removal notification again if old agent\u0027s update_device_down comes before nova port_update(host).","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"5075af30428325763d85d0a574f977952e5a2d1c","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                        context, port, agent_host)"},{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_7f64b3e4","line":128,"in_reply_to":"fa69d971_42fd5daf","updated":"2016-01-07 12:43:01.000000000","message":"Done","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"16b886247135b8d4e55091b455c9a0227a66357d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"},{"line_number":132,"context_line":"            # on the destination host"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_a233f960","line":129,"updated":"2016-01-07 09:06:53.000000000","message":"Your change will be helpful for https://bugs.launchpad.net/neutron/+bug/1443421\n\nIf you can modify the code like below in this patch, then we can abandon the patch https://review.openstack.org/#/c/175383\n\n        elif (context.host !\u003d context.original_host\n            and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE\n            and context.status \u003d\u003d const.PORT_STATUS_DOWN):\n\n            # The port has been migrated. Send notification about port removal from old host\n            fdb_entries \u003d self._get_agent_fdb(\n                context, port, context.original_host)               \n            self.L2populationAgentNotify.remove_fdb_entries(\n                        self.rpc_ctx, fdb_entries)\n        elif context.status !\u003d context.original_status:\n            if context.status \u003d\u003d const.PORT_STATUS_ACTIVE:\n                self._update_port_up(context)\n            elif context.status \u003d\u003d const.PORT_STATUS_DOWN:\n                fdb_entries \u003d self._get_agent_fdb(\n                    context, port, context.host)\n                self.L2populationAgentNotify.remove_fdb_entries(\n                    self.rpc_ctx, fdb_entries)","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"5075af30428325763d85d0a574f977952e5a2d1c","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":127,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":128,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":129,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":130,"context_line":"            # The port has been migrated. We have to store the original"},{"line_number":131,"context_line":"            # binding to send appropriate fdb once the port will be set"},{"line_number":132,"context_line":"            # on the destination host"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_5f676fea","line":129,"in_reply_to":"fa69d971_a233f960","updated":"2016-01-07 12:43:01.000000000","message":"agree","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ce161c804b63d092215f3e7a7f6eaa5ece540d59","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":126,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":127,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":128,"context_line":"              and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":129,"context_line":"              and context.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":130,"context_line":"            # The port has been migrated. Send notification about port"},{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_e4d1defc","line":129,"range":{"start_line":128,"start_character":14,"end_line":129,"end_character":58},"updated":"2016-01-19 07:21:55.000000000","message":"Do we really need to check port statuses here?","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"90b6c15d6e4b3fe14fdb3e0be3b740f75a23a503","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":126,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":127,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":128,"context_line":"              and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":129,"context_line":"              and context.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":130,"context_line":"            # The port has been migrated. Send notification about port"},{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_765a7285","line":129,"range":{"start_line":128,"start_character":14,"end_line":129,"end_character":58},"in_reply_to":"ba63e191_5a2c364a","updated":"2016-01-19 12:21:38.000000000","message":"agree","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"a027e85fba3d5b0b2720d51842f058e6e6ac1047","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":126,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":127,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":128,"context_line":"              and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":129,"context_line":"              and context.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":130,"context_line":"            # The port has been migrated. Send notification about port"},{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_5a2c364a","line":129,"range":{"start_line":128,"start_character":14,"end_line":129,"end_character":58},"in_reply_to":"ba63e191_b3b9e630","updated":"2016-01-19 11:24:33.000000000","message":"We need status check, to avoid sending port removal from old host notification twice. This will happen when\n1) update_port_device_down rpc call from old host reaches before\n2)update_port(with new host) from nova\nIf we don\u0027t add above status checks, we may send port removal notification from old host twice.","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d21e07cde3b3c1a829ac0cfc92a1c1cee477eb89","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":126,"context_line":"                    self.rpc_ctx, fdb_entries)"},{"line_number":127,"context_line":"        elif (context.host !\u003d context.original_host"},{"line_number":128,"context_line":"              and context.original_status \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":129,"context_line":"              and context.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":130,"context_line":"            # The port has been migrated. Send notification about port"},{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_b3b9e630","line":129,"range":{"start_line":128,"start_character":14,"end_line":129,"end_character":58},"in_reply_to":"ba63e191_e4d1defc","updated":"2016-01-19 09:09:19.000000000","message":"when port\u0027s host changes, the status must be down, so I think it is no need to check port status, @venkata anil, what do you think?","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"aa94a5b3e8066538058325a37592836d0267dd7e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("},{"line_number":133,"context_line":"                context, orig, context.original_host)"},{"line_number":134,"context_line":"            self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":135,"context_line":"                self.rpc_ctx, fdb_entries)"},{"line_number":136,"context_line":"        elif context.status !\u003d context.original_status:"},{"line_number":137,"context_line":"            if context.status \u003d\u003d const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_604e14c3","line":134,"range":{"start_line":134,"start_character":41,"end_line":134,"end_character":59},"updated":"2016-01-18 13:51:26.000000000","message":"isn\u0027t it too early to remove fdb enrties from original host? I\u0027ve done it after agent on new host reports port is active: https://review.openstack.org/#/c/253569/8/neutron/plugins/ml2/drivers/l2pop/mech_driver.py","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ce161c804b63d092215f3e7a7f6eaa5ece540d59","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("},{"line_number":133,"context_line":"                context, orig, context.original_host)"},{"line_number":134,"context_line":"            self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":135,"context_line":"                self.rpc_ctx, fdb_entries)"},{"line_number":136,"context_line":"        elif context.status !\u003d context.original_status:"},{"line_number":137,"context_line":"            if context.status \u003d\u003d const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_24829601","line":134,"range":{"start_line":134,"start_character":41,"end_line":134,"end_character":59},"in_reply_to":"ba63e191_74b6063f","updated":"2016-01-19 07:21:55.000000000","message":"Yeah, nova updates host after actual migration so we should be safe here.","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"93013decf7da05674c2810128bb30f1f1e9abeba","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            # removal from old host."},{"line_number":132,"context_line":"            fdb_entries \u003d self._get_agent_fdb("},{"line_number":133,"context_line":"                context, orig, context.original_host)"},{"line_number":134,"context_line":"            self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":135,"context_line":"                self.rpc_ctx, fdb_entries)"},{"line_number":136,"context_line":"        elif context.status !\u003d context.original_status:"},{"line_number":137,"context_line":"            if context.status \u003d\u003d const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_74b6063f","line":134,"range":{"start_line":134,"start_character":41,"end_line":134,"end_character":59},"in_reply_to":"da6ed579_604e14c3","updated":"2016-01-19 01:20:26.000000000","message":"until nova finish migrating VM, it updates port\u0027s host_id, so do you think it is too eraly to remove fdb?","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"22806574c8d769a04710d9e05f59feda70b1528b","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if context.host \u003d\u003d agent[\u0027host\u0027]:"},{"line_number":147,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            segment \u003d context.original_bottom_bound_segment"},{"line_number":150,"context_line":"        if not segment:"},{"line_number":151,"context_line":"            LOG.debug(\"Port %(port)s updated by agent %(agent)s isn\u0027t bound \""},{"line_number":152,"context_line":"                      \"to any segment\", {\u0027port\u0027: port_id, \u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_ba123908","line":149,"updated":"2016-02-02 10:12:04.000000000","message":"This is bad logic to have in this function because it makes assumption about what the caller is asking for based on a hostname match.\n\nPlease change the signature of _get_agent_fdb instead to pass the segment it wants instead of the context. Same with _get_and_validate_segment. Explicit is much better than implicit in this regard.","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"415cff83216fa37b9d4d0c31901b0df79d7b3ef2","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if context.host \u003d\u003d agent[\u0027host\u0027]:"},{"line_number":147,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            segment \u003d context.original_bottom_bound_segment"},{"line_number":150,"context_line":"        if not segment:"},{"line_number":151,"context_line":"            LOG.debug(\"Port %(port)s updated by agent %(agent)s isn\u0027t bound \""},{"line_number":152,"context_line":"                      \"to any segment\", {\u0027port\u0027: port_id, \u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_50cd2285","line":149,"range":{"start_line":149,"start_character":12,"end_line":149,"end_character":58},"updated":"2016-01-26 08:08:14.000000000","message":"how is this related?","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"2b3a92149f6c5992f47e2989077079a32944a3bf","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if context.host \u003d\u003d agent[\u0027host\u0027]:"},{"line_number":147,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            segment \u003d context.original_bottom_bound_segment"},{"line_number":150,"context_line":"        if not segment:"},{"line_number":151,"context_line":"            LOG.debug(\"Port %(port)s updated by agent %(agent)s isn\u0027t bound \""},{"line_number":152,"context_line":"                      \"to any segment\", {\u0027port\u0027: port_id, \u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_d5b826eb","line":149,"in_reply_to":"7a5de9d1_ba123908","updated":"2016-02-02 10:53:30.000000000","message":"ok","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d5c080e97c2d4c01b745d66ccdbe9373214715c5","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if context.host \u003d\u003d agent[\u0027host\u0027]:"},{"line_number":147,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            segment \u003d context.original_bottom_bound_segment"},{"line_number":150,"context_line":"        if not segment:"},{"line_number":151,"context_line":"            LOG.debug(\"Port %(port)s updated by agent %(agent)s isn\u0027t bound \""},{"line_number":152,"context_line":"                      \"to any segment\", {\u0027port\u0027: port_id, \u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_3aa96025","line":149,"range":{"start_line":149,"start_character":12,"end_line":149,"end_character":58},"in_reply_to":"9a68dd71_1a51fc0e","updated":"2016-01-26 11:56:48.000000000","message":"got it, thanks","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"923b360ee3b79fbdb6485c7a790344122823990f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if context.host \u003d\u003d agent[\u0027host\u0027]:"},{"line_number":147,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            segment \u003d context.original_bottom_bound_segment"},{"line_number":150,"context_line":"        if not segment:"},{"line_number":151,"context_line":"            LOG.debug(\"Port %(port)s updated by agent %(agent)s isn\u0027t bound \""},{"line_number":152,"context_line":"                      \"to any segment\", {\u0027port\u0027: port_id, \u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_1a51fc0e","line":149,"range":{"start_line":149,"start_character":12,"end_line":149,"end_character":58},"in_reply_to":"9a68dd71_50cd2285","updated":"2016-01-26 11:41:20.000000000","message":"if a port has migrated, when we send remove_fdb_entries to original host, we should use context.original_bottom_bound_segment","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1388ca254ef9661586ec3dea9d5fedc39625cec2","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            session, agent_host, network_id)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        agent \u003d l2pop_db.get_agent_by_host(db_api.get_session(), agent_host)"},{"line_number":253,"context_line":"        if context.host \u003d\u003d agent_host:"},{"line_number":254,"context_line":"            segment \u003d context.bottom_bound_segment"},{"line_number":255,"context_line":"        else:"},{"line_number":256,"context_line":"            segment \u003d context.original_bottom_bound_segment"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_bb38fb3e","line":253,"updated":"2016-02-02 11:05:34.000000000","message":"This is still the same issue. It\u0027s logic that doesn\u0027t make any sense without knowing about what the caller is expecting. This function is basically guessing which segment the caller wants details for based on a hostname match. It shouldn\u0027t be the responsibility of this function to figure it out. The caller knows what it wants, make it ask for it.\n\nThat is why I suggested changing the signature of _get_agent_fdb to accept a segment instead of a context.","commit_id":"33dbe111218cee7efa3c69282c254d70a7547d83"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"eb83a543cb252f39e780efc2af313b57f1a6b0f0","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1158,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            binding_changed \u003d self._process_port_binding(mech_context, attrs)"},{"line_number":1161,"context_line":"            if binding_changed:"},{"line_number":1162,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1163,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_8b05d646","line":1160,"updated":"2015-08-21 09:32:56.000000000","message":"I am not sure that binding changed only means host changes, there could be other uses that change the binding profile and don\u0027t need to change the port status in that case.\n\nFor example in OVN we use the binding profile to specify parent port and tag (which can be set differently)\n\nAnother question is, Neutron support live migration? or is that part of enabling it?","commit_id":"af969c9acc2d0685aa3c1fe791bcd4a3ee4ad9dc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"bd2a736d4b7e19c72b4373d78740a8c77666afea","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1158,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            binding_changed \u003d self._process_port_binding(mech_context, attrs)"},{"line_number":1161,"context_line":"            if binding_changed:"},{"line_number":1162,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1163,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_d24a7327","line":1160,"in_reply_to":"fa1b9901_8b05d646","updated":"2015-08-22 08:20:22.000000000","message":"hi gal, thx for your review, for your question:\n1.if user change port\u0027s binding profile, the neutron-server also need to notify l2 agents, then l2 agents will gets port new binding profile info through RPC, so the process of port status change is: ACTIVE-\u003eBUILD-\u003eACTIVE\n2.I mean nova live-migrate VM","commit_id":"af969c9acc2d0685aa3c1fe791bcd4a3ee4ad9dc"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"5ef898dee5a3b6e328f072716113c5f99891f22f","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            binding_changed \u003d self._process_port_binding(mech_context, attrs)"},{"line_number":1161,"context_line":"            if binding_changed:"},{"line_number":1162,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1163,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1164,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_e8949b8b","line":1161,"updated":"2015-08-21 08:03:53.000000000","message":"How about \"if (self._process_port_binding(mech_context, attrs)):\" rather introducing an extra variable?","commit_id":"af969c9acc2d0685aa3c1fe791bcd4a3ee4ad9dc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"bd2a736d4b7e19c72b4373d78740a8c77666afea","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            binding_changed \u003d self._process_port_binding(mech_context, attrs)"},{"line_number":1161,"context_line":"            if binding_changed:"},{"line_number":1162,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1163,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1164,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_f247771b","line":1161,"in_reply_to":"fa1b9901_e8949b8b","updated":"2015-08-22 08:20:22.000000000","message":"agree","commit_id":"af969c9acc2d0685aa3c1fe791bcd4a3ee4ad9dc"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"b8692f451829840c656a921a8124508592f146c6","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_43959a30","line":1163,"updated":"2015-08-26 11:28:28.000000000","message":"I wonder if this fix will work in all cases.  In particular, I suspect that it will not work if a mechanism driver\u0027s update_port_postcommit hook synchronously sets the port status back to ACTIVE.  In that case:\n\n- when the first migrated port comes through this code here, its status will be DOWN, but the other migrated port will still be ACTIVE, so the condition in _update_port_up will not trigger; and immediately afterwards the first port status will change to ACTIVE again\n\n- when the second migrated port comes through this code here, its status will be DOWN, but the first migrated port will already be ACTIVE.  So again the condition in _update_port_up will not trigger.\n\nHave I misunderstood something about how the fix should work?\n\nIs it allowed for a mechanism driver\u0027s update_port_postcommit to synchronously set ACTIVE port status?  The mechanism driver for my project [1] does this.\n\n(On the other hand, my project doesn\u0027t use l2population - so this won\u0027t matter in practice for me.  But perhaps it will for other projects.)\n\n[1] https://github.com/projectcalico/calico/blob/master/calico/openstack/mech_calico.py","commit_id":"0347808059e7fe3ccb72e0bb7ac3e42301891dee"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"9f48434e36f903acb0178a54216bc87583d362b4","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_883cb694","line":1163,"in_reply_to":"da20952f_388389ce","updated":"2015-08-27 10:49:50.000000000","message":"OK, thanks.  Just to check that I\u0027m completely understanding you, I think you\u0027re saying that:\n\n- If two (or more) ports are migrated to the same new host at the same time, they will both have binding:host_id changed and status set to DOWN, before the ML2 plugin makes any mech driver update_port_postcommit calls.\n\n- If there is a time gap between the first port migration and the next, then binding:host_id for the second port will still be at its old value - and so not the new host - when the ML2 plugin processes the first migration.\n\nHence, in both cases, the new host gets a full catch up of l2pop information.\n\nIf that\u0027s correct, I\u0027m now fine with this fix.  Thanks for being patient with me!","commit_id":"0347808059e7fe3ccb72e0bb7ac3e42301891dee"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"4ea0a4dbdf488e4d2ef8a43c28edb96358db07f8","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_388389ce","line":1163,"in_reply_to":"fa1b9901_43959a30","updated":"2015-08-27 06:27:01.000000000","message":"hi Neil, your question is very good, but there is no problem in the your case, because if we change port binding host, the port\u0027s status will be change at the same time, so \u0027when the first migrated port comes through this code here, its status will be DOWN\u0027, if other migrated port has migrated to this host, its status will be DOWN, not ACTIVE, so the _update_port_up will trigger :)","commit_id":"0347808059e7fe3ccb72e0bb7ac3e42301891dee"},{"author":{"_account_id":8282,"name":"Dong Liu","email":"willowd878@gmail.com","username":"liudong"},"change_message_id":"6fa937f725e5acb3d9c9083c9a425745a139edeb","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_f7163ca6","line":1162,"updated":"2015-08-28 08:38:30.000000000","message":"Do you think it is better to update port status in _process_port_binding method?","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":8282,"name":"Dong Liu","email":"willowd878@gmail.com","username":"liudong"},"change_message_id":"50ab25b8886b3dc92246afff25003f8a9f62fe46","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_5c270864","line":1162,"in_reply_to":"da20952f_49ff4834","updated":"2015-08-28 09:51:19.000000000","message":"yes, that\u0027s right, like method \"update_security_group_on_port\"","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"a83c24c4bee3087e0cc4877d5890c6114dd60044","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                mech_context, attrs)"},{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_49ff4834","line":1162,"in_reply_to":"da20952f_f7163ca6","updated":"2015-08-28 09:42:02.000000000","message":"let me think, if we update port status in _process_port_binding method, we must pass updated_port to _process_port_binding method","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d44e80b9dadf477f32c10ac37f031b11b36bba68","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_52ade8e7","line":1163,"updated":"2015-08-27 12:50:08.000000000","message":"I\u0027m not very familiar with the L2pop implementation, but sounds more like a workaround?.\n\nCould we fix the L2Pop information itself instead somehow?...\n\nI\u0027d like other with more knowledge about L2Pop implementation to weight in.","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"7f107bb8deaf86196132cdf1054c3c0d9a301acc","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_607ccd72","line":1163,"in_reply_to":"da20952f_52ade8e7","updated":"2015-08-27 14:46:27.000000000","message":"Done","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":5319,"name":"Sam Stoelinga","email":"sammiestoel@gmail.com","username":"sammiestoel"},"change_message_id":"60b7bcf11de1c45d65870d724fdbdea8a6e27881","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1161,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1162,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1163,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1164,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1165,"context_line":"            # DVRPortbinding context instead of the normal port context."},{"line_number":1166,"context_line":"            # The normal Portbinding context does not have the status"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_ab0fc137","line":1163,"in_reply_to":"da20952f_607ccd72","updated":"2015-08-30 04:42:10.000000000","message":"Can you upload the patch where this is done?...","commit_id":"55954cccfea6b559912fbc8898774b789bad482d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"754a49250d9b698079aef341c37b549e2aa7d2e8","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1176,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_5a467124","line":1178,"updated":"2015-09-14 16:08:15.000000000","message":"this function returns true even if only the portbindings.PROFILE has changed and not the binding host. Would that be a problem?","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"0d2e438e68c341e97d014ae1854c47adac3f8602","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1176,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_66b069de","line":1178,"in_reply_to":"ba15a1d1_5a467124","updated":"2015-09-15 01:01:04.000000000","message":"hi Rossella Sblendido, thx for your review, now even if the portbindings.PROFILE has changed, neutron-server also will notify the l2 agent this port has changed, then l2 agent get this port detail through RPC, then port\u0027s status also be ACTIVE -\u003e BUILD -\u003e ACTIVE","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"e5092db08e5313807d0d5d254329716840c939df","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1176,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_5ca07190","line":1178,"in_reply_to":"ba15a1d1_66b069de","updated":"2015-09-15 16:42:55.000000000","message":"actually with this change the status will be\n\nDOWN -\u003e BUILD -\u003e UP\n\nit\u0027s probably not a big deal but maybe some drivers maintainers should chime in here ...portbindings.PROFILE is mostly used by ml2 drivers","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e2478e8568518d4bc257a79f7b81a1285a83f45d","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_81929cf4","line":1180,"range":{"start_line":1180,"start_character":21,"end_line":1180,"end_character":39},"updated":"2015-09-18 10:23:25.000000000","message":"calling update_port_status here is a bit scaring as it has it\u0027s own subtransaction and precommit/postcommit calls.\n\nit at least defeats the purpose of postcommit, ie. called out of a transaction.","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"754a49250d9b698079aef341c37b549e2aa7d2e8","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_7ea002f5","line":1180,"updated":"2015-09-14 16:08:15.000000000","message":"why setting it to const.PORT_STATUS_DOWN and not to n_const.PORT_STATUS_BUILD ? When a port is created the first status is n_const.PORT_STATUS_BUILD , it would be consistent to set it here too","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"76c72bfb0eafbd3a90d8c0014e6a2ff285bf0396","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_9fd2495b","line":1180,"in_reply_to":"9a1a9d01_5f7a7178","updated":"2015-09-29 08:54:05.000000000","message":"got it, thx :)","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"c78be8456fbbf4c2852d0e4d0d586cf5651b31f3","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_5f7a7178","line":1180,"in_reply_to":"9a1a9d01_b5565328","updated":"2015-09-29 08:52:20.000000000","message":"shihanzhang,\n\nthey don\u0027t have postcommit calls.","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"7211e06f5dcbf1d307903217327351a89b0013d1","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_b858c7fb","line":1180,"in_reply_to":"ba15a1d1_292c7d01","updated":"2015-09-15 12:38:32.000000000","message":"it is better if port can add a new status \"Migrating\", but for this bug, it is not necessary, what does other reviewer think?","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"0d2e438e68c341e97d014ae1854c47adac3f8602","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_c6bb75c3","line":1180,"in_reply_to":"ba15a1d1_7ea002f5","updated":"2015-09-15 01:01:04.000000000","message":"when we create a new port, its first status is const.PORT_STATUS_DOWN, not n_const.PORT_STATUS_BUILD, and no \nmatter what status before changing, port\u0027s status will experience BUILD -\u003e ACTIVE, I am right?","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"18ae9d782af0ab78d5c278668927fe80e26d5979","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_b5565328","line":1180,"in_reply_to":"ba15a1d1_81929cf4","updated":"2015-09-29 07:47:15.000000000","message":"@YAMAMOTO Takashi, update_address_pairs_on_port in line #1164, _update_extra_dhcp_opts_on_port in line #1170 also have their own subtransaction","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"4975421100b54ca6893efcec002f091c2778a883","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                mech_context, attrs)"},{"line_number":1178,"context_line":"            if self._process_port_binding(mech_context, attrs):"},{"line_number":1179,"context_line":"                need_port_update_notify \u003d True"},{"line_number":1180,"context_line":"                self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1181,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1182,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1183,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_292c7d01","line":1180,"in_reply_to":"ba15a1d1_c6bb75c3","updated":"2015-09-15 08:20:51.000000000","message":"I think the most consistent would be to have a dedicated port status for migration, as nova does for VMs. A port status called \"Migrating\"","commit_id":"feb2d468bb45b8bf90e9213b7a229773291a99e2"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"679ddde28528ec843dbbe63303111f4dd15676e1","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":1202,"context_line":"                self, context, updated_port, network, binding, levels,"},{"line_number":1203,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1204,"context_line":"            port_changed \u003d self._check_port_host_changed(mech_context, attrs)"},{"line_number":1205,"context_line":"            if port_changed:"},{"line_number":1206,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1207,"context_line":"            need_port_update_notify |\u003d self._process_port_binding("}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_e2d2515b","line":1204,"updated":"2016-01-07 08:48:25.000000000","message":"Sometimes RPC message from old host(i.e update_device_down) comes before RPC message from nova(i.e port_update with new host).\nIn this case, port status will be already DOWN and all the agents are already notified about port removal from old host through l2pop.  \n\nSo we shouldn\u0027t again set const.PORT_STATUS_DOWN and call update_port_status. If we do this, l2pop will again send port removal notification to all agents.\n\nSo below check is needed here:\nif original_port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_DOWN:\n   port_changed \u003d False","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"5075af30428325763d85d0a574f977952e5a2d1c","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":1202,"context_line":"                self, context, updated_port, network, binding, levels,"},{"line_number":1203,"context_line":"                original_port\u003doriginal_port)"},{"line_number":1204,"context_line":"            port_changed \u003d self._check_port_host_changed(mech_context, attrs)"},{"line_number":1205,"context_line":"            if port_changed:"},{"line_number":1206,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1207,"context_line":"            need_port_update_notify |\u003d self._process_port_binding("}],"source_content_type":"text/x-python","patch_set":7,"id":"fa69d971_24806e8b","line":1204,"in_reply_to":"fa69d971_e2d2515b","updated":"2016-01-07 12:43:01.000000000","message":"venkata anil, thx for your nice analysis, I very agree with you","commit_id":"d0fbb14ce835fc8d695336d3f7d9c08818bc84bc"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"a55ce0929dbbd00454f926b1a01d22bff08f58af","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":266,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":267,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":268,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":271,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_091c6969","line":268,"updated":"2016-01-15 19:27:36.000000000","message":"I think the port\u0027s status should be set to DOWN here, rather than in update_port(). See comment below on line 1238.","commit_id":"12419701b8e76360fe0b0ede0fe0dbe81bbc6f33"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"95dd445028a21fb1d9773ba4be3c30718be69b22","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":266,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":267,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":268,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":271,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_06bbeb76","line":268,"in_reply_to":"da6ed579_091c6969","updated":"2016-01-16 02:15:57.000000000","message":"Done","commit_id":"12419701b8e76360fe0b0ede0fe0dbe81bbc6f33"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"a55ce0929dbbd00454f926b1a01d22bff08f58af","unresolved":false,"context_lines":[{"line_number":1235,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1236,"context_line":""},{"line_number":1237,"context_line":"        if status_changed:"},{"line_number":1238,"context_line":"            self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1239,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1240,"context_line":"        kwargs \u003d {"},{"line_number":1241,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_298ccd7e","line":1238,"updated":"2016-01-15 19:27:36.000000000","message":"Calling update_port_status() here results in a separate set of port_update_[pre|post]_commit() operations being seen by the mechanism drivers. But the updating of the port status should really just be an additional side-effect seen as part of the same port_update already being processed.\n\nI think port\u0027s status should be changed to DOWN in _process_port_binding() around line 268. That function detects all changes that force rebinding, including changing the binding:host_id, so the _check_host_port_changed() function would not be needed.","commit_id":"12419701b8e76360fe0b0ede0fe0dbe81bbc6f33"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"95dd445028a21fb1d9773ba4be3c30718be69b22","unresolved":false,"context_lines":[{"line_number":1235,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1236,"context_line":""},{"line_number":1237,"context_line":"        if status_changed:"},{"line_number":1238,"context_line":"            self.update_port_status(context, id, const.PORT_STATUS_DOWN)"},{"line_number":1239,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1240,"context_line":"        kwargs \u003d {"},{"line_number":1241,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_668f47cd","line":1238,"in_reply_to":"da6ed579_298ccd7e","updated":"2016-01-16 02:15:57.000000000","message":"maybe you are right","commit_id":"12419701b8e76360fe0b0ede0fe0dbe81bbc6f33"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"aa94a5b3e8066538058325a37592836d0267dd7e","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":285,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            self.update_port_status(mech_context._plugin_context, port_id,"},{"line_number":288,"context_line":"                                    const.PORT_STATUS_DOWN)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_cbaa81d2","line":287,"range":{"start_line":287,"start_character":17,"end_line":287,"end_character":35},"updated":"2016-01-18 13:51:26.000000000","message":"update_port_status will call update_port_postcommit() which should not be called inside transaction","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ce161c804b63d092215f3e7a7f6eaa5ece540d59","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":285,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            self.update_port_status(mech_context._plugin_context, port_id,"},{"line_number":288,"context_line":"                                    const.PORT_STATUS_DOWN)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_a420c6f8","line":287,"range":{"start_line":287,"start_character":17,"end_line":287,"end_character":35},"in_reply_to":"ba63e191_94413a3c","updated":"2016-01-19 07:21:55.000000000","message":"I think the idea was to just change port status in DB, using db plugin update_port() and not calling ml2 update_port_status()","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d21e07cde3b3c1a829ac0cfc92a1c1cee477eb89","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":285,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            self.update_port_status(mech_context._plugin_context, port_id,"},{"line_number":288,"context_line":"                                    const.PORT_STATUS_DOWN)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_8dbb65c4","line":287,"range":{"start_line":287,"start_character":17,"end_line":287,"end_character":35},"in_reply_to":"ba63e191_a420c6f8","updated":"2016-01-19 09:09:19.000000000","message":"agree","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"93013decf7da05674c2810128bb30f1f1e9abeba","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":285,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            self.update_port_status(mech_context._plugin_context, port_id,"},{"line_number":288,"context_line":"                                    const.PORT_STATUS_DOWN)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba63e191_94413a3c","line":287,"range":{"start_line":287,"start_character":17,"end_line":287,"end_character":35},"in_reply_to":"da6ed579_cbaa81d2","updated":"2016-01-19 01:20:26.000000000","message":"what do you think about Robert Kukura comments on patchset #10: Calling update_port_status() here results in a separate set of port_update_[pre|post]_commit() operations being seen by the mechanism drivers. But the updating of the port status should really just be an additional side-effect seen as part of the same port_update already being processed.\nI think port\u0027s status should be changed to DOWN in _process_port_binding() around line 268. That function detects all changes that force rebinding, including changing the binding:host_id, so the _check_host_port_changed() function would not be needed.","commit_id":"fb9f3f22494214b557a7c3276581dda5d857f699"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e151440586c20596cb3c05a1b9a60e03c7958400","unresolved":false,"context_lines":[{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":288,"context_line":"            super(Ml2Plugin, self).update_port(mech_context._plugin_context,"},{"line_number":289,"context_line":"                                               port_id, {\u0027port\u0027: port})"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":292,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_a7a30a4f","line":289,"range":{"start_line":289,"start_character":65,"end_line":289,"end_character":69},"updated":"2016-01-20 12:04:11.000000000","message":"please do not pass the whole port dict, it will lead to unneeded processing, pass just {attributes.PORT: {\u0027status\u0027: const.PORT_STATUS_DOWN}}","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d925ccb057fc6c4e45178f38548cf736f5547ff7","unresolved":false,"context_lines":[{"line_number":286,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":287,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":288,"context_line":"            super(Ml2Plugin, self).update_port(mech_context._plugin_context,"},{"line_number":289,"context_line":"                                               port_id, {\u0027port\u0027: port})"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":292,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_a5b6793b","line":289,"range":{"start_line":289,"start_character":65,"end_line":289,"end_character":69},"in_reply_to":"9a68dd71_a7a30a4f","updated":"2016-01-21 01:15:40.000000000","message":"agree","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e151440586c20596cb3c05a1b9a60e03c7958400","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            port_binding_changed \u003d self._process_port_binding("},{"line_number":1216,"context_line":"                mech_context, attrs)"},{"line_number":1217,"context_line":"            if port_binding_changed:"},{"line_number":1218,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1219,"context_line":"            need_port_update_notify |\u003d port_binding_changed"},{"line_number":1220,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1221,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_0781b68f","line":1218,"range":{"start_line":1218,"start_character":16,"end_line":1218,"end_character":28},"updated":"2016-01-20 12:04:11.000000000","message":"wasn\u0027t it already updated at #287","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d925ccb057fc6c4e45178f38548cf736f5547ff7","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            port_binding_changed \u003d self._process_port_binding("},{"line_number":1216,"context_line":"                mech_context, attrs)"},{"line_number":1217,"context_line":"            if port_binding_changed:"},{"line_number":1218,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1219,"context_line":"            need_port_update_notify |\u003d port_binding_changed"},{"line_number":1220,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1221,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_e5e4710e","line":1218,"range":{"start_line":1218,"start_character":16,"end_line":1218,"end_character":28},"in_reply_to":"9a68dd71_0781b68f","updated":"2016-01-21 01:15:40.000000000","message":"at #287 line just update the info to DB, updated_port was not changed","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"b112dca9bee9a9a736def1f99fda0d8d84a646ae","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            port_binding_changed \u003d self._process_port_binding("},{"line_number":1216,"context_line":"                mech_context, attrs)"},{"line_number":1217,"context_line":"            if port_binding_changed:"},{"line_number":1218,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1219,"context_line":"            need_port_update_notify |\u003d port_binding_changed"},{"line_number":1220,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1221,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_6a7cc172","line":1218,"range":{"start_line":1218,"start_character":16,"end_line":1218,"end_character":28},"in_reply_to":"9a68dd71_842b2e30","updated":"2016-01-21 08:16:27.000000000","message":"you are right, I have checked it, thx :)","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1227d5913363cade0069b7bca42c2ff870a2241b","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            port_binding_changed \u003d self._process_port_binding("},{"line_number":1216,"context_line":"                mech_context, attrs)"},{"line_number":1217,"context_line":"            if port_binding_changed:"},{"line_number":1218,"context_line":"                updated_port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1219,"context_line":"            need_port_update_notify |\u003d port_binding_changed"},{"line_number":1220,"context_line":"            # For DVR router interface ports we need to retrieve the"},{"line_number":1221,"context_line":"            # DVRPortbinding context instead of the normal port context."}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_842b2e30","line":1218,"range":{"start_line":1218,"start_character":16,"end_line":1218,"end_character":28},"in_reply_to":"9a68dd71_e5e4710e","updated":"2016-01-21 07:16:49.000000000","message":"In fact 287 updates port dict which is the same dict as this one. Please check","commit_id":"2a7a5520a4518d8892edd73ffe55ea539d7e0150"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"79590c6fedb788cc716a40218ffba7bb2c0d239a","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host2\u0027"},{"line_number":526,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":527,"context_line":"            self.assertEqual(constants.PORT_STATUS_DOWN,"},{"line_number":528,"context_line":"                             port[\u0027port\u0027][\u0027status\u0027])"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def test_update_port_status_with_network(self):"},{"line_number":531,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_e0cebeb6","line":528,"updated":"2016-02-02 10:45:48.000000000","message":"+1","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0d8d5a7caec1d799330d39f85c523490e553a06f","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host2\u0027"},{"line_number":526,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":527,"context_line":"            self.assertEqual(constants.PORT_STATUS_DOWN,"},{"line_number":528,"context_line":"                             port[\u0027port\u0027][\u0027status\u0027])"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def test_update_port_status_with_network(self):"},{"line_number":531,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_daba9571","line":528,"updated":"2016-02-02 10:22:32.000000000","message":"shouldn\u0027t this check the return value of update_port() rather than \"port\"?","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"2b3a92149f6c5992f47e2989077079a32944a3bf","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host2\u0027"},{"line_number":526,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":527,"context_line":"            self.assertEqual(constants.PORT_STATUS_DOWN,"},{"line_number":528,"context_line":"                             port[\u0027port\u0027][\u0027status\u0027])"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def test_update_port_status_with_network(self):"},{"line_number":531,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_60888ec7","line":528,"in_reply_to":"7a5de9d1_daba9571","updated":"2016-02-02 10:53:30.000000000","message":"Done","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"2b3a92149f6c5992f47e2989077079a32944a3bf","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host2\u0027"},{"line_number":526,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":527,"context_line":"            self.assertEqual(constants.PORT_STATUS_DOWN,"},{"line_number":528,"context_line":"                             port[\u0027port\u0027][\u0027status\u0027])"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def test_update_port_status_with_network(self):"},{"line_number":531,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a5de9d1_c0a2a24b","line":528,"in_reply_to":"7a5de9d1_e0cebeb6","updated":"2016-02-02 10:53:30.000000000","message":"agree","commit_id":"97f8c4c6bb3f537970445763aaceecda904b679b"}]}
