)]}'
{"networking_ovn/common/ovn_client.py":[{"author":{"_account_id":11762,"name":"Han Zhou","email":"zhouhan@gmail.com","username":"hanzhou"},"change_message_id":"4d3fee1b3c61ccfa6e340158f3a439225435f6be","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                            \u0027getting the networks for the router port \u0027"},{"line_number":524,"context_line":"                            \u0027%(port_id)s. Skipping\u0027, {\u0027subnet_id\u0027: subnet_id,"},{"line_number":525,"context_line":"                                                      \u0027port_id\u0027: port[\u0027id\u0027]})"},{"line_number":526,"context_line":"                continue"},{"line_number":527,"context_line":"            cidr \u003d netaddr.IPNetwork(subnet[\u0027cidr\u0027])"},{"line_number":528,"context_line":"            networks.add(\"%s/%s\" % (fixed_ip[\u0027ip_address\u0027],"},{"line_number":529,"context_line":"                                    str(cidr.prefixlen)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_54685d1b","line":526,"updated":"2017-07-05 15:43:52.000000000","message":"what if none of the subnets exist? In that case an empty list will be returned, which will result in error in add_lrouter_port()/update_lrouter_port().","commit_id":"729977bfb82e7c922033e672618eb4bbaf186d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1bd524e466116cd12110017feaddf1102fcc495a","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                            \u0027getting the networks for the router port \u0027"},{"line_number":524,"context_line":"                            \u0027%(port_id)s. Skipping\u0027, {\u0027subnet_id\u0027: subnet_id,"},{"line_number":525,"context_line":"                                                      \u0027port_id\u0027: port[\u0027id\u0027]})"},{"line_number":526,"context_line":"                continue"},{"line_number":527,"context_line":"            cidr \u003d netaddr.IPNetwork(subnet[\u0027cidr\u0027])"},{"line_number":528,"context_line":"            networks.add(\"%s/%s\" % (fixed_ip[\u0027ip_address\u0027],"},{"line_number":529,"context_line":"                                    str(cidr.prefixlen)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_a762c9d6","line":526,"in_reply_to":"3f1d235d_54685d1b","updated":"2017-07-06 08:49:09.000000000","message":"Hmmm, I tried to reproduce it to see what kinda of error it would raise so I could remediate, so I added a return with an empty list at the beginning of the method [0] and ran some operations [1], they completed fine, I also don\u0027t see any errors in the log [2].\n\nSo, should I assume it would be OK ?! I mean, no extra code or check needed here. Unless you think that we should take some extra action in case no networks were found, any ideas ?\n\n[0] http://paste.openstack.org/show/614547/\n[1] http://paste.openstack.org/show/614549/\n[2] http://paste.openstack.org/show/614550/","commit_id":"729977bfb82e7c922033e672618eb4bbaf186d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"7d144f9d5e22efed3c57d386daa1321ab61d566e","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                            \u0027getting the networks for the router port \u0027"},{"line_number":524,"context_line":"                            \u0027%(port_id)s. Skipping\u0027, {\u0027subnet_id\u0027: subnet_id,"},{"line_number":525,"context_line":"                                                      \u0027port_id\u0027: port[\u0027id\u0027]})"},{"line_number":526,"context_line":"                continue"},{"line_number":527,"context_line":"            cidr \u003d netaddr.IPNetwork(subnet[\u0027cidr\u0027])"},{"line_number":528,"context_line":"            networks.add(\"%s/%s\" % (fixed_ip[\u0027ip_address\u0027],"},{"line_number":529,"context_line":"                                    str(cidr.prefixlen)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e78b21c0","line":526,"in_reply_to":"3f1d235d_a762c9d6","updated":"2017-07-06 09:00:37.000000000","message":"Sorry the error was right in my face, but it just didn\u0027t raise anything... If you look at [2] you can see it.\n\nI wonder what we should do then, perhaps skip adding/updating the router port if there\u0027s no networks and log a waning ?","commit_id":"729977bfb82e7c922033e672618eb4bbaf186d38"},{"author":{"_account_id":11762,"name":"Han Zhou","email":"zhouhan@gmail.com","username":"hanzhou"},"change_message_id":"eef407a6f888f0c56ac0fb88c62aad6a61eac4e8","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                            \u0027getting the networks for the router port \u0027"},{"line_number":524,"context_line":"                            \u0027%(port_id)s. Skipping\u0027, {\u0027subnet_id\u0027: subnet_id,"},{"line_number":525,"context_line":"                                                      \u0027port_id\u0027: port[\u0027id\u0027]})"},{"line_number":526,"context_line":"                continue"},{"line_number":527,"context_line":"            cidr \u003d netaddr.IPNetwork(subnet[\u0027cidr\u0027])"},{"line_number":528,"context_line":"            networks.add(\"%s/%s\" % (fixed_ip[\u0027ip_address\u0027],"},{"line_number":529,"context_line":"                                    str(cidr.prefixlen)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_f0e984e2","line":526,"in_reply_to":"3f1d235d_e78b21c0","updated":"2017-07-06 16:44:48.000000000","message":"Maybe we should think about the scenario how this happens. If there is chance that the subnet is already deleted, then the router port itself should have also got updated and the fixed_ip is also removed from the router port. So if we are querying DB here to find the details of subnet, then we should do the same to re-query DB to get the details of the router port, in the same transaction, to get consistent data. We should have a principle in the journal implementation that we always query the latest db status when executing the journal tasks, to apply the latest wisb to wiri. This way we\u0027ll be able to make sure the changes are consistent and no painful error handling, and anything not found can be treated as an error.\n\nAlso, I want to confirm, if the router port is already deleted before the journal item of creating the router port is executed, then it should also be deleted from the journal directly, right? I.e. any operation on the same object that is pending in journal, it should invalidate the old item in journal for the same object.","commit_id":"729977bfb82e7c922033e672618eb4bbaf186d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"540e2fc813c350540be0b2514e4155335581007a","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                            \u0027getting the networks for the router port \u0027"},{"line_number":524,"context_line":"                            \u0027%(port_id)s. Skipping\u0027, {\u0027subnet_id\u0027: subnet_id,"},{"line_number":525,"context_line":"                                                      \u0027port_id\u0027: port[\u0027id\u0027]})"},{"line_number":526,"context_line":"                continue"},{"line_number":527,"context_line":"            cidr \u003d netaddr.IPNetwork(subnet[\u0027cidr\u0027])"},{"line_number":528,"context_line":"            networks.add(\"%s/%s\" % (fixed_ip[\u0027ip_address\u0027],"},{"line_number":529,"context_line":"                                    str(cidr.prefixlen)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_57348efb","line":526,"in_reply_to":"3f1d235d_f0e984e2","updated":"2017-07-07 12:48:19.000000000","message":"Agreed, the actions on the same resource will be executed in order by the journal so it will always have the latest. The main problem comes with the recovery which by the time a entry is being recovered by some failure some other actions might have happened with that resource.\n\nAs to the question in the 2nd paragraph, yes, the same information above applies here too, the pending operations will be serialized and we make sure that we don\u0027t try to delete anything before the creation and updates of that resource.\n\n...\n\nI think I rollback my changes in this file and simple let it fail (and it will be logged) in case a subnet is removed, we can then improve the recovery bits to deal with this problem by fetching what is latest in the DB.","commit_id":"729977bfb82e7c922033e672618eb4bbaf186d38"}]}
