)]}'
{"specs/rocky/sbi-database-consistency.rst":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":8,"context_line":"Neutron/Southbound Interface consistency"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This document presents the problem and proposes a solution for the data"},{"line_number":12,"context_line":"consistency issue between the Neutron and Southbound Interface (SBI)."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_49b596ed","line":9,"updated":"2018-05-01 22:00:19.000000000","message":"Could you add a link to a corresponding neutron RFE here?","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":8,"context_line":"Neutron/Southbound Interface consistency"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This document presents the problem and proposes a solution for the data"},{"line_number":12,"context_line":"consistency issue between the Neutron and Southbound Interface (SBI)."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_04ae9b97","line":9,"in_reply_to":"9f6a8fd7_49b596ed","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"Problem description"},{"line_number":21,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"In a common Neutron deployment model there could have multiple Neutron"},{"line_number":24,"context_line":"API workers processing requests. For each request, the neutron worker"},{"line_number":25,"context_line":"will update the Neutron database and then invoke the SBI to translate"},{"line_number":26,"context_line":"the information to its specific data model."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_0400e066","line":23,"updated":"2018-05-02 07:28:57.000000000","message":"s/have/be/","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":20,"context_line":"Problem description"},{"line_number":21,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"In a common Neutron deployment model there could have multiple Neutron"},{"line_number":24,"context_line":"API workers processing requests. For each request, the neutron worker"},{"line_number":25,"context_line":"will update the Neutron database and then invoke the SBI to translate"},{"line_number":26,"context_line":"the information to its specific data model."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_845e2b10","line":23,"in_reply_to":"9f6a8fd7_0400e066","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"but an exception is raised upon trying to update the SBI"},{"line_number":67,"context_line":"(e.g. lost connectivity to the Southbound controller)."},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"This problems affected OVN -before adopting the solution this change proposes-"},{"line_number":70,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":71,"context_line":"this issue. Obviously, it would be possible to try to immediately rollback the"},{"line_number":72,"context_line":"changes in the Neutron database and raise an exception but, the rollback"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_2438843b","line":69,"updated":"2018-05-02 07:28:57.000000000","message":"s/problems/problem/","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":66,"context_line":"but an exception is raised upon trying to update the SBI"},{"line_number":67,"context_line":"(e.g. lost connectivity to the Southbound controller)."},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"This problems affected OVN -before adopting the solution this change proposes-"},{"line_number":70,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":71,"context_line":"this issue. Obviously, it would be possible to try to immediately rollback the"},{"line_number":72,"context_line":"changes in the Neutron database and raise an exception but, the rollback"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_449ed3b8","line":69,"in_reply_to":"9f6a8fd7_2438843b","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"This problems affected OVN -before adopting the solution this change proposes-"},{"line_number":70,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":71,"context_line":"this issue. Obviously, it would be possible to try to immediately rollback the"},{"line_number":72,"context_line":"changes in the Neutron database and raise an exception but, the rollback"},{"line_number":73,"context_line":"itself, is an operation that could also fail."},{"line_number":74,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_a9a312b1","line":71,"range":{"start_line":71,"start_character":12,"end_line":71,"end_character":23},"updated":"2018-05-01 22:00:19.000000000","message":"It is not obvious that we need to rollback it immediately.... retrying SBI sounds more straightforward... (though it is not a point that this spec tries to discuss)","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"This problems affected OVN -before adopting the solution this change proposes-"},{"line_number":70,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":71,"context_line":"this issue. Obviously, it would be possible to try to immediately rollback the"},{"line_number":72,"context_line":"changes in the Neutron database and raise an exception but, the rollback"},{"line_number":73,"context_line":"itself, is an operation that could also fail."},{"line_number":74,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_5a1b081a","line":71,"range":{"start_line":71,"start_character":12,"end_line":71,"end_character":23},"in_reply_to":"9f6a8fd7_a9a312b1","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"itself, is an operation that could also fail."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"In addition, rollbacks are not very straight forward when it comes to updates"},{"line_number":76,"context_line":"or deletes. In a case where a VM is being teared down and the SBI fails"},{"line_number":77,"context_line":"to delete a port, re-creating that port in Neutron doesn\u0027t necessary fix the"},{"line_number":78,"context_line":"problem. The decommission of a VM involves many other things, in fact, things"},{"line_number":79,"context_line":"could even be made worse by leaving some dirty data around. This is a problem"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_040ea08c","line":76,"range":{"start_line":76,"start_character":46,"end_line":76,"end_character":47},"updated":"2018-05-02 07:28:57.000000000","message":"s/teared/torn/","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":73,"context_line":"itself, is an operation that could also fail."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"In addition, rollbacks are not very straight forward when it comes to updates"},{"line_number":76,"context_line":"or deletes. In a case where a VM is being teared down and the SBI fails"},{"line_number":77,"context_line":"to delete a port, re-creating that port in Neutron doesn\u0027t necessary fix the"},{"line_number":78,"context_line":"problem. The decommission of a VM involves many other things, in fact, things"},{"line_number":79,"context_line":"could even be made worse by leaving some dirty data around. This is a problem"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_04a8dbd8","line":76,"range":{"start_line":76,"start_character":46,"end_line":76,"end_character":47},"in_reply_to":"9f6a8fd7_040ea08c","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"To achieve this, a new table schema would be created to allow each SBI"},{"line_number":128,"context_line":"to track and manage resources:"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":131,"context_line":"Column name       Type      Description"},{"line_number":132,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_e9ed8ab7","line":129,"updated":"2018-05-01 22:00:19.000000000","message":"What table name is proposed?\n\nI think appropriate column names would vary based on the table name.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"To achieve this, a new table schema would be created to allow each SBI"},{"line_number":128,"context_line":"to track and manage resources:"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":131,"context_line":"Column name       Type      Description"},{"line_number":132,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_44d57342","line":129,"in_reply_to":"9f6a8fd7_ca274f12","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"To achieve this, a new table schema would be created to allow each SBI"},{"line_number":128,"context_line":"to track and manage resources:"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":131,"context_line":"Column name       Type      Description"},{"line_number":132,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ca274f12","line":129,"in_reply_to":"9f6a8fd7_e9ed8ab7","updated":"2018-05-02 09:31:45.000000000","message":"Names are hard. In networking-ovn we call it \"ovn_revision_numbers\", perhaps for this generic implementation we could call it \"drivers_revision_numbers\" or even \"sbi_revision_numbers\"","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":133,"context_line":"standard_attr_id  Integer   The reference ID from the standardattributes"},{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_4934b64a","line":136,"updated":"2018-05-01 22:00:19.000000000","message":"Precisely speaking, resource UUID is unique per resource type, so I think (resource_uuid, resource_type) would be a primary key.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":133,"context_line":"standard_attr_id  Integer   The reference ID from the standardattributes"},{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_6acac31a","line":136,"in_reply_to":"9f6a8fd7_4934b64a","updated":"2018-05-02 09:31:45.000000000","message":"Agreed on having a composite pk (resource_uuid + resource_type). That\u0027s need for resources like router ports that are represented as a regular port + router interface. That\u0027s how we use it in networking-ovn as well [0]\n\n[0] https://github.com/openstack/networking-ovn/blob/4a5b0564de38d0d43d821dc8d8d21faba9589a8d/networking_ovn/db/migration/alembic_migrations/versions/queens/expand/5c198d2723b6_add_ovn_revision_resource_type_as_pk.py","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":133,"context_line":"standard_attr_id  Integer   The reference ID from the standardattributes"},{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_645437cb","line":136,"in_reply_to":"9f6a8fd7_6acac31a","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_e9426aab","line":137,"range":{"start_line":137,"start_character":28,"end_line":137,"end_character":77},"updated":"2018-05-01 22:00:19.000000000","message":"It is better to use the same terminology used in standardattributes table, i.e., ports, routers, .....","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_e45927fe","line":137,"range":{"start_line":137,"start_character":28,"end_line":137,"end_character":77},"in_reply_to":"9f6a8fd7_2ad4cbbc","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                            table in Neutron for that resource."},{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_2ad4cbbc","line":137,"range":{"start_line":137,"start_character":28,"end_line":137,"end_character":77},"in_reply_to":"9f6a8fd7_e9426aab","updated":"2018-05-02 09:31:45.000000000","message":"++\n\nhttps://github.com/openstack/networking-ovn/blob/4a5b0564de38d0d43d821dc8d8d21faba9589a8d/networking_ovn/common/constants.py#L97-L105","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":141,"context_line":"created_at        DateTime  The time that the entry was created. For"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_09279e14","line":138,"range":{"start_line":138,"start_character":0,"end_line":138,"end_character":13},"updated":"2018-05-01 22:00:19.000000000","message":"\"driver\" or \"driver_name\"?","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                            ONDELETE SET NULL."},{"line_number":136,"context_line":"resource_uuid     String    Primary key. The UUID of the resource"},{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":141,"context_line":"created_at        DateTime  The time that the entry was created. For"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_c46e6395","line":138,"range":{"start_line":138,"start_character":0,"end_line":138,"end_character":13},"in_reply_to":"9f6a8fd7_09279e14","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":141,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":142,"context_line":"                            troubleshooting purposes"},{"line_number":143,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_a97b12f2","line":140,"range":{"start_line":140,"start_character":0,"end_line":140,"end_character":15},"updated":"2018-05-01 22:00:19.000000000","message":"revision_number is also used in \"standardattributes\" table.\nIf the table name describes the purpose of this table, \"revision_number\" would be okay. otherwise, a better name needs to be explored.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":141,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":142,"context_line":"                            troubleshooting purposes"},{"line_number":143,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_646d1797","line":140,"range":{"start_line":140,"start_character":0,"end_line":140,"end_character":15},"in_reply_to":"9f6a8fd7_4af01f68","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"resource_type     String    The type of the resource (e.g, Port, Router, ...)"},{"line_number":138,"context_line":"resource_mgmt     String    The name of the SBI driver that manages the"},{"line_number":139,"context_line":"                            resource."},{"line_number":140,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":141,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":142,"context_line":"                            troubleshooting purposes"},{"line_number":143,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_4af01f68","line":140,"range":{"start_line":140,"start_character":0,"end_line":140,"end_character":15},"in_reply_to":"9f6a8fd7_a97b12f2","updated":"2018-05-02 09:31:45.000000000","message":"Yeah, as I think we can stick a \"*_revision_numbers\" in the table\u0027s name as per comment at L129","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":150,"context_line":"`````````"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"Each public method of the main interface will have two ways of accessing it,"},{"line_number":153,"context_line":"as a decorator and as a context manager."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":".. TODO(mpeterson): Check if the decorator version could be actually be"},{"line_number":156,"context_line":"   implemented, as I think not all *commit(...) work in the same way. I don\u0027t"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_695e5a77","line":153,"range":{"start_line":153,"start_character":0,"end_line":153,"end_character":40},"updated":"2018-05-01 22:00:19.000000000","message":"Is it true for \"new_resource\" too?","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":150,"context_line":"`````````"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"Each public method of the main interface will have two ways of accessing it,"},{"line_number":153,"context_line":"as a decorator and as a context manager."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":".. TODO(mpeterson): Check if the decorator version could be actually be"},{"line_number":156,"context_line":"   implemented, as I think not all *commit(...) work in the same way. I don\u0027t"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_248abf1a","line":153,"range":{"start_line":153,"start_character":0,"end_line":153,"end_character":40},"in_reply_to":"9f6a8fd7_695e5a77","updated":"2018-05-02 12:55:29.000000000","message":"Yes","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":285,"context_line":"**after** the SBI has been successfully updated in the update_*_postcommit()"},{"line_number":286,"context_line":"method. That way, if an update fails to be applied to the controller, the"},{"line_number":287,"context_line":"inconsistencies can be detected by a JOIN between the new table and the"},{"line_number":288,"context_line":"``standardattributes`` table where the revision_number columns do not match."},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"The pseudo-code will look something like this:"},{"line_number":291,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_4456dd08","line":288,"updated":"2018-05-01 22:00:19.000000000","message":"question: There is a case where two neutron servers process two updates on a same resources (let\u0027s call revision number 5 and 6) and the first process (for revision number 5) can completes later. In this case, will the corresponding entry in the new table be set with revision number 5 (even though the interaction for revision number 6 successed)? \n\nNote that this situation can happen even if the SDN controller ensures not to process a change with a smaller revision number. There is a case where a post processing after interaction with the SDN controller can be slow.\n\nI think it is okay as this can be detected by a mechanism described above. I just try to clarify some complicated situation.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":285,"context_line":"**after** the SBI has been successfully updated in the update_*_postcommit()"},{"line_number":286,"context_line":"method. That way, if an update fails to be applied to the controller, the"},{"line_number":287,"context_line":"inconsistencies can be detected by a JOIN between the new table and the"},{"line_number":288,"context_line":"``standardattributes`` table where the revision_number columns do not match."},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"The pseudo-code will look something like this:"},{"line_number":291,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_2aa28b4c","line":288,"in_reply_to":"9f6a8fd7_4456dd08","updated":"2018-05-02 09:31:45.000000000","message":"This is a good question. In OVN we rely on a special OVSDB command and also in the \"verify()\" action for the transaction to abort transactions if it has a lower revision_number compared to what is already committed in the OVSDB. Please take a look at [0] for more info.\n\nApparently ODL has something similar. But both drivers will rely on the SBI technology to prevent such cases. \n\nFor other SBIs that does not support anything like that, I believe the only solution is to have a lock based on the resource UUID (so it will be per resource instead of a global thing) that would link these two transactions (the one to update the SBI and the one updating the revision numbers).\n\nIt shouldn\u0027t be anything much complicated, is it something that needs to be in the spec for v1 you think ?\n\n[0] https://docs.openstack.org/networking-ovn/latest/contributor/design/database_consistency.html#ensure-correctness-when-updating-ovn","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":305,"context_line":"Neutron deleting a resource the ``standard_attr_id`` column in the new"},{"line_number":306,"context_line":"table will be set to *NULL*."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"If deleting a resource succeeds in Neutron but fails in the SDN controller,"},{"line_number":309,"context_line":"the inconsistency can be detected by looking at all resources that has a"},{"line_number":310,"context_line":"``standard_attr_id`` equals to NULL."},{"line_number":311,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_493a76e7","line":308,"range":{"start_line":308,"start_character":56,"end_line":308,"end_character":74},"updated":"2018-05-01 22:00:19.000000000","message":"\"the controller\" is used in some places and \"the SDN controller\" and \"SBI controller\" are used in other places. It is better to be consistent.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":305,"context_line":"Neutron deleting a resource the ``standard_attr_id`` column in the new"},{"line_number":306,"context_line":"table will be set to *NULL*."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"If deleting a resource succeeds in Neutron but fails in the SDN controller,"},{"line_number":309,"context_line":"the inconsistency can be detected by looking at all resources that has a"},{"line_number":310,"context_line":"``standard_attr_id`` equals to NULL."},{"line_number":311,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ea08132e","line":308,"range":{"start_line":308,"start_character":56,"end_line":308,"end_character":74},"in_reply_to":"9f6a8fd7_493a76e7","updated":"2018-05-02 09:31:45.000000000","message":"Good point. We already have way too many acronyms in networking (-:","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":305,"context_line":"Neutron deleting a resource the ``standard_attr_id`` column in the new"},{"line_number":306,"context_line":"table will be set to *NULL*."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"If deleting a resource succeeds in Neutron but fails in the SDN controller,"},{"line_number":309,"context_line":"the inconsistency can be detected by looking at all resources that has a"},{"line_number":310,"context_line":"``standard_attr_id`` equals to NULL."},{"line_number":311,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_c78f452c","line":308,"range":{"start_line":308,"start_character":56,"end_line":308,"end_character":74},"in_reply_to":"9f6a8fd7_ea08132e","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":323,"context_line":"by random backend failures."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Prerequisites"},{"line_number":327,"context_line":"`````````````"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"These changes have the following prerequisites to be take into consideration"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_842dd547","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":13},"updated":"2018-05-01 22:00:19.000000000","message":"As I commented at L.350, #1 and #2 described in this section are not necessarily requirements. They seems things which improves implementations more efficient. I agree that #3 is a requirement to address out-of-sync situation.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":323,"context_line":"by random backend failures."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Prerequisites"},{"line_number":327,"context_line":"`````````````"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"These changes have the following prerequisites to be take into consideration"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_4f283185","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":13},"updated":"2018-05-02 07:28:57.000000000","message":"IMHO, this whole section is overly complex and lacks clarity... \n\nI see no reason to specify a specific way to implement this in the SBI. This sounds like it may have come from OVN (external_ids is an OVSDB construct), but that is not a reason to put it here. Might I suggest that this whole section be re-written as a set of requirement of the SBI. As requirements go, they should be specific and describe functionality. For e.g., a list of short \"must\" statements like \"if the SBI receives an update with a rev# lower than its current rev# it must fail the update\" or something like that. Even the mention of storing the rev# is unnecessary, IMHO. That is an implementation detail, what is important is clear requirements from the SBI.\n\nI think this is very important because this is basically your contract with the SBI so it really needs to be well defined.\n\nIf you really want to have the implementation example in the doc, maybe have it in a separate section or something with notes on how it fulfills the requirements.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"75f1ec63486d34200d0021eb19b5bd1c92d0adc1","unresolved":false,"context_lines":[{"line_number":323,"context_line":"by random backend failures."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Prerequisites"},{"line_number":327,"context_line":"`````````````"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"These changes have the following prerequisites to be take into consideration"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_f56474e7","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":13},"in_reply_to":"9f6a8fd7_4f283185","updated":"2018-05-02 09:31:45.000000000","message":"++ John.\n\nAlso, see the comments at L288. I believe that this could be achieve generically by using a per-resource lock for SBIs that does not offer any mechanism to prevent such races.\n\nI just don\u0027t know if that is something we want to have for the v1 of the spec. \n\nThat said, I think your comment is spot on about laying down the expected requirements for the SBI to be compatible with this proposed solution.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":323,"context_line":"by random backend failures."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Prerequisites"},{"line_number":327,"context_line":"`````````````"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"These changes have the following prerequisites to be take into consideration"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_5a0228b6","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":13},"in_reply_to":"9f6a8fd7_f56474e7","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":334,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"To be able to compare the version of the resource in Neutron against"},{"line_number":337,"context_line":"the version in the ODL driver there is a need to know which version"},{"line_number":338,"context_line":"the SBI controller is present at."},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"In order to achieve this, each SBI that adopts this solution"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_a4bed9d1","line":337,"range":{"start_line":337,"start_character":19,"end_line":337,"end_character":23},"updated":"2018-05-01 22:00:19.000000000","message":"SBI?","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":334,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"To be able to compare the version of the resource in Neutron against"},{"line_number":337,"context_line":"the version in the ODL driver there is a need to know which version"},{"line_number":338,"context_line":"the SBI controller is present at."},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"In order to achieve this, each SBI that adopts this solution"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_4792554d","line":337,"range":{"start_line":337,"start_character":19,"end_line":337,"end_character":23},"in_reply_to":"9f6a8fd7_a4bed9d1","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":347,"context_line":"the ``external_ids`` column of that resource. That will allow the"},{"line_number":348,"context_line":"SBI to look at both databases and detect whether the version in the"},{"line_number":349,"context_line":"SBI controller is up-to-date with Neutron or not."},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"#2 - Ensure correctness when updating the SDN controller"},{"line_number":353,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_64f521ed","line":350,"updated":"2018-05-01 22:00:19.000000000","message":"Is this really a prerequisite of this solution?\n\nThe new table is used to track which revision number of a resource exists on the SDN controller, and we can know which resource is out-of-sync by comparing the revision number in the standardattributes table and the new table.\n\nThus I wonder why it is a requirement to have external_ids column in the SDN controller side.\n\n(I am not against to have external_ids columns in the SDN controller side as it allows implementations to check the state of sync more precisely.)","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":347,"context_line":"the ``external_ids`` column of that resource. That will allow the"},{"line_number":348,"context_line":"SBI to look at both databases and detect whether the version in the"},{"line_number":349,"context_line":"SBI controller is up-to-date with Neutron or not."},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"#2 - Ensure correctness when updating the SDN controller"},{"line_number":353,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_07bbfd71","line":350,"in_reply_to":"9f6a8fd7_64f521ed","updated":"2018-05-02 12:55:29.000000000","message":"It is a pre-requisite as it must except or safely ignore accordingly. The new table acts more like a cache.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"Neutron worker 2 (NW-2): Updates a port with address B (revision_number: 3)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"TXN 1: NW-2 transaction is committed first and the SBI resource now has RN 3"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"TXN 2: NW-1 transaction detects the change in the ``external_ids`` column and"},{"line_number":387,"context_line":"is restarted."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_6411a104","line":384,"range":{"start_line":384,"start_character":0,"end_line":384,"end_character":3},"updated":"2018-05-01 22:00:19.000000000","message":"Does TXN mean \"transaction\" on the SBI? (Just confirmation as this is the first appearance in this document)","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"Neutron worker 2 (NW-2): Updates a port with address B (revision_number: 3)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"TXN 1: NW-2 transaction is committed first and the SBI resource now has RN 3"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"TXN 2: NW-1 transaction detects the change in the ``external_ids`` column and"},{"line_number":387,"context_line":"is restarted."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_da2158a1","line":384,"range":{"start_line":384,"start_character":0,"end_line":384,"end_character":3},"in_reply_to":"9f6a8fd7_6411a104","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7ff8d0486efcc7805217ff55c019514385f27a1","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":""},{"line_number":435,"context_line":"Utility functions"},{"line_number":436,"context_line":"`````````````````"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"get_inconsistent_resources"},{"line_number":439,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_04e6a517","line":436,"updated":"2018-05-01 22:00:19.000000000","message":"Could you move \"Utility functions\" and \"#3 - Detect and fix out-of-sync resources\" above into a single section? These two sections discuss how to resolve out-of-sync situation and utility functions for it.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":""},{"line_number":435,"context_line":"Utility functions"},{"line_number":436,"context_line":"`````````````````"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"get_inconsistent_resources"},{"line_number":439,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ba36e4e6","line":436,"in_reply_to":"9f6a8fd7_04e6a517","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":483,"context_line":"Some things to keep in mind about this approach:"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"* The code can get quite complex as this approach is not only about"},{"line_number":486,"context_line":"  applying the changes to the SDN backend asynchronously. The dependencies"},{"line_number":487,"context_line":"  between each resource as well as their operations also needs to be"},{"line_number":488,"context_line":"  computed. For example, before attempting to create a router port the"},{"line_number":489,"context_line":"  router that this port belongs to needs to be created. Or, before"},{"line_number":490,"context_line":"  attempting to delete a network all the dependent resources on it"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_44bed865","line":487,"range":{"start_line":486,"start_character":58,"end_line":487,"end_character":10},"updated":"2018-05-02 07:28:57.000000000","message":"I think you need to explain why this is no longer required with the new approach.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":483,"context_line":"Some things to keep in mind about this approach:"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"* The code can get quite complex as this approach is not only about"},{"line_number":486,"context_line":"  applying the changes to the SDN backend asynchronously. The dependencies"},{"line_number":487,"context_line":"  between each resource as well as their operations also needs to be"},{"line_number":488,"context_line":"  computed. For example, before attempting to create a router port the"},{"line_number":489,"context_line":"  router that this port belongs to needs to be created. Or, before"},{"line_number":490,"context_line":"  attempting to delete a network all the dependent resources on it"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_5a6d4896","line":487,"range":{"start_line":486,"start_character":58,"end_line":487,"end_character":10},"in_reply_to":"9f6a8fd7_44bed865","updated":"2018-05-02 12:55:29.000000000","message":"Actually that\u0027s a pre-requisite for the SBI and as far n-odl\u0027s concern, I understand it will be implemented in ODL ( https://jira.opendaylight.org/browse/NEUTRON-158 ).\n\nI added a clarification to this point.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8cc920dc1e3182dc73e248d144ddba018eb2ff7b","unresolved":false,"context_lines":[{"line_number":494,"context_line":"* The number of journal threads running can cause problems. In my tests"},{"line_number":495,"context_line":"  I had three controllers, each one with 24 CPU cores (Intel Xeon E5-2620"},{"line_number":496,"context_line":"  with hyperthreading enabled) and 64GB RAM. Running 1 journal thread"},{"line_number":497,"context_line":"  per Neutron API worker has caused ``ovsdb-server`` to misbehave"},{"line_number":498,"context_line":"  when under heavy pressure [1]_. Running multiple journal threads"},{"line_number":499,"context_line":"  seem to be causing other types of problems `in other drivers as well"},{"line_number":500,"context_line":"  \u003chttps://bugs.launchpad.net/networking-odl/+bug/1683797\u003e`_."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_8480708d","line":497,"range":{"start_line":497,"start_character":38,"end_line":497,"end_character":43},"updated":"2018-05-02 07:28:57.000000000","message":"ovsdb-server??? I checked the bug and it seems to just be the db, not the ovsdb. I don\u0027t understand how the journal could possibly hinder ovsdb-server performance.\n\nAlso, I think it would be better if you specify why the new approach will not have this issue. Same for the rest of the issues you raise with journaling.","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"eef58955b74b19032ee1c0fd7f5f48f0722f58ef","unresolved":false,"context_lines":[{"line_number":494,"context_line":"* The number of journal threads running can cause problems. In my tests"},{"line_number":495,"context_line":"  I had three controllers, each one with 24 CPU cores (Intel Xeon E5-2620"},{"line_number":496,"context_line":"  with hyperthreading enabled) and 64GB RAM. Running 1 journal thread"},{"line_number":497,"context_line":"  per Neutron API worker has caused ``ovsdb-server`` to misbehave"},{"line_number":498,"context_line":"  when under heavy pressure [1]_. Running multiple journal threads"},{"line_number":499,"context_line":"  seem to be causing other types of problems `in other drivers as well"},{"line_number":500,"context_line":"  \u003chttps://bugs.launchpad.net/networking-odl/+bug/1683797\u003e`_."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_da0e38e4","line":497,"range":{"start_line":497,"start_character":38,"end_line":497,"end_character":43},"in_reply_to":"9f6a8fd7_8480708d","updated":"2018-05-02 12:55:29.000000000","message":"Done","commit_id":"e8820c7e49a5d3c2104ad98bb5287ed0998b8902"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"1a88b939516c5d9df27060b53f86f18134fc7d04","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"#. The SBI must keep track of the current revision number that was"},{"line_number":381,"context_line":"   successfully applied."},{"line_number":382,"context_line":"#. The SBI must report when the CRUD operation requested fails. The failure"},{"line_number":383,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":384,"context_line":"   can react accordingly."},{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_1a63501c","line":384,"range":{"start_line":382,"start_character":64,"end_line":384,"end_character":25},"updated":"2018-05-02 13:21:20.000000000","message":"The SBI can\u0027t raise an exception in the driver, no? Am I missing something?","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1ffe2c4856f720e6daf83c3d909cb8e099e5e7ff","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"#. The SBI must keep track of the current revision number that was"},{"line_number":381,"context_line":"   successfully applied."},{"line_number":382,"context_line":"#. The SBI must report when the CRUD operation requested fails. The failure"},{"line_number":383,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":384,"context_line":"   can react accordingly."},{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_a8c03652","line":384,"range":{"start_line":382,"start_character":64,"end_line":384,"end_character":25},"in_reply_to":"9f6a8fd7_1a63501c","updated":"2018-05-03 15:45:38.000000000","message":"I guess the SBI will have some indication if a request to it has failed or not.\n\nIn OVN an error is thrown in case a transaction changing something in the to the OVSDB fails (OVN uses a OVSDB, called OVN Nourthbound database, as it\u0027s \"API\").\n\nOther SBIs might have to handle it differently. Example, for a REsT API the Neutron driver code might need to parse the response code from the SBI API and look if it\u0027s a 4XXX or 5XXX and raise an exception which can be handled by the sync_resource ctx manager.","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"#. The SBI must keep track of the current revision number that was"},{"line_number":381,"context_line":"   successfully applied."},{"line_number":382,"context_line":"#. The SBI must report when the CRUD operation requested fails. The failure"},{"line_number":383,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":384,"context_line":"   can react accordingly."},{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_7d5e0613","line":384,"range":{"start_line":382,"start_character":64,"end_line":384,"end_character":25},"in_reply_to":"9f6a8fd7_1a63501c","updated":"2018-05-07 08:43:54.000000000","message":"Right, in odl for example the SBI would return a 404 and then that should be converted into an exception. In other cases they might have a direct interface through Python, in which case it could raise an exception. To generalize I wrote \"the failure should raise an exception.\" \n\nAny recommendations on how to rephrase it better?","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"1a88b939516c5d9df27060b53f86f18134fc7d04","unresolved":false,"context_lines":[{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"},{"line_number":388,"context_line":"   (e.g. when an ``update`` is requested and the ``revision number`` stored"},{"line_number":389,"context_line":"   is lower than the current applied one.)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_fa48dc87","line":388,"range":{"start_line":388,"start_character":4,"end_line":388,"end_character":7},"updated":"2018-05-02 13:21:20.000000000","message":"I think all these cases should be explicitly enumerated, not e.g.\u0027ed. This is your contract.","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1ffe2c4856f720e6daf83c3d909cb8e099e5e7ff","unresolved":false,"context_lines":[{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"},{"line_number":388,"context_line":"   (e.g. when an ``update`` is requested and the ``revision number`` stored"},{"line_number":389,"context_line":"   is lower than the current applied one.)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_6860de33","line":388,"range":{"start_line":388,"start_character":4,"end_line":388,"end_character":7},"in_reply_to":"9f6a8fd7_fa48dc87","updated":"2018-05-03 15:45:38.000000000","message":"++","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"},{"line_number":388,"context_line":"   (e.g. when an ``update`` is requested and the ``revision number`` stored"},{"line_number":389,"context_line":"   is lower than the current applied one.)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_1b407156","line":388,"range":{"start_line":388,"start_character":4,"end_line":388,"end_character":7},"in_reply_to":"9f6a8fd7_fa48dc87","updated":"2018-05-07 08:43:54.000000000","message":"Done","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"1a88b939516c5d9df27060b53f86f18134fc7d04","unresolved":false,"context_lines":[{"line_number":427,"context_line":"  related to the journaling solution per se, but it was an issue with the SBI"},{"line_number":428,"context_line":"  in OpenDaylight the moment the journaling solution was implemented."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"* The number of journal threads running can cause problems. In tests"},{"line_number":431,"context_line":"  three controllers were used, each one with 24 CPU cores (Intel Xeon E5-2620"},{"line_number":432,"context_line":"  with hyperthreading enabled) and 64GB RAM. Running 1 journal thread"},{"line_number":433,"context_line":"  per Neutron API worker caused the DB to misbehave"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_1d282a84","line":430,"updated":"2018-05-02 13:21:20.000000000","message":"I still don\u0027t understand why we expect this solution to do better. Would there be fewer threads? In general I think for each of these items you need to specify (a) whether or not the issue is inherent to the journal solution or if it is just an implementation problem and (b) how and why this solution might be better.","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":427,"context_line":"  related to the journaling solution per se, but it was an issue with the SBI"},{"line_number":428,"context_line":"  in OpenDaylight the moment the journaling solution was implemented."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"* The number of journal threads running can cause problems. In tests"},{"line_number":431,"context_line":"  three controllers were used, each one with 24 CPU cores (Intel Xeon E5-2620"},{"line_number":432,"context_line":"  with hyperthreading enabled) and 64GB RAM. Running 1 journal thread"},{"line_number":433,"context_line":"  per Neutron API worker caused the DB to misbehave"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_d6917054","line":430,"in_reply_to":"5f7c97a3_433864d2","updated":"2018-05-07 08:43:54.000000000","message":"Added this as part of the arguments.","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1ffe2c4856f720e6daf83c3d909cb8e099e5e7ff","unresolved":false,"context_lines":[{"line_number":427,"context_line":"  related to the journaling solution per se, but it was an issue with the SBI"},{"line_number":428,"context_line":"  in OpenDaylight the moment the journaling solution was implemented."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"* The number of journal threads running can cause problems. In tests"},{"line_number":431,"context_line":"  three controllers were used, each one with 24 CPU cores (Intel Xeon E5-2620"},{"line_number":432,"context_line":"  with hyperthreading enabled) and 64GB RAM. Running 1 journal thread"},{"line_number":433,"context_line":"  per Neutron API worker caused the DB to misbehave"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_433864d2","line":430,"in_reply_to":"9f6a8fd7_1d282a84","updated":"2018-05-03 15:45:38.000000000","message":"Good point, my take on this is:\n\nNeutron already has a concurrent design, multiple neutron-servers are already being spawned to handle things in parallel. The approach proposed in this spec make use of that design where in the journaling the neutron-serves are only used to queue up changes to be later processed by the journal threads.\n\nThat makes things a bit more complicated, for example, how many journal threads would be necessary to process the output of all the API workers in a reasonable time ?\n\nIf the answer is \u003e 1 worker, then we need to introduce some sort of serialization/dependency check for that queue of changes to make sure that things like a port that belongs to certain network is only created after that network has already been created.\n\nThe approach proposed in this spec this is not a problem because by the time the API request to create the network returns, the SBI already will have that network created in it (or the driver will have the confirmation that the request to create that network in the SBI succeeded and is being processed), things happens more synchronously.\n\nAlso in the journaling, the number of journal threads should also be relative to the size of the deployment. Maybe 1 journal thread is enough if you have 10 Neutron API workers, but what if you have 100 Neutron API workers ?\n\nFrom the Neutron driver perspective I don\u0027t think that it can calculate that since it won\u0027t have a enough view of the deployment and its size. This logic would need to be placed on a layer above, such as the deployment tool (e.g TripleO) and we would need to come up with a methodology to determine this journal thread/API worker(s) ratio number.\n\nTesting the API response time also can be misleading with the journaling approach since the neutron-servers are just queuing things up and and returning. The API response time will look faster but we will need custom tools to be able to validate the real performance of the journal [0] (from the moment that the API accepts the request until the change is pick by a journal thread and sent to the SBI). Tools like Rally or Browbeat might have a problem validating the real performance of the requests as-is.\n\nThese are some of the problems I see with the journaling and its journal threads which does not affected the proposed approach.\n\n[0] https://review.openstack.org/#/c/508826/\n\nDoes it make sense ?","commit_id":"0d8256d41cfdb003764ca037345160c77303803c"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"1efe2565b75b615f3109aa32c8659cdd87fa7fc4","unresolved":false,"context_lines":[{"line_number":251,"context_line":"Expected result:"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"- On Success: it deletes the corresponding entry for the resource."},{"line_number":254,"context_line":"- On Exception: The entry for the resource remains, but since the"},{"line_number":255,"context_line":"  table is defined with a ``ONDELETE\u003dSET NULL``, the entry will have its"},{"line_number":256,"context_line":"  ``standard_attr_id`` on ``NULL``."},{"line_number":257,"context_line":""},{"line_number":258,"context_line":".. note::"},{"line_number":259,"context_line":"   There\u0027s no lock linking both database updates in the ``postcommit()``"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_e6abbe72","line":256,"range":{"start_line":254,"start_character":2,"end_line":256,"end_character":35},"updated":"2018-05-03 17:10:47.000000000","message":"this exception can happen anywhere or just in driver ?","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":251,"context_line":"Expected result:"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"- On Success: it deletes the corresponding entry for the resource."},{"line_number":254,"context_line":"- On Exception: The entry for the resource remains, but since the"},{"line_number":255,"context_line":"  table is defined with a ``ONDELETE\u003dSET NULL``, the entry will have its"},{"line_number":256,"context_line":"  ``standard_attr_id`` on ``NULL``."},{"line_number":257,"context_line":""},{"line_number":258,"context_line":".. note::"},{"line_number":259,"context_line":"   There\u0027s no lock linking both database updates in the ``postcommit()``"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_9b732116","line":256,"range":{"start_line":254,"start_character":2,"end_line":256,"end_character":35},"in_reply_to":"5f7c97a3_e6abbe72","updated":"2018-05-07 08:43:54.000000000","message":"Look at L366 to see how the usage is expected to be.","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"1efe2565b75b615f3109aa32c8659cdd87fa7fc4","unresolved":false,"context_lines":[{"line_number":273,"context_line":"\"maintain\" the system healthy. To this regard, this document proposes to also"},{"line_number":274,"context_line":"include utility functions that can be used by such maintenance periodic task."},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"get_inconsistent_resources"},{"line_number":277,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"Get a list of inconsistent resources which the revision number from the table"},{"line_number":280,"context_line":"aformentioned differs from the standardattributes table."},{"line_number":281,"context_line":""},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"get_deleted_resources"},{"line_number":284,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"Get a list of resources that have been deleted from neutron but not in the SBI"},{"line_number":287,"context_line":"controller. Once a resource is deleted in Neutron the ``standard_attr_id``"},{"line_number":288,"context_line":"foreign key in the revision_numbers table will be set to NULL. Upon"},{"line_number":289,"context_line":"successfully deleting the resource throughh the SBI the entry in the"},{"line_number":290,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":291,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":292,"context_line":"thread can later fix it."},{"line_number":293,"context_line":""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"Implementation examples"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_8639aa42","line":292,"range":{"start_line":276,"start_character":1,"end_line":292,"end_character":24},"updated":"2018-05-03 17:10:47.000000000","message":"would it make sense to have utility for verifying the revision no of resource ? what it gets from neutron worker and where the revision number is for sbi. sync_resource can consume it ?\n\nNote: this is just a suggestion, comment won\u0027t affect voting on PS","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":273,"context_line":"\"maintain\" the system healthy. To this regard, this document proposes to also"},{"line_number":274,"context_line":"include utility functions that can be used by such maintenance periodic task."},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"get_inconsistent_resources"},{"line_number":277,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"Get a list of inconsistent resources which the revision number from the table"},{"line_number":280,"context_line":"aformentioned differs from the standardattributes table."},{"line_number":281,"context_line":""},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"get_deleted_resources"},{"line_number":284,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"Get a list of resources that have been deleted from neutron but not in the SBI"},{"line_number":287,"context_line":"controller. Once a resource is deleted in Neutron the ``standard_attr_id``"},{"line_number":288,"context_line":"foreign key in the revision_numbers table will be set to NULL. Upon"},{"line_number":289,"context_line":"successfully deleting the resource throughh the SBI the entry in the"},{"line_number":290,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":291,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":292,"context_line":"thread can later fix it."},{"line_number":293,"context_line":""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"Implementation examples"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_9b4c81c8","line":292,"range":{"start_line":276,"start_character":1,"end_line":292,"end_character":24},"in_reply_to":"5f7c97a3_8639aa42","updated":"2018-05-07 08:43:54.000000000","message":"Not sure I understand what you are saying. You are proposing something that allows us to check against the SBI revision number? \n\nIf yes, each SBI has a different interface, thus this is more something for the SBI driver to do and not in a generic solution.","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"1efe2565b75b615f3109aa32c8659cdd87fa7fc4","unresolved":false,"context_lines":[{"line_number":328,"context_line":"2. Update:"},{"line_number":329,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"For update, it is simpler, the revision number for that resource is updated"},{"line_number":332,"context_line":"**after** the SBI has been successfully updated in the"},{"line_number":333,"context_line":"``update_*_postcommit()`` method. That way, if an update fails to be applied"},{"line_number":334,"context_line":"to the SBI, the inconsistencies can be detected by a JOIN between the"},{"line_number":335,"context_line":"new table and the ``standardattributes`` table where the ``revision_number``"},{"line_number":336,"context_line":"columns do not match."},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"The pseudo-code will look something like this:"},{"line_number":339,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_c666c252","line":336,"range":{"start_line":331,"start_character":0,"end_line":336,"end_character":21},"updated":"2018-05-03 17:10:47.000000000","message":"so it won\u0027t rollback neutron db in case its a failure at sbi end ?","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":328,"context_line":"2. Update:"},{"line_number":329,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"For update, it is simpler, the revision number for that resource is updated"},{"line_number":332,"context_line":"**after** the SBI has been successfully updated in the"},{"line_number":333,"context_line":"``update_*_postcommit()`` method. That way, if an update fails to be applied"},{"line_number":334,"context_line":"to the SBI, the inconsistencies can be detected by a JOIN between the"},{"line_number":335,"context_line":"new table and the ``standardattributes`` table where the ``revision_number``"},{"line_number":336,"context_line":"columns do not match."},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"The pseudo-code will look something like this:"},{"line_number":339,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_1bef1185","line":336,"range":{"start_line":331,"start_character":0,"end_line":336,"end_character":21},"in_reply_to":"5f7c97a3_c666c252","updated":"2018-05-07 08:43:54.000000000","message":"in postcommit there is no active transaction to roll back, so I\u0027m not sure what you mean. \n\nWhat this is saying that in case there is an exception on the SBI then sync_resource would not increase the revision number","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"1efe2565b75b615f3109aa32c8659cdd87fa7fc4","unresolved":false,"context_lines":[{"line_number":383,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":384,"context_line":"   can react accordingly."},{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"},{"line_number":388,"context_line":"   (e.g. when an ``update`` is requested and the ``revision number`` stored"},{"line_number":389,"context_line":"   is lower than the current applied one.)"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_06e11a9b","line":386,"range":{"start_line":386,"start_character":13,"end_line":386,"end_character":21},"updated":"2018-05-03 17:10:47.000000000","message":"failure","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":383,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":384,"context_line":"   can react accordingly."},{"line_number":385,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":386,"context_line":"   issuing a failuire)."},{"line_number":387,"context_line":"#. The SBI must ignore cases where the CRUD operation can be safely ignored"},{"line_number":388,"context_line":"   (e.g. when an ``update`` is requested and the ``revision number`` stored"},{"line_number":389,"context_line":"   is lower than the current applied one.)"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_bb885dc6","line":386,"range":{"start_line":386,"start_character":13,"end_line":386,"end_character":21},"in_reply_to":"5f7c97a3_06e11a9b","updated":"2018-05-07 08:43:54.000000000","message":"Done","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"1efe2565b75b615f3109aa32c8659cdd87fa7fc4","unresolved":false,"context_lines":[{"line_number":389,"context_line":"   is lower than the current applied one.)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"References"},{"line_number":393,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"* OVN has an implementation of this proposal at:"},{"line_number":396,"context_line":"  https://github.com/openstack/networking-ovn/blob/master/networking_ovn/db/revision.py and"},{"line_number":397,"context_line":"  https://github.com/openstack/networking-ovn/blob/master/networking_ovn/db/maintenance.py"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_6908df27","line":397,"range":{"start_line":392,"start_character":0,"end_line":397,"end_character":90},"updated":"2018-05-03 17:10:47.000000000","message":"i\u0027d recommend having references section at the end. and also tagging links\n\nfor example\nReferences\n----------\n\n[1]. ref1\n[2]. ref2.\n\nand then [1] and [2] etc tags can be used in other parts of spec ?","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"c937897d6f4513be53e521d1d0209013f2102792","unresolved":false,"context_lines":[{"line_number":389,"context_line":"   is lower than the current applied one.)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"References"},{"line_number":393,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"* OVN has an implementation of this proposal at:"},{"line_number":396,"context_line":"  https://github.com/openstack/networking-ovn/blob/master/networking_ovn/db/revision.py and"},{"line_number":397,"context_line":"  https://github.com/openstack/networking-ovn/blob/master/networking_ovn/db/maintenance.py"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_db73d9e6","line":397,"range":{"start_line":392,"start_character":0,"end_line":397,"end_character":90},"in_reply_to":"5f7c97a3_6908df27","updated":"2018-05-07 08:43:54.000000000","message":"Tagging links is already happening with RST markup, no need to have plain text kind of tagging like in a commit message.\n\nSee how it turns out: http://logs.openstack.org/63/565463/3/check/build-openstack-sphinx-docs/4fecc62/html/specs/rocky/sbi-database-consistency.html","commit_id":"20f78d9a2f3f059d08cbff7012338dd887a1f9bf"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"5f7c97a3_898e7276","updated":"2018-05-08 14:30:55.000000000","message":"Generally is it possible to add an empty line before the section headers?\n\nOtherwise the rendering makes it harder to understand it\u0027s a new section..","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"5f7c97a3_ef7a06b8","in_reply_to":"5f7c97a3_898e7276","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":".. code-block:: python"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"  In Neutron:"},{"line_number":41,"context_line":"    with neutron_db_transaction:"},{"line_number":42,"context_line":"         update_neutron_db()"},{"line_number":43,"context_line":"         driver.update_port_precommit()"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_a60d9d3f","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":13},"updated":"2018-05-08 14:30:55.000000000","message":"nit: this looks awkward in the code block, it whould be either outside or perhaps a comment?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":".. code-block:: python"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"  In Neutron:"},{"line_number":41,"context_line":"    with neutron_db_transaction:"},{"line_number":42,"context_line":"         update_neutron_db()"},{"line_number":43,"context_line":"         driver.update_port_precommit()"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_8f4d929b","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":13},"in_reply_to":"5f7c97a3_a60d9d3f","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":43,"context_line":"         driver.update_port_precommit()"},{"line_number":44,"context_line":"    driver.update_port_postcommit()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"  In the driver:"},{"line_number":47,"context_line":"    def update_port_postcommit:"},{"line_number":48,"context_line":"        port \u003d neutron_db.get_port()"},{"line_number":49,"context_line":"        update_port_in_southbound_controller(port)"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_c60a1925","line":46,"range":{"start_line":46,"start_character":0,"end_line":46,"end_character":16},"updated":"2018-05-08 14:30:55.000000000","message":"ditto","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":43,"context_line":"         driver.update_port_precommit()"},{"line_number":44,"context_line":"    driver.update_port_postcommit()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"  In the driver:"},{"line_number":47,"context_line":"    def update_port_postcommit:"},{"line_number":48,"context_line":"        port \u003d neutron_db.get_port()"},{"line_number":49,"context_line":"        update_port_in_southbound_controller(port)"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_0f618205","line":46,"range":{"start_line":46,"start_character":0,"end_line":46,"end_character":16},"in_reply_to":"5f7c97a3_c60a1925","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":56,"context_line":"database are different than the order that they are committed to the SBI,"},{"line_number":57,"context_line":"resulting in an inconsistency."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"This problem has been reported for OVN at `bug #1605089"},{"line_number":60,"context_line":"\u003chttps://bugs.launchpad.net/networking-ovn/+bug/1605089\u003e`_."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":".. _problem_2:"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_c6d779bf","line":60,"range":{"start_line":59,"start_character":0,"end_line":60,"end_character":59},"updated":"2018-05-08 14:30:55.000000000","message":"Is this interesting in this context?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":56,"context_line":"database are different than the order that they are committed to the SBI,"},{"line_number":57,"context_line":"resulting in an inconsistency."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"This problem has been reported for OVN at `bug #1605089"},{"line_number":60,"context_line":"\u003chttps://bugs.launchpad.net/networking-ovn/+bug/1605089\u003e`_."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":".. _problem_2:"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_ef53e637","line":60,"range":{"start_line":59,"start_character":0,"end_line":60,"end_character":59},"in_reply_to":"5f7c97a3_c6d779bf","updated":"2018-05-14 12:07:55.000000000","message":"I think it evidences the problem and thus make it a stronger point, we could remove it though","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":98,"context_line":"#. The SBI must report when the CRUD operation requested fails. The failure"},{"line_number":99,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":100,"context_line":"   can react accordingly."},{"line_number":101,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":102,"context_line":"   issuing a failure)."},{"line_number":103,"context_line":"#. The SBI must ignore cases, and not signal a failure, on these CRUD"},{"line_number":104,"context_line":"   operations:"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_c65c594d","line":102,"range":{"start_line":101,"start_character":65,"end_line":102,"end_character":21},"updated":"2018-05-08 14:30:55.000000000","message":"you could add \"or by handling the missing dependency internally\" since this also works for us.","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":98,"context_line":"#. The SBI must report when the CRUD operation requested fails. The failure"},{"line_number":99,"context_line":"   should raise an exception so the context manager (e.g. ``sync_resource``)"},{"line_number":100,"context_line":"   can react accordingly."},{"line_number":101,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":102,"context_line":"   issuing a failure)."},{"line_number":103,"context_line":"#. The SBI must ignore cases, and not signal a failure, on these CRUD"},{"line_number":104,"context_line":"   operations:"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_4f38daec","line":102,"range":{"start_line":101,"start_character":65,"end_line":102,"end_character":21},"in_reply_to":"5f7c97a3_c65c594d","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":100,"context_line":"   can react accordingly."},{"line_number":101,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":102,"context_line":"   issuing a failure)."},{"line_number":103,"context_line":"#. The SBI must ignore cases, and not signal a failure, on these CRUD"},{"line_number":104,"context_line":"   operations:"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"   - A ``create`` is requested and the resource already exists."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_ffca216c","line":103,"range":{"start_line":103,"start_character":16,"end_line":103,"end_character":28},"updated":"2018-05-08 14:30:55.000000000","message":"ignore, or cope appropriately, these cases (since it can potentially do something smarter, but we don\u0027t expect some weird behavior)","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":100,"context_line":"   can react accordingly."},{"line_number":101,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":102,"context_line":"   issuing a failure)."},{"line_number":103,"context_line":"#. The SBI must ignore cases, and not signal a failure, on these CRUD"},{"line_number":104,"context_line":"   operations:"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"   - A ``create`` is requested and the resource already exists."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_4a1f685a","line":103,"range":{"start_line":103,"start_character":16,"end_line":103,"end_character":28},"in_reply_to":"5f7c97a3_ffca216c","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":106,"context_line":"   - A ``create`` is requested and the resource already exists."},{"line_number":107,"context_line":"   - An ``update`` is requested and the ``revision number`` sent inside the"},{"line_number":108,"context_line":"     resource is lower or equal than the one stored in the SBI."},{"line_number":109,"context_line":"   - A ``delete`` is requested and the resource was already deleted or does"},{"line_number":110,"context_line":"     not exist."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"Introduction"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_3fb979e8","line":110,"range":{"start_line":109,"start_character":5,"end_line":110,"end_character":15},"updated":"2018-05-08 14:30:55.000000000","message":"After some thought I\u0027m not sure this is smart.\nIf you try delete something and it isn\u0027t there you can ignore this on the client side, but the SBI shouldn\u0027t probably ignore this..","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":106,"context_line":"   - A ``create`` is requested and the resource already exists."},{"line_number":107,"context_line":"   - An ``update`` is requested and the ``revision number`` sent inside the"},{"line_number":108,"context_line":"     resource is lower or equal than the one stored in the SBI."},{"line_number":109,"context_line":"   - A ``delete`` is requested and the resource was already deleted or does"},{"line_number":110,"context_line":"     not exist."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"Introduction"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_aa8abc66","line":110,"range":{"start_line":109,"start_character":5,"end_line":110,"end_character":15},"in_reply_to":"5f7c97a3_3fb979e8","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":145,"context_line":"attribute for three things:"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"#. Perform a compare-and-swap operation based on the resource version"},{"line_number":148,"context_line":"#. Guarantee the order of the updates (`Problem 1 \u003cproblem_1_\u003e`_)"},{"line_number":149,"context_line":"#. Detect when resources in Neutron and the SBI are out-of-sync"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_a93b2ecf","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":65},"updated":"2018-05-08 14:30:55.000000000","message":"Isn\u0027t this offloaded to the SBI though?\n\ni.e. the point: \n#. The SBI must ignore cases, and not signal a failure, on these CRUD\n   operations:\n\nWhat you do solve is that you won\u0027t send an update for a resource that isn\u0027t known to exist yet, but for update vs update ordering we expect the SBI to take care of business, which is of course achieved by using the revision number (but is not in the scope of the spec, just is tangent to it).","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"7ece3a728847f50b11350bce74756a547d57abda","unresolved":false,"context_lines":[{"line_number":145,"context_line":"attribute for three things:"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"#. Perform a compare-and-swap operation based on the resource version"},{"line_number":148,"context_line":"#. Guarantee the order of the updates (`Problem 1 \u003cproblem_1_\u003e`_)"},{"line_number":149,"context_line":"#. Detect when resources in Neutron and the SBI are out-of-sync"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_b4cef558","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":65},"in_reply_to":"5f7c97a3_2d82aaa6","updated":"2018-06-20 07:59:56.000000000","message":"I suggest you fix the wording here to make the intent clearer","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"5bc180a177b45c47c61196a36160a37abeb773db","unresolved":false,"context_lines":[{"line_number":145,"context_line":"attribute for three things:"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"#. Perform a compare-and-swap operation based on the resource version"},{"line_number":148,"context_line":"#. Guarantee the order of the updates (`Problem 1 \u003cproblem_1_\u003e`_)"},{"line_number":149,"context_line":"#. Detect when resources in Neutron and the SBI are out-of-sync"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_2d82aaa6","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":65},"in_reply_to":"5f7c97a3_6acee4b4","updated":"2018-06-07 08:32:06.000000000","message":"Just a bit confusing there, you\u0027re not exactly guaranteeing order then you\u0027re just guaranteeing that older information won\u0027t be attempted to be synced on purpose (except maybe for a race condition, in which case the SBI check should cover it).","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":145,"context_line":"attribute for three things:"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"#. Perform a compare-and-swap operation based on the resource version"},{"line_number":148,"context_line":"#. Guarantee the order of the updates (`Problem 1 \u003cproblem_1_\u003e`_)"},{"line_number":149,"context_line":"#. Detect when resources in Neutron and the SBI are out-of-sync"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_6acee4b4","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":65},"in_reply_to":"5f7c97a3_a93b2ecf","updated":"2018-05-14 12:07:55.000000000","message":"Yes, but we have a chache and we could avoid calling the SBI altogether.","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"a7d97a1dcf5a6101a3ea7e677c193e2331a03f03","unresolved":false,"context_lines":[{"line_number":145,"context_line":"attribute for three things:"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"#. Perform a compare-and-swap operation based on the resource version"},{"line_number":148,"context_line":"#. Guarantee the order of the updates (`Problem 1 \u003cproblem_1_\u003e`_)"},{"line_number":149,"context_line":"#. Detect when resources in Neutron and the SBI are out-of-sync"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_586b0f84","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":65},"in_reply_to":"5f7c97a3_b4cef558","updated":"2018-06-20 12:02:00.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                            table in Neutron for that resource."},{"line_number":163,"context_line":"                            ONDELETE\u003dSET NULL."},{"line_number":164,"context_line":"resource_uuid     String    The UUID of the resource."},{"line_number":165,"context_line":"resource_type     String    The type of the resource (e.g, ports, routers,"},{"line_number":166,"context_line":"                            ...)"},{"line_number":167,"context_line":"driver            String    The name of the SBI driver that manages the"},{"line_number":168,"context_line":"                            resource."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_49529a15","line":165,"range":{"start_line":165,"start_character":59,"end_line":165,"end_character":73},"updated":"2018-05-08 14:30:55.000000000","message":"Is the plural here correct or should it be singular?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                            table in Neutron for that resource."},{"line_number":163,"context_line":"                            ONDELETE\u003dSET NULL."},{"line_number":164,"context_line":"resource_uuid     String    The UUID of the resource."},{"line_number":165,"context_line":"resource_type     String    The type of the resource (e.g, ports, routers,"},{"line_number":166,"context_line":"                            ...)"},{"line_number":167,"context_line":"driver            String    The name of the SBI driver that manages the"},{"line_number":168,"context_line":"                            resource."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_2ac46c90","line":165,"range":{"start_line":165,"start_character":59,"end_line":165,"end_character":73},"in_reply_to":"5f7c97a3_49529a15","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                            troubleshooting purposes."},{"line_number":174,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"The table would have a composite ``PRIMARY KEY`` of ``resource_uuid`` and"},{"line_number":177,"context_line":"``resource_type``."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"This table will be provide the support for the interface described hereafter."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_29763ea6","line":177,"range":{"start_line":176,"start_character":21,"end_line":177,"end_character":18},"updated":"2018-05-08 14:30:55.000000000","message":"Technically speaking UUID should be enough since it\u0027s a \"Universally unique identifier\" by definition, and would be easier on the DB, but if you want to play it safe (end expect the resource_id not necessarily be a UUID) then this makes sense..","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                            troubleshooting purposes."},{"line_number":174,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"The table would have a composite ``PRIMARY KEY`` of ``resource_uuid`` and"},{"line_number":177,"context_line":"``resource_type``."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"This table will be provide the support for the interface described hereafter."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_6a434414","line":177,"range":{"start_line":176,"start_character":21,"end_line":177,"end_character":18},"in_reply_to":"5f7c97a3_29763ea6","updated":"2018-05-14 12:07:55.000000000","message":"yes, I agree that the UUID should be enough. IIRC someone proposed a composite PKEY though","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":176,"context_line":"The table would have a composite ``PRIMARY KEY`` of ``resource_uuid`` and"},{"line_number":177,"context_line":"``resource_type``."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"This table will be provide the support for the interface described hereafter."},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"Interface"},{"line_number":182,"context_line":"`````````"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_497b7a8b","line":179,"range":{"start_line":179,"start_character":16,"end_line":179,"end_character":18},"updated":"2018-05-08 14:30:55.000000000","message":"delete this word","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":176,"context_line":"The table would have a composite ``PRIMARY KEY`` of ``resource_uuid`` and"},{"line_number":177,"context_line":"``resource_type``."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"This table will be provide the support for the interface described hereafter."},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"Interface"},{"line_number":182,"context_line":"`````````"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_ca5138db","line":179,"range":{"start_line":179,"start_character":16,"end_line":179,"end_character":18},"in_reply_to":"5f7c97a3_497b7a8b","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":".. code-block:: python"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    @sync_resource"},{"line_number":196,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":197,"context_line":"        # operations to create the port"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_09aa62d3","line":195,"range":{"start_line":195,"start_character":5,"end_line":195,"end_character":9},"updated":"2018-05-08 14:30:55.000000000","message":"new?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":".. code-block:: python"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    @sync_resource"},{"line_number":196,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":197,"context_line":"        # operations to create the port"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_aa663cc0","line":195,"range":{"start_line":195,"start_character":5,"end_line":195,"end_character":9},"in_reply_to":"5f7c97a3_09aa62d3","updated":"2018-05-14 12:07:55.000000000","message":"good catch","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":204,"context_line":"        port \u003d context.current"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        with sync_resource.using(context, port):"},{"line_number":207,"context_line":"            # operations to create the port"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_a9aecee4","line":206,"range":{"start_line":206,"start_character":13,"end_line":206,"end_character":17},"updated":"2018-05-08 14:30:55.000000000","message":"new?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":204,"context_line":"        port \u003d context.current"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        with sync_resource.using(context, port):"},{"line_number":207,"context_line":"            # operations to create the port"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_4a5768cb","line":206,"range":{"start_line":206,"start_character":13,"end_line":206,"end_character":17},"in_reply_to":"5f7c97a3_a9aecee4","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":227,"context_line":"sync_resource"},{"line_number":228,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"The method provides a way to handle in which cases the SBI needs to be called"},{"line_number":231,"context_line":"and to bump the revision number once there has been success on syncing with"},{"line_number":232,"context_line":"the SBI backend. In most cases this will be called in the ``\\*_postcommit()``"},{"line_number":233,"context_line":"methods."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_49ee1a23","line":230,"range":{"start_line":230,"start_character":36,"end_line":230,"end_character":50},"updated":"2018-05-08 14:30:55.000000000","message":"cases in which?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":227,"context_line":"sync_resource"},{"line_number":228,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"The method provides a way to handle in which cases the SBI needs to be called"},{"line_number":231,"context_line":"and to bump the revision number once there has been success on syncing with"},{"line_number":232,"context_line":"the SBI backend. In most cases this will be called in the ``\\*_postcommit()``"},{"line_number":233,"context_line":"methods."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_edd20dd1","line":230,"range":{"start_line":230,"start_character":36,"end_line":230,"end_character":50},"in_reply_to":"5f7c97a3_49ee1a23","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"Cases where the SBI is not called:"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"- When the ``revision_number`` for the resource is lower than the one from"},{"line_number":238,"context_line":"  the table. In this case there is no need to call the SBI, as it has"},{"line_number":239,"context_line":"  already synced to a newer version of the resource."},{"line_number":240,"context_line":"- When the ``standard_attr_id`` is ``NULL``, in which case the resource has"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_09d10255","line":237,"range":{"start_line":237,"start_character":31,"end_line":237,"end_character":47},"updated":"2018-05-08 14:30:55.000000000","message":"Do you mean the resource you initially get from the context?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"Cases where the SBI is not called:"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"- When the ``revision_number`` for the resource is lower than the one from"},{"line_number":238,"context_line":"  the table. In this case there is no need to call the SBI, as it has"},{"line_number":239,"context_line":"  already synced to a newer version of the resource."},{"line_number":240,"context_line":"- When the ``standard_attr_id`` is ``NULL``, in which case the resource has"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_cafff8a8","line":237,"range":{"start_line":237,"start_character":31,"end_line":237,"end_character":47},"in_reply_to":"5f7c97a3_09d10255","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_1f5a7df2","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"updated":"2018-05-08 14:30:55.000000000","message":"We should probably only sync if the resource has been created (not -1 in our cache table), otherwise we will hit an error (404 if it\u0027s REST call).\nHow do you plan to tackle this?","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_caedb8f0","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"in_reply_to":"5f7c97a3_1f5a7df2","updated":"2018-05-14 12:07:55.000000000","message":"The decision to not call the SBI would then be made inside sync_resource and then the maintenance task would pick up the failed creation and create it with the newest revision number","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"7ece3a728847f50b11350bce74756a547d57abda","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_948ad961","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"in_reply_to":"5f7c97a3_683282a9","updated":"2018-06-20 07:59:56.000000000","message":"I guess that\u0027s a resonable way to achieve this.\n\nAlso it\u0027s possible to have it was an explicit check (via call to sync_resource.skip_sbi_call(context, port) or something of that nature), but I don\u0027t mind to have it this way if it makes more (or as much) sense.\n\nMind you, in this case the table should not be updated by the context manager, so be sure to take this into account.","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"a7d97a1dcf5a6101a3ea7e677c193e2331a03f03","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_18c5970a","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"in_reply_to":"5f7c97a3_948ad961","updated":"2018-06-20 12:02:00.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"5bc180a177b45c47c61196a36160a37abeb773db","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_cd577626","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"in_reply_to":"5f7c97a3_caedb8f0","updated":"2018-06-07 08:32:06.000000000","message":"I don\u0027t quite understand how this will work then, in a context manager you must yield, you can\u0027t conditionally not yield and skipt that block, hence my question still stands.","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":369,"context_line":"        port \u003d context.current"},{"line_number":370,"context_line":"        with sync_resource.using(context, port):"},{"line_number":371,"context_line":"            sbi.update_port(port)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_683282a9","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":48},"in_reply_to":"5f7c97a3_cd577626","updated":"2018-06-11 16:12:19.000000000","message":"oh, I did not understand that from the previous comment. It\u0027s actually a really good point. A way to tackle it could be to set an attribute on the contextmanager that acts as a flag as to whether we need to call the SBI, e.g.:\n\nwith sync_resource.using(context, port) as sync:\n    if sync.skip_sbi_call:\n        return\n\n    sbi.update_port(port)\n\nor something like that... \n\nIn the decorator this is not an issue, as the decorator can indeed skip it","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":388,"context_line":".. code-block:: python"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def delete_port_postcommit(self, context, port):"},{"line_number":391,"context_line":"        with delete_resource.using(context, port):"},{"line_number":392,"context_line":"            sbi.delete_port(port)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_fff301e6","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":50},"updated":"2018-05-08 14:30:55.000000000","message":"We should probably only sync if the resource has been synced and isn\u0027t -1, otherwise we might try delete it though it wasn\u0027t created yet, assume success (since SBI didn\u0027t care, supposedly), and then delete the row and leak resources on the SBI..","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"5bc180a177b45c47c61196a36160a37abeb773db","unresolved":false,"context_lines":[{"line_number":388,"context_line":".. code-block:: python"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def delete_port_postcommit(self, context, port):"},{"line_number":391,"context_line":"        with delete_resource.using(context, port):"},{"line_number":392,"context_line":"            sbi.delete_port(port)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_6d3c22e1","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":50},"in_reply_to":"5f7c97a3_4ab3e80a","updated":"2018-06-07 08:32:06.000000000","message":"same same","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"7ece3a728847f50b11350bce74756a547d57abda","unresolved":false,"context_lines":[{"line_number":388,"context_line":".. code-block:: python"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def delete_port_postcommit(self, context, port):"},{"line_number":391,"context_line":"        with delete_resource.using(context, port):"},{"line_number":392,"context_line":"            sbi.delete_port(port)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_74f13d95","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":50},"in_reply_to":"5f7c97a3_6d3c22e1","updated":"2018-06-20 07:59:56.000000000","message":"Since we\u0027re in agreement for the update case, this example should be updated appropriately as well","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"a7d97a1dcf5a6101a3ea7e677c193e2331a03f03","unresolved":false,"context_lines":[{"line_number":388,"context_line":".. code-block:: python"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def delete_port_postcommit(self, context, port):"},{"line_number":391,"context_line":"        with delete_resource.using(context, port):"},{"line_number":392,"context_line":"            sbi.delete_port(port)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_38c8931f","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":50},"in_reply_to":"5f7c97a3_74f13d95","updated":"2018-06-20 12:02:00.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":388,"context_line":".. code-block:: python"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def delete_port_postcommit(self, context, port):"},{"line_number":391,"context_line":"        with delete_resource.using(context, port):"},{"line_number":392,"context_line":"            sbi.delete_port(port)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_4ab3e80a","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":50},"in_reply_to":"5f7c97a3_fff301e6","updated":"2018-05-14 12:07:55.000000000","message":"same","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"91a4a4b57c3a370c6bafe4f27f5b4bda342832b6","unresolved":false,"context_lines":[{"line_number":415,"context_line":"by drivers such as `networking-odl"},{"line_number":416,"context_line":"\u003chttps://docs.openstack.org/networking-odl/latest/contributor/drivers_architecture.html#v2-design\u003e`_."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"Some things to keep in mind about this approach:"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"* Testing the API response time also can be misleading with the journaling"},{"line_number":421,"context_line":"  approach since the neutron-servers are just queuing things up and and"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_3f9c195c","line":418,"range":{"start_line":418,"start_character":0,"end_line":418,"end_character":48},"updated":"2018-05-08 14:30:55.000000000","message":"Couple more things:\n * The journal guarantees that all the operations for a given resource happen in the recorded order, so if theres expectation for certain operations to happen on the SBI it is a better approach than the revisions approach.\n * The journal has a lag in the sync to the SBI, which can become significant, since it doesn\u0027t immediately attempt to sync but always goes through the journal.","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"795abac3076e58a4ad1ef97886f4c2f9d2595298","unresolved":false,"context_lines":[{"line_number":415,"context_line":"by drivers such as `networking-odl"},{"line_number":416,"context_line":"\u003chttps://docs.openstack.org/networking-odl/latest/contributor/drivers_architecture.html#v2-design\u003e`_."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"Some things to keep in mind about this approach:"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"* Testing the API response time also can be misleading with the journaling"},{"line_number":421,"context_line":"  approach since the neutron-servers are just queuing things up and and"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_0dcae919","line":418,"range":{"start_line":418,"start_character":0,"end_line":418,"end_character":48},"in_reply_to":"5f7c97a3_3f9c195c","updated":"2018-05-14 12:07:55.000000000","message":"Done","commit_id":"dc8ab11bb536e3bac1f56ce6705abb808c3ee7cc"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"30dff763bb2817a9edec5e6d42e33c628cd6dc3f","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. TODO(mpeterson): Check if the decorator version could be actually be"},{"line_number":193,"context_line":"   implemented, as I think not all *commit(...) work in the same way. I don\u0027t"},{"line_number":194,"context_line":"   know if in all you get the resource in context.current."},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"As an example, an usage with decorators would look like this:"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_bd1eba5c","line":194,"range":{"start_line":194,"start_character":42,"end_line":194,"end_character":57},"updated":"2018-05-25 16:33:25.000000000","message":"not sure of know, but I remember in the past not all the resources were having context.current, qos was one case where its fetching data in a different way.","commit_id":"01ed5a3c1c3c6c712e7253fbf57680f414fccd57"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"30dff763bb2817a9edec5e6d42e33c628cd6dc3f","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":".. code-block:: python"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":209,"context_line":"        port \u003d context.current"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        with new_resource.using(context, port):"},{"line_number":212,"context_line":"            # operations to create the port"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""},{"line_number":215,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_7d6a62b3","line":212,"range":{"start_line":208,"start_character":4,"end_line":212,"end_character":43},"updated":"2018-05-25 16:33:25.000000000","message":"as of know some of the callbacks (l3 and qos resources) have kwargs or data passed to postcommit as well where context.current is not there. may be need to take care of ones with data and kwargs  ?","commit_id":"01ed5a3c1c3c6c712e7253fbf57680f414fccd57"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"66f907711118b8f841b40d1552fb16a15f77980e","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":".. code-block:: python"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def create_port_postcommit(self, context):"},{"line_number":209,"context_line":"        port \u003d context.current"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        with new_resource.using(context, port):"},{"line_number":212,"context_line":"            # operations to create the port"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""},{"line_number":215,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_cb5dde47","line":212,"range":{"start_line":208,"start_character":4,"end_line":212,"end_character":43},"in_reply_to":"5f7c97a3_7d6a62b3","updated":"2018-05-28 14:21:25.000000000","message":"I added now a utility function to handle those.","commit_id":"01ed5a3c1c3c6c712e7253fbf57680f414fccd57"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6f5cafe79dcd0b0e9c82131178e623a11c65c27c","unresolved":false,"context_lines":[{"line_number":18,"context_line":"network controller (e.g.: in OpenDaylight is ODL NeutronNorthbound, in"},{"line_number":19,"context_line":"Open Virtual Network (OVN) is the Cloud Management System (CMS), etc)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The solution has been implemented and successfully validated in OVN."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_38b4e181","line":21,"range":{"start_line":21,"start_character":64,"end_line":21,"end_character":67},"updated":"2018-05-29 09:35:19.000000000","message":"nit: networking-ovn","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":18,"context_line":"network controller (e.g.: in OpenDaylight is ODL NeutronNorthbound, in"},{"line_number":19,"context_line":"Open Virtual Network (OVN) is the Cloud Management System (CMS), etc)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The solution has been implemented and successfully validated in OVN."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_ad917554","line":21,"range":{"start_line":21,"start_character":64,"end_line":21,"end_character":67},"in_reply_to":"5f7c97a3_38b4e181","updated":"2018-06-11 16:12:19.000000000","message":"Done","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6f5cafe79dcd0b0e9c82131178e623a11c65c27c","unresolved":false,"context_lines":[{"line_number":186,"context_line":"Interface"},{"line_number":187,"context_line":"`````````"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"Each public method of the main interface will have two ways of accessing it,"},{"line_number":190,"context_line":"as a decorator and as a context manager."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. TODO(mpeterson): Check if the decorator version could be actually be"},{"line_number":193,"context_line":"   implemented, as I think not all *commit(...) work in the same way. I don\u0027t"},{"line_number":194,"context_line":"   know if in all you get the resource in context.current."},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"As an example, an usage with decorators would look like this:"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_d827edc6","line":194,"range":{"start_line":189,"start_character":0,"end_line":194,"end_character":58},"updated":"2018-05-29 09:35:19.000000000","message":"Maybe the spec can mention the context manager only ?\n\nIf we can also turn it in a decorator, great. But I don\u0027t think it matters as for the spec itself since it\u0027s just cosmetics.","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":186,"context_line":"Interface"},{"line_number":187,"context_line":"`````````"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"Each public method of the main interface will have two ways of accessing it,"},{"line_number":190,"context_line":"as a decorator and as a context manager."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":".. TODO(mpeterson): Check if the decorator version could be actually be"},{"line_number":193,"context_line":"   implemented, as I think not all *commit(...) work in the same way. I don\u0027t"},{"line_number":194,"context_line":"   know if in all you get the resource in context.current."},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"As an example, an usage with decorators would look like this:"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_8d96f94b","line":194,"range":{"start_line":189,"start_character":0,"end_line":194,"end_character":58},"in_reply_to":"5f7c97a3_d827edc6","updated":"2018-06-11 16:12:19.000000000","message":"It will be the same for either the decorator and the context manager, I already have an idea how to do it :)","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6f5cafe79dcd0b0e9c82131178e623a11c65c27c","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"create_resource"},{"line_number":215,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"Creates a new entry in the table with a placeholder value. This is meant to be"},{"line_number":218,"context_line":"done before the SBI is called, in order to indicate that a create action needs"}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_d8f60d5e","line":215,"range":{"start_line":215,"start_character":0,"end_line":215,"end_character":12},"updated":"2018-05-29 09:35:19.000000000","message":"Docs job is failing complaining about this being too small","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"create_resource"},{"line_number":215,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"Creates a new entry in the table with a placeholder value. This is meant to be"},{"line_number":218,"context_line":"done before the SBI is called, in order to indicate that a create action needs"}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_0da3c9b3","line":215,"range":{"start_line":215,"start_character":0,"end_line":215,"end_character":12},"in_reply_to":"5f7c97a3_d8f60d5e","updated":"2018-06-11 16:12:19.000000000","message":"Done","commit_id":"083c72a8311ed26d781615b41fc60261cf28890c"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0803e7f6943337c3c43cdc52af9276cbb9c7efee","unresolved":false,"context_lines":[{"line_number":77,"context_line":"but an exception is raised upon trying to update the SBI"},{"line_number":78,"context_line":"(e.g. lost connectivity to the Southbound controller)."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"This problem affected OVN -before adopting the solution this change proposes-"},{"line_number":81,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":82,"context_line":"this issue. It would be possible to try to immediately rollback the"},{"line_number":83,"context_line":"changes in the Neutron database and raise an exception but, the rollback"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_2fd5501c","line":80,"range":{"start_line":80,"start_character":26,"end_line":80,"end_character":27},"updated":"2018-05-30 22:39:35.000000000","message":"?","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0803e7f6943337c3c43cdc52af9276cbb9c7efee","unresolved":false,"context_lines":[{"line_number":77,"context_line":"but an exception is raised upon trying to update the SBI"},{"line_number":78,"context_line":"(e.g. lost connectivity to the Southbound controller)."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"This problem affected OVN -before adopting the solution this change proposes-"},{"line_number":81,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":82,"context_line":"this issue. It would be possible to try to immediately rollback the"},{"line_number":83,"context_line":"changes in the Neutron database and raise an exception but, the rollback"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_4fd8cc51","line":80,"range":{"start_line":80,"start_character":76,"end_line":80,"end_character":77},"updated":"2018-05-30 22:39:35.000000000","message":"?","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":77,"context_line":"but an exception is raised upon trying to update the SBI"},{"line_number":78,"context_line":"(e.g. lost connectivity to the Southbound controller)."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"This problem affected OVN -before adopting the solution this change proposes-"},{"line_number":81,"context_line":"and ODL -before adopting `Journaling`_. Other drivers might be affected by"},{"line_number":82,"context_line":"this issue. It would be possible to try to immediately rollback the"},{"line_number":83,"context_line":"changes in the Neutron database and raise an exception but, the rollback"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_ffcfb3b0","line":80,"range":{"start_line":80,"start_character":26,"end_line":80,"end_character":27},"in_reply_to":"5f7c97a3_2fd5501c","updated":"2018-06-11 16:12:19.000000000","message":"dashes can be used in the written language to clarify things or emphasize something","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0803e7f6943337c3c43cdc52af9276cbb9c7efee","unresolved":false,"context_lines":[{"line_number":300,"context_line":"For cases where a special treatment is needed, the API exposes a way"},{"line_number":301,"context_line":"to configure a function that will be called to retrieve this information."},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"The function will need to return a dictionary with 3 keys:"},{"line_number":304,"context_line":"  - \u0027resource_uuid\u0027"},{"line_number":305,"context_line":"  - \u0027resource_type\u0027"},{"line_number":306,"context_line":"  - \u0027revision_number\u0027"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"Example"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":".. code-block:: python"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def example_resolver(context, *args, **kwargs):"},{"line_number":313,"context_line":"       return {"},{"line_number":314,"context_line":"           \u0027resource_uuid\u0027: \u0027example-uuid\u0027,"},{"line_number":315,"context_line":"           \u0027resource_type\u0027: \u0027port\u0027,"},{"line_number":316,"context_line":"           \u0027revision_number\u0027: 1"},{"line_number":317,"context_line":"       }"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    config_resource_resolver(\u0027port\u0027, example_resolver)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"Utility functions"},{"line_number":322,"context_line":"`````````````````"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_af4080a6","line":319,"range":{"start_line":303,"start_character":1,"end_line":319,"end_character":54},"updated":"2018-05-30 22:39:35.000000000","message":"another possibility could be setting context.current with those values but then again not sure if it is good idea to modify context.","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":300,"context_line":"For cases where a special treatment is needed, the API exposes a way"},{"line_number":301,"context_line":"to configure a function that will be called to retrieve this information."},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"The function will need to return a dictionary with 3 keys:"},{"line_number":304,"context_line":"  - \u0027resource_uuid\u0027"},{"line_number":305,"context_line":"  - \u0027resource_type\u0027"},{"line_number":306,"context_line":"  - \u0027revision_number\u0027"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"Example"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":".. code-block:: python"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def example_resolver(context, *args, **kwargs):"},{"line_number":313,"context_line":"       return {"},{"line_number":314,"context_line":"           \u0027resource_uuid\u0027: \u0027example-uuid\u0027,"},{"line_number":315,"context_line":"           \u0027resource_type\u0027: \u0027port\u0027,"},{"line_number":316,"context_line":"           \u0027revision_number\u0027: 1"},{"line_number":317,"context_line":"       }"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    config_resource_resolver(\u0027port\u0027, example_resolver)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"Utility functions"},{"line_number":322,"context_line":"`````````````````"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_bfc93bad","line":319,"range":{"start_line":303,"start_character":1,"end_line":319,"end_character":54},"in_reply_to":"5f7c97a3_af4080a6","updated":"2018-06-11 16:12:19.000000000","message":"yeah, I don\u0027t think it\u0027s a good idea","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0803e7f6943337c3c43cdc52af9276cbb9c7efee","unresolved":false,"context_lines":[{"line_number":345,"context_line":"Get a list of resources that have been deleted from neutron but not in the SBI"},{"line_number":346,"context_line":"controller. Once a resource is deleted in Neutron the ``standard_attr_id``"},{"line_number":347,"context_line":"foreign key in the revision_numbers table will be set to NULL. Upon"},{"line_number":348,"context_line":"successfully deleting the resource throughh the SBI the entry in the"},{"line_number":349,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":350,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":351,"context_line":"thread can later fix it."}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_6f46e8c2","line":348,"range":{"start_line":348,"start_character":35,"end_line":348,"end_character":43},"updated":"2018-05-30 22:39:35.000000000","message":"nit: through","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":345,"context_line":"Get a list of resources that have been deleted from neutron but not in the SBI"},{"line_number":346,"context_line":"controller. Once a resource is deleted in Neutron the ``standard_attr_id``"},{"line_number":347,"context_line":"foreign key in the revision_numbers table will be set to NULL. Upon"},{"line_number":348,"context_line":"successfully deleting the resource throughh the SBI the entry in the"},{"line_number":349,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":350,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":351,"context_line":"thread can later fix it."}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_1f3aaf97","line":348,"range":{"start_line":348,"start_character":35,"end_line":348,"end_character":43},"in_reply_to":"5f7c97a3_6f46e8c2","updated":"2018-06-11 16:12:19.000000000","message":"Done","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0803e7f6943337c3c43cdc52af9276cbb9c7efee","unresolved":false,"context_lines":[{"line_number":466,"context_line":"* Neutron already has a concurrent design, multiple neutron-servers are"},{"line_number":467,"context_line":"  already being spawned to handle things in parallel. The approach proposed"},{"line_number":468,"context_line":"  in this spec make use of that design where in the journaling the"},{"line_number":469,"context_line":"  neutron-serves are only used to queue up changes to be later processed by"},{"line_number":470,"context_line":"  the journal threads."},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"  That makes things a bit more complicated, for example, how many journal"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_2f7b10f5","line":469,"range":{"start_line":469,"start_character":3,"end_line":469,"end_character":16},"updated":"2018-05-30 22:39:35.000000000","message":"neutron-servers","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"24d5a5dacaa8fe7d8efd36e4375ad7d4b51670fb","unresolved":false,"context_lines":[{"line_number":466,"context_line":"* Neutron already has a concurrent design, multiple neutron-servers are"},{"line_number":467,"context_line":"  already being spawned to handle things in parallel. The approach proposed"},{"line_number":468,"context_line":"  in this spec make use of that design where in the journaling the"},{"line_number":469,"context_line":"  neutron-serves are only used to queue up changes to be later processed by"},{"line_number":470,"context_line":"  the journal threads."},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"  That makes things a bit more complicated, for example, how many journal"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_5f4fc733","line":469,"range":{"start_line":469,"start_character":3,"end_line":469,"end_character":16},"in_reply_to":"5f7c97a3_2f7b10f5","updated":"2018-06-11 16:12:19.000000000","message":"Done","commit_id":"fabde3b3425e52300d06c77a699a4b5feed3f11f"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"873d1009564acfa22e017d3e7ff9a6ff9a98ee1f","unresolved":false,"context_lines":[{"line_number":110,"context_line":"   can react accordingly."},{"line_number":111,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":112,"context_line":"   issuing a failure or by handling the missing dependency internally)."},{"line_number":113,"context_line":"#. The SBI must not signal a failure, on these CRUD"},{"line_number":114,"context_line":"   operations -potentially ignoring them or coping appropriately internally:"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"   - A ``create`` is requested and the resource already exists."},{"line_number":117,"context_line":"   - An ``update`` is requested and the ``revision number`` sent inside the"},{"line_number":118,"context_line":"     resource is lower or equal than the one stored in the SBI."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"Introduction"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_bc08c52c","line":118,"range":{"start_line":113,"start_character":3,"end_line":118,"end_character":63},"updated":"2018-06-25 13:26:56.000000000","message":"I think this violates the HTTP RFC expectation though, check out [1].\n\nI think a better way to put it would be \"The *SBI client* must not signal...\"\nAnd to clarify that the while the SBI might signal an error for this case (i.e. 409 for a REST operation), the client should identify this error and if it\u0027s caused due to the revision number being lower (or resource already exists) then it should not signal an error.\n\n[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10","commit_id":"639e53624831f6dcc61e1f59ef9277db7f146ac8"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"b687eaa7022138c6db183a2ed3bb2156db90da1e","unresolved":false,"context_lines":[{"line_number":110,"context_line":"   can react accordingly."},{"line_number":111,"context_line":"#. The SBI must handle issue with dependencies between resources (e.g. by"},{"line_number":112,"context_line":"   issuing a failure or by handling the missing dependency internally)."},{"line_number":113,"context_line":"#. The SBI must not signal a failure, on these CRUD"},{"line_number":114,"context_line":"   operations -potentially ignoring them or coping appropriately internally:"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"   - A ``create`` is requested and the resource already exists."},{"line_number":117,"context_line":"   - An ``update`` is requested and the ``revision number`` sent inside the"},{"line_number":118,"context_line":"     resource is lower or equal than the one stored in the SBI."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"Introduction"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_d03554a9","line":118,"range":{"start_line":113,"start_character":3,"end_line":118,"end_character":63},"in_reply_to":"5f7c97a3_bc08c52c","updated":"2018-07-09 12:03:46.000000000","message":"Done","commit_id":"639e53624831f6dcc61e1f59ef9277db7f146ac8"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"5bc180a177b45c47c61196a36160a37abeb773db","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":".. code-block:: python"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def example_resolver(context, *args, **kwargs):"},{"line_number":313,"context_line":"       return {"},{"line_number":314,"context_line":"           \u0027resource_uuid\u0027: \u0027example-uuid\u0027,"},{"line_number":315,"context_line":"           \u0027resource_type\u0027: \u0027port\u0027,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_4d6b66f0","line":312,"range":{"start_line":312,"start_character":33,"end_line":312,"end_character":49},"updated":"2018-06-07 08:32:06.000000000","message":"What are those expected to be? It\u0027s not clear..","commit_id":"639e53624831f6dcc61e1f59ef9277db7f146ac8"}],"specs/stein/sbi-database-consistency.rst":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e04ae9f841aaf3f106d9ffe66be878dda25ead73","unresolved":false,"context_lines":[{"line_number":18,"context_line":"network controller (e.g.: in OpenDaylight is ODL NeutronNorthbound, in"},{"line_number":19,"context_line":"Open Virtual Network (OVN) is the Cloud Management System (CMS), etc)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The solution has been implemented and successfully validated in"},{"line_number":22,"context_line":"networking-ovn."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_626e5c30","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":15},"updated":"2019-05-10 17:13:40.000000000","message":"Seems this is a solution for that bottleneck lock?\nhttps://github.com/openstack/networking-ovn/blob/master/networking_ovn/ovsdb/ovsdb_monitor.py#L319-L327","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"57010870e508f75a21137fadfb925d711bdc78e6","unresolved":false,"context_lines":[{"line_number":18,"context_line":"network controller (e.g.: in OpenDaylight is ODL NeutronNorthbound, in"},{"line_number":19,"context_line":"Open Virtual Network (OVN) is the Cloud Management System (CMS), etc)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The solution has been implemented and successfully validated in"},{"line_number":22,"context_line":"networking-ovn."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_a7e5390b","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":15},"in_reply_to":"dfbec78f_626e5c30","updated":"2019-05-11 21:07:10.000000000","message":"Not really, the problem with the OVSDB lock being a bottleneck when handling events such as the port bindings is unrelated to this work. Here\u0027s the spec in networking-ovn for it: https://docs.openstack.org/networking-ovn/latest/contributor/design/distributed_ovsdb_events.html\n\nAnd the patches implementing it: https://review.opendev.org/#/c/655407/ and https://review.opendev.org/#/c/655408/\n\n...\n\nThe OVSDB lock is still valid and in networking-ovn we intend to still use it for the database inconsistency problem. Because with the OVSDB lock we guarantee that only one periodic task fixing the database inconsistencies is running at a time in the cluster. And that\u0027s enough, it hasn\u0027t been a bottleneck for us.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a23fa770747cb03ea92cca312f0f9e774f99263d","unresolved":false,"context_lines":[{"line_number":18,"context_line":"network controller (e.g.: in OpenDaylight is ODL NeutronNorthbound, in"},{"line_number":19,"context_line":"Open Virtual Network (OVN) is the Cloud Management System (CMS), etc)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The solution has been implemented and successfully validated in"},{"line_number":22,"context_line":"networking-ovn."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_5cd8cb1c","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":15},"in_reply_to":"dfbec78f_a7e5390b","updated":"2019-05-13 05:51:33.000000000","message":"Thanks for the information.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ffe8e7ed0d7b713a5c379e9614be6cae4b1311e3","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"In addition, rollbacks are not very straight forward when it comes to updates"},{"line_number":87,"context_line":"or deletes. In a case where a VM is being torn down and the SBI fails"},{"line_number":88,"context_line":"to delete a port, re-creating that port in Neutron doesn\u0027t necessary fix the"},{"line_number":89,"context_line":"problem. The decommission of a VM involves many other things, in fact, things"},{"line_number":90,"context_line":"could even be made worse by leaving some dirty data around. This is a problem"},{"line_number":91,"context_line":"that would be better dealt with by other methods."}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_5bd53ee4","line":88,"range":{"start_line":88,"start_character":59,"end_line":88,"end_character":68},"updated":"2019-05-11 04:58:44.000000000","message":"-\u003e necessarily","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e04ae9f841aaf3f106d9ffe66be878dda25ead73","unresolved":false,"context_lines":[{"line_number":91,"context_line":"that would be better dealt with by other methods."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"Proposed change"},{"line_number":95,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_c2baa86c","line":94,"range":{"start_line":94,"start_character":0,"end_line":94,"end_character":15},"updated":"2019-05-10 17:13:40.000000000","message":"This is more like a general-purpose for the none built-in drivers (I mean no such external SDN controller scenario). So my concern is, how does such change influence the neutron ovs and linux bridge driver?","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e04ae9f841aaf3f106d9ffe66be878dda25ead73","unresolved":false,"context_lines":[{"line_number":154,"context_line":"Implementation details"},{"line_number":155,"context_line":"----------------------"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"To achieve this, a new table schema named ``sbi_revision_numbers`` would"},{"line_number":158,"context_line":"be created to allow each SBI to track and manage resources:"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_42547821","line":157,"range":{"start_line":157,"start_character":44,"end_line":157,"end_character":64},"updated":"2019-05-10 17:13:40.000000000","message":"So neutron port will be blocked twice (we have one reversion_number already) by such revision mechanism?","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ffe8e7ed0d7b713a5c379e9614be6cae4b1311e3","unresolved":false,"context_lines":[{"line_number":154,"context_line":"Implementation details"},{"line_number":155,"context_line":"----------------------"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"To achieve this, a new table schema named ``sbi_revision_numbers`` would"},{"line_number":158,"context_line":"be created to allow each SBI to track and manage resources:"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_bbceba2a","line":157,"range":{"start_line":157,"start_character":44,"end_line":157,"end_character":64},"in_reply_to":"dfbec78f_42547821","updated":"2019-05-11 04:58:44.000000000","message":"In my understanding, the neutron revision number is the master source, and neutron port will not be blocked by whether the port is synced with SBI or not. This SBI revision number is used to determine whether the port needs to be synced with SBI.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a23fa770747cb03ea92cca312f0f9e774f99263d","unresolved":false,"context_lines":[{"line_number":154,"context_line":"Implementation details"},{"line_number":155,"context_line":"----------------------"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"To achieve this, a new table schema named ``sbi_revision_numbers`` would"},{"line_number":158,"context_line":"be created to allow each SBI to track and manage resources:"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_3025fbab","line":157,"range":{"start_line":157,"start_character":44,"end_line":157,"end_character":64},"in_reply_to":"dfbec78f_bbceba2a","updated":"2019-05-13 05:51:33.000000000","message":"OK, thanks for the info.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"abffbce921b5cbcb2fbfe7b714e74c62cfea5b69","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                            ONDELETE\u003dSET NULL."},{"line_number":166,"context_line":"resource_uuid     String    The UUID of the resource."},{"line_number":167,"context_line":"resource_type     String    The type of the resource (e.g, port, router, ...)"},{"line_number":168,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":169,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":170,"context_line":"                            troubleshooting purposes."},{"line_number":171,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_7d7ad624","line":168,"updated":"2019-05-06 09:40:13.000000000","message":"nitty nit: maybe sbi_revision_number would be better name?","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a23fa770747cb03ea92cca312f0f9e774f99263d","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                            ONDELETE\u003dSET NULL."},{"line_number":166,"context_line":"resource_uuid     String    The UUID of the resource."},{"line_number":167,"context_line":"resource_type     String    The type of the resource (e.g, port, router, ...)"},{"line_number":168,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":169,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":170,"context_line":"                            troubleshooting purposes."},{"line_number":171,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_d0149f46","line":168,"in_reply_to":"dfbec78f_7d7ad624","updated":"2019-05-13 05:51:33.000000000","message":"+1, a distinguishable attribute name is needed, in the `Introduction` and following sections, I feel confusing with this new number and neutron master `revision_number`.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"60768022e9cca35ebaa101d730a2c5cec7d4bb3f","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                            ONDELETE\u003dSET NULL."},{"line_number":166,"context_line":"resource_uuid     String    The UUID of the resource."},{"line_number":167,"context_line":"resource_type     String    The type of the resource (e.g, port, router, ...)"},{"line_number":168,"context_line":"revision_number   Integer   The version of the object present in the SBI."},{"line_number":169,"context_line":"created_at        DateTime  The time that the entry was created. For"},{"line_number":170,"context_line":"                            troubleshooting purposes."},{"line_number":171,"context_line":"updated_at        DateTime  The time that the entry was updated. For"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_38b3b94f","line":168,"in_reply_to":"dfbec78f_d0149f46","updated":"2019-05-24 13:26:10.000000000","message":"I agree that we need clear names on two revision numbers (in neutron and SBI).\n\nOn the other hand, the table name is \u0027sbi_revision_numbers\u0027, so if combining with the table name and column name, it would be \u0027sbi_revision_numebr.revision_numebr\u0027 so it is clear to me as the table schema definition.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ffe8e7ed0d7b713a5c379e9614be6cae4b1311e3","unresolved":false,"context_lines":[{"line_number":213,"context_line":"to be executed. In most cases this will be called from ``create_*_precommit()``"},{"line_number":214,"context_line":"methods."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"The proposed placeholder value is -1."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"Expected result:"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_3be2caa1","line":216,"updated":"2019-05-11 04:58:44.000000000","message":"IIUC the start number of neutron revision number is 1, so 0 should work. I am not sure which is better.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1212f9a09e02c47f68787d41640e273c3a1f9ee9","unresolved":false,"context_lines":[{"line_number":213,"context_line":"to be executed. In most cases this will be called from ``create_*_precommit()``"},{"line_number":214,"context_line":"methods."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"The proposed placeholder value is -1."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"Expected result:"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_a1230605","line":216,"in_reply_to":"dfbec78f_3be2caa1","updated":"2019-05-23 14:19:56.000000000","message":"After reading the section on sync_resource, I can see the wisdom in using -1. It\u0027s a placeholder that gets replaced with the resource revision number on the first sync. -1 communicates the state of the resource to humans more explicitly IMO. For maintainability\u0027s sake, -1 makes sense to me.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1212f9a09e02c47f68787d41640e273c3a1f9ee9","unresolved":false,"context_lines":[{"line_number":260,"context_line":"   to react to race conditions, e.g.: recording the ``revision_number``"},{"line_number":261,"context_line":"   internally."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"   If so, the mechanism that will detect and fix the out-of-sync resources"},{"line_number":264,"context_line":"   should detect this inconsistency as well and, based on the revision_number"},{"line_number":265,"context_line":"   in SBI controller, decide whether to sync the resource or only bump the"},{"line_number":266,"context_line":"   ``revision_number`` in the cache table (in case the resource is already"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_64e2fc31","line":263,"range":{"start_line":263,"start_character":9,"end_line":263,"end_character":74},"updated":"2019-05-23 14:19:56.000000000","message":"Maybe I missed it, but this mechanism doesn\u0027t seem to be invoked except on the postcommit of an update operation. As noted a L258, this can race and fail. I\u0027m not seeing how this mechanism gets invoked except on an update call made by a client through the neutron API. Is there a periodic task run to clean this up? Is it OK for the resource to sit in an out-of-sync SBI state indefinitely until the sync mechanism is invoked? It\u0027s not clear to me when and by what operations out-of-sync resources are synced.\n\nThis spec does a good job with details of how the sync mechanism works when invoked. I\u0027m finding it hard to follow when it is invoked, and how exactly a failure to commit the SBI revision info is remedied.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"47e9e99e88408adb36d5457899e383321b7ad7a7","unresolved":false,"context_lines":[{"line_number":260,"context_line":"   to react to race conditions, e.g.: recording the ``revision_number``"},{"line_number":261,"context_line":"   internally."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"   If so, the mechanism that will detect and fix the out-of-sync resources"},{"line_number":264,"context_line":"   should detect this inconsistency as well and, based on the revision_number"},{"line_number":265,"context_line":"   in SBI controller, decide whether to sync the resource or only bump the"},{"line_number":266,"context_line":"   ``revision_number`` in the cache table (in case the resource is already"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_7eb0398b","line":263,"range":{"start_line":263,"start_character":9,"end_line":263,"end_character":74},"in_reply_to":"bfb3d3c7_64e2fc31","updated":"2019-05-24 08:47:56.000000000","message":"Hi Ryan,\n\nI think they author of the spec could clarify this a little more, but yes, the inconsistencies are detected and fixed periodically. In networking-ovn we run the \"maintenance task\" every 5 minutes. So the idea of this mechanism is to get an eventual consistency.\n\nIt should be a lightweight operation, since the inconsistencies are detected by doing a JOIN comparison between the Neutron\u0027s standardattribute table and the cache table for the SBI (ovn_revision_numbers table, in OVN).\n\nWhen I was creating it in networking-ovn, I wrote a small blog post with some reasoning: http://lucasgom.es/posts/neutron_ovn_database_consistency.html\n\nMaybe that help clarify some aspects of it (and we should put those in the spec too).","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7c3eb7da22e2aaec6f9e9da38513c215dea22450","unresolved":false,"context_lines":[{"line_number":318,"context_line":"Utility functions"},{"line_number":319,"context_line":"`````````````````"},{"line_number":320,"context_line":"When things are working as expected the above changes should ensure"},{"line_number":321,"context_line":"that Neutron DB and the SBI controller are in sync but, what happens when"},{"line_number":322,"context_line":"things go bad ? As per `Problem 2 \u003cproblem_2_\u003e`_, things like temporarily"},{"line_number":323,"context_line":"losing connectivity with the SBI could cause changes to fail to be committed"},{"line_number":324,"context_line":"and the databases getting out-of-sync. It is then mandatory to detect those"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_7b05a245","line":321,"range":{"start_line":321,"start_character":50,"end_line":321,"end_character":56},"updated":"2019-05-11 05:21:03.000000000","message":"-\u003e \", but\"","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7c3eb7da22e2aaec6f9e9da38513c215dea22450","unresolved":false,"context_lines":[{"line_number":334,"context_line":""},{"line_number":335,"context_line":"Get a list of inconsistent resources which the revision number from the table"},{"line_number":336,"context_line":"aformentioned differs from the standardattributes table."},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"get_deleted_resources"},{"line_number":340,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_5bf8de47","line":337,"updated":"2019-05-11 05:21:03.000000000","message":"what kind of arguments are expected? resource_type?\nstandardattribute is used for almost all resources and a driver covers subset of them, so I think resource_type(s) is required.\n\nLooking at the implementation example section, it seems we need filtering based on arguments. Some example here would be nice.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b62fadba332b8b80317954a0091673b1a5d16d4b","unresolved":false,"context_lines":[{"line_number":334,"context_line":""},{"line_number":335,"context_line":"Get a list of inconsistent resources which the revision number from the table"},{"line_number":336,"context_line":"aformentioned differs from the standardattributes table."},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"get_deleted_resources"},{"line_number":340,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_61997cc2","line":337,"in_reply_to":"dfbec78f_5bf8de47","updated":"2019-05-24 09:04:00.000000000","message":"In networking-ovn, we use a join to match the resources by their standard attribute id [0].\n\nIn SQL it will be something like:\n\n\"SELECT ovn_revision_numbers.standard_attr_id, ovn_revision_numbers.resource_uuid, ovn_revision_numbers.resource_type, ovn_revision_numbers.revision_number, standardattributes.revision_number AS neutron_revision_number FROM ovn_revision_numbers INNER JOIN standardattributes ON ovn_revision_numbers.standard_attr_id\u003dstandardattributes.id;\"\n\n[0] https://github.com/openstack/networking-ovn/blob/db053fe94cd2fedb09d4089d4544d7149f9e0fc3/networking_ovn/db/maintenance.py#L24-L42","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7c3eb7da22e2aaec6f9e9da38513c215dea22450","unresolved":false,"context_lines":[{"line_number":346,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":347,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":348,"context_line":"thread can later fix it."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"Implementation examples"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_fb9672f0","line":349,"updated":"2019-05-11 05:21:03.000000000","message":"same question as for get_inconsistent_resources.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b62fadba332b8b80317954a0091673b1a5d16d4b","unresolved":false,"context_lines":[{"line_number":346,"context_line":"revision_number table should also be deleted but if something fails"},{"line_number":347,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":348,"context_line":"thread can later fix it."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"Implementation examples"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_41ba380a","line":349,"in_reply_to":"dfbec78f_fb9672f0","updated":"2019-05-24 09:04:00.000000000","message":"This one is actually easier, no JOINs needed.\n\nWe only need to look at the cache table for resources with their standard_attribute_id set to NULL. Because, when the resource is deleted from Neutron, it will cascade to the cache table setting the \"standard_attr_id\" column to NULL (ONDELETE\u003dSET NULL).\n\nhttps://github.com/openstack/networking-ovn/blob/db053fe94cd2fedb09d4089d4544d7149f9e0fc3/networking_ovn/db/maintenance.py#L45-L62","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":30560,"name":"Jacob Anders","email":"jacob.anders.au@gmail.com"},"change_message_id":"31d944e2f31671277a5dae5ae5a8e1f55a2d684b","unresolved":false,"context_lines":[{"line_number":347,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":348,"context_line":"thread can later fix it."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"Implementation examples"},{"line_number":353,"context_line":"```````````````````````"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9fb8cfa7_b16d9205","line":350,"updated":"2019-06-07 14:27:15.000000000","message":"Would this function be able to handle cases where there is leftover/garbage entries in the SDN DB, due to:\n1) port deletion requests that failed silently or \n2) re-initialising the neutron DB without clearning SDN DB first?\nFrom my experience this failure mode (silent deletion failure) isn\u0027t very uncommon, it would be very useful to have the ability to automatically resolve these.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"18daa8302ad3a3bb632706f32f6f64efe7aba7a1","unresolved":false,"context_lines":[{"line_number":347,"context_line":"the entry will be kept and returned in this list so the maintenance"},{"line_number":348,"context_line":"thread can later fix it."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"Implementation examples"},{"line_number":353,"context_line":"```````````````````````"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9fb8cfa7_b1da6048","line":350,"in_reply_to":"9fb8cfa7_b16d9205","updated":"2019-06-09 15:51:19.000000000","message":"I think this is a very important case to consider. Thanks for bringing it up Jacob","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"abffbce921b5cbcb2fbfe7b714e74c62cfea5b69","unresolved":false,"context_lines":[{"line_number":352,"context_line":"Implementation examples"},{"line_number":353,"context_line":"```````````````````````"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"For the different actions: Create, update and delete; this interface can be"},{"line_number":356,"context_line":"used as:"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_1d771a3d","line":355,"updated":"2019-05-06 09:40:13.000000000","message":"nitty nit: s/Create/create","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1212f9a09e02c47f68787d41640e273c3a1f9ee9","unresolved":false,"context_lines":[{"line_number":359,"context_line":"1. Create:"},{"line_number":360,"context_line":"\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027\u0027"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"In the ``create_*_precommit()`` method, an entry is created in the table"},{"line_number":363,"context_line":"within the same Neutron transaction. The ``revision_number`` column for"},{"line_number":364,"context_line":"the new entry will have a placeholder value until the resource is"},{"line_number":365,"context_line":"successfully created by calling the SBI."}],"source_content_type":"text/x-rst","patch_set":12,"id":"bfb3d3c7_01bf7261","line":362,"range":{"start_line":362,"start_character":63,"end_line":362,"end_character":72},"updated":"2019-05-23 14:19:56.000000000","message":"Can we be more explicit about *which* table entries are written to? I assume you mean the sbi_revision_numbers table?","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"45f8509a69a20d6a9ba852e81e2e4944c9878baf","unresolved":false,"context_lines":[{"line_number":471,"context_line":"  `tools to be able to validate the real performance of the journal"},{"line_number":472,"context_line":"  \u003chttps://review.openstack.org/508826/\u003e`_ (from the moment that the API"},{"line_number":473,"context_line":"  accepts the request until the change is pick by a journal thread and"},{"line_number":474,"context_line":"  sent to the SBI). Tools like Rally or Browbeat might have a problem"},{"line_number":475,"context_line":"  validating the real performance of the requests as-is."},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"* Neutron already has a concurrent design, multiple neutron-servers are"},{"line_number":478,"context_line":"  already being spawned to handle things in parallel. The approach proposed"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9fb8cfa7_5eb55acc","line":475,"range":{"start_line":474,"start_character":20,"end_line":475,"end_character":55},"updated":"2019-06-06 12:21:28.000000000","message":"This reads a little like the tail wagging the dog.  I\u0027d be interested to see more consideration here for the arguments the ODL page above makes for their adoption of a journal.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"45f8509a69a20d6a9ba852e81e2e4944c9878baf","unresolved":false,"context_lines":[{"line_number":519,"context_line":"  per Neutron API worker caused the DB to misbehave"},{"line_number":520,"context_line":"  when under heavy pressure [1]_. Running multiple journal threads"},{"line_number":521,"context_line":"  seem to be causing other types of problems `in other drivers as well"},{"line_number":522,"context_line":"  \u003chttps://bugs.launchpad.net/networking-odl/+bug/1683797\u003e`_."},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"* When under heavy pressure [1]_, the journal threads could come to a"},{"line_number":525,"context_line":"  halt (or really slowed down) while the API workers were handling a"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9fb8cfa7_9ebf52cf","line":522,"updated":"2019-06-06 12:21:28.000000000","message":"This bug appears to have been resolved in 2017.  Is it true that ODL has had a working solution for this since then?","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"45f8509a69a20d6a9ba852e81e2e4944c9878baf","unresolved":false,"context_lines":[{"line_number":526,"context_line":"  lot of requests. This resulted in some operations taking more than"},{"line_number":527,"context_line":"  a minute to be processed. This behaviour can be seen"},{"line_number":528,"context_line":"  `in this screenshot \u003chttp://i.imgur.com/GDG8Mic.png\u003e`_."},{"line_number":529,"context_line":""},{"line_number":530,"context_line":".. TODO find a better place to host that image"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"* Given that the 1 journal thread per Neutron API worker approach"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9fb8cfa7_7e14dea0","line":529,"updated":"2019-06-06 12:21:28.000000000","message":"This argument would be a lot stronger if you could make the case that an alternative approach without journaling had better properties under the same level of pressure.","commit_id":"2e9d8de17073b240f90fd33de4881acab74a886b"}]}
