)]}'
{"dragonflow/db/api_nb.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"12b91e67b5a03afc33ae1991404732e7bc1bf069","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        self.driver.set_key(\u0027lswitch\u0027, name, lswitch_json)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def delete_lswitch(self, name, topic):"},{"line_number":283,"context_line":"        self.driver.delete_key(\u0027lswitch\u0027, name)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def create_lport(self, name, lswitch_name, topic, **columns):"},{"line_number":286,"context_line":"        lport \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_d72343a6","line":283,"updated":"2016-02-02 13:05:08.000000000","message":"Why do we need the topic parameter here? It is unused, and name is the UUID (otherwise the topic should be incorporated into name to avoid cross-tenant name collision).","commit_id":"c7083cc95b9fc251364ed43fbcd4ef0242c49a29"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"3b80f9e3bc6a512639c04b9e9b7818a88b5693f8","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        self.driver.set_key(\u0027lswitch\u0027, name, lswitch_json)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def delete_lswitch(self, name, topic):"},{"line_number":283,"context_line":"        self.driver.delete_key(\u0027lswitch\u0027, name)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def create_lport(self, name, lswitch_name, topic, **columns):"},{"line_number":286,"context_line":"        lport \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_b258158c","line":283,"in_reply_to":"7a5de9d1_d72343a6","updated":"2016-02-02 13:30:37.000000000","message":"We want to minimize the job we do on the DF DB, this is critical when looking at the DB consistency issues, i dont see any benefit for doing what you suggest at this point given that DF DB is a subset of Neutron.\n\nBut, its certainly something that we can accomplish later if needed","commit_id":"c7083cc95b9fc251364ed43fbcd4ef0242c49a29"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"12b91e67b5a03afc33ae1991404732e7bc1bf069","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        self.driver.set_key(\u0027lport\u0027, name, lport_json)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"    def delete_lport(self, name, topic):"},{"line_number":304,"context_line":"        self.driver.delete_key(\u0027lport\u0027, name)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def create_lrouter(self, name, topic, **columns):"},{"line_number":307,"context_line":"        lrouter \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_b75567fb","line":304,"updated":"2016-02-02 13:05:08.000000000","message":"Same here.","commit_id":"c7083cc95b9fc251364ed43fbcd4ef0242c49a29"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"12b91e67b5a03afc33ae1991404732e7bc1bf069","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        lrouter_json \u003d jsonutils.dumps(lrouter)"},{"line_number":313,"context_line":"        self.driver.create_key(\u0027lrouter\u0027, name, lrouter_json)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    def delete_lrouter(self, name, topic):"},{"line_number":316,"context_line":"        self.driver.delete_key(\u0027lrouter\u0027, name)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    def add_lrouter_port(self, name, lrouter_name, lswitch, **columns):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_d75a632a","line":315,"updated":"2016-02-02 13:05:08.000000000","message":"Same here","commit_id":"c7083cc95b9fc251364ed43fbcd4ef0242c49a29"}],"dragonflow/neutron/plugin.py":[{"author":{"_account_id":18668,"name":"ding bo","email":"longddropt@163.com","username":"longddropt"},"change_message_id":"7cf7c1de44d326acdd527fea2980bd922dee8f12","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        for port in self.nb_api.get_all_logical_ports():"},{"line_number":286,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":287,"context_line":"                try:"},{"line_number":288,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"},{"line_number":289,"context_line":"                                             topic\u003dtenant_id)"},{"line_number":290,"context_line":"                except df_exceptions.DBKeyNotFound:"},{"line_number":291,"context_line":"                    LOG.debug(\"port %s is not found in DB, might have\""},{"line_number":292,"context_line":"                              \"been deleted concurrently\" % port.get_id())"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_e97e2d18","line":289,"range":{"start_line":288,"start_character":0,"end_line":289,"end_character":61},"updated":"2016-02-05 04:54:29.000000000","message":"The port.id is uuid which is the primary key in sql db(unique). topic seems to be uneccessary. because when we delete lport in DF DB, the port.id is enough.","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"3030812ee9794145a61a805219cf24385f611575","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        for port in self.nb_api.get_all_logical_ports():"},{"line_number":286,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":287,"context_line":"                try:"},{"line_number":288,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"},{"line_number":289,"context_line":"                                             topic\u003dtenant_id)"},{"line_number":290,"context_line":"                except df_exceptions.DBKeyNotFound:"},{"line_number":291,"context_line":"                    LOG.debug(\"port %s is not found in DB, might have\""},{"line_number":292,"context_line":"                              \"been deleted concurrently\" % port.get_id())"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_c0068d85","line":289,"range":{"start_line":288,"start_character":0,"end_line":289,"end_character":61},"in_reply_to":"5a5ae5dd_e97e2d18","updated":"2016-02-05 14:41:22.000000000","message":"Think of this scenario:\nI have a DB and order it by topics, so for example in etcd i have table for tenant X and then all ports/lswitches/lrouters.. for this tenant.\nIf i don\u0027t get the topic in this API i won\u0027t be able to delete it fast, will have to iterate on all tenants.\n\nWe already know the topic, why not provide this information to the next layer, maybe it is useful to it / maybe not, let the DB decide if to use it and how...","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"d82a92a6b747a6e8517c0de9aa692a7d04b3b3b6","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        for port in self.nb_api.get_all_logical_ports():"},{"line_number":286,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":287,"context_line":"                try:"},{"line_number":288,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"},{"line_number":289,"context_line":"                                             topic\u003dtenant_id)"},{"line_number":290,"context_line":"                except df_exceptions.DBKeyNotFound:"},{"line_number":291,"context_line":"                    LOG.debug(\"port %s is not found in DB, might have\""},{"line_number":292,"context_line":"                              \"been deleted concurrently\" % port.get_id())"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_81066d84","line":289,"range":{"start_line":288,"start_character":0,"end_line":289,"end_character":61},"in_reply_to":"5a5ae5dd_e97e2d18","updated":"2016-02-05 07:07:18.000000000","message":"we need to topic not only for the DB operation we need it in order to know who should be notify in case of external pubsub","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"4af557ecc1d28ceb2cea18c4464268fb5cd30b54","unresolved":false,"context_lines":[{"line_number":459,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":460,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":461,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":462,"context_line":"            sgids\u003dsgids)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        return port"},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_5dc53659","line":462,"updated":"2016-02-03 07:08:13.000000000","message":"I just send an email discussing about db consistency. I propose to refactor the nb_api interfaces. Why not pass neutron object to nb_api but filter these parameters?\n\nIf we wanna add some parameters in the neutron object or neutron object adds other parameters that is usable, we still have to add them to API in the future.\n\nFor example, self.nb_api.create_lport(id, port, df_params).\nWe can parse the port object in nb-api and obtain all the usable parameters there. As a result, the neutron plugin part is much simpler, concentrating on its own responsibility which is the bridge between neutron and dragonflow, without any additional logic dedicated to dragonflow.","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"aaf13784f93d3002764343a868b23dba5a6bf7f9","unresolved":false,"context_lines":[{"line_number":459,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":460,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":461,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":462,"context_line":"            sgids\u003dsgids)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        return port"},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_d2eedeeb","line":462,"in_reply_to":"5a5ae5dd_5dc53659","updated":"2016-02-03 14:27:58.000000000","message":"I don\u0027t see what is the difference, instead of doing it here in the plugin we do it in nb_api?\nnb_api is now exposed to Neutron stuff, this is exactly the plugin whole point, to translate between Neutron and DF DB model.\n\nIf the reason you are mentioning this is the journal, we can solve these in easier ways, we can abstract the \"conversion\" methods here, use the neutron (or DF) values as the values for the journal (JSON like) and do this.\n\nso either we do the translation, write the JSON to the journal and change nb_API to receive JSON like values, or we write to the journal the Neutron representation and read and do the translation from the journal thread.\n\nEither way, i personally think this code belongs to our Neutron plugin, which is the interface between Neutron and DF","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"3030812ee9794145a61a805219cf24385f611575","unresolved":false,"context_lines":[{"line_number":459,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":460,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":461,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":462,"context_line":"            sgids\u003dsgids)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        return port"},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_e01949d8","line":462,"in_reply_to":"5a5ae5dd_c19d4567","updated":"2016-02-05 14:41:22.000000000","message":"why add another layer.\nIf we want better selective proactive we can change it in the plugin.\n\nI don\u0027t think that everything needs to be pluggable, its just makes the code more complicated for no real reason.\nWhen we will want better selective proactive, we can try to do it","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"d82a92a6b747a6e8517c0de9aa692a7d04b3b3b6","unresolved":false,"context_lines":[{"line_number":459,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":460,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":461,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":462,"context_line":"            sgids\u003dsgids)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        return port"},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_c19d4567","line":462,"in_reply_to":"5a5ae5dd_d2eedeeb","updated":"2016-02-05 07:07:18.000000000","message":"I agree with @gal that we should not expose neutron model to nb_api \n\nBut i think we need an abstraction layer that is responsible for the filtering/selective-distribution so it will be easier to plug even by configuration what kind of selective distribution you want by \"project\" by tag by internal overlay.\n\nMy suggestion is to add another layer to the write/read/delete that adds the topic and it will be completely transparent to plugin and nb_api","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"8399fe1db4c8d71622a6741ffaa43034b27cef1e","unresolved":false,"context_lines":[{"line_number":459,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":460,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":461,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":462,"context_line":"            sgids\u003dsgids)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        return port"},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_b17ce0ec","line":462,"in_reply_to":"5a5ae5dd_e01949d8","updated":"2016-02-07 05:41:11.000000000","message":"If we want to support event-filtering, it can be added over the events sent by the nb_api (see https://review.openstack.org/#/c/263322/). It isn\u0027t exactly transparent to the nb_api, but the implementation could be abstracted away (and then it can be implemented in a pluggable way, if wanted). It doesn\u0027t add another abstraction layer that needs to be understood. It will be contained in the pub/sub flow, rather than affecting all db changes (more than pub/sub does already).\n\nWhen it comes to db-supported pub/sub, we\u0027re at the mercy of the db plugin/driver anyway, and that can implement whatever is necessary (such as calling the abstracted implementation).","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"d82a92a6b747a6e8517c0de9aa692a7d04b3b3b6","unresolved":false,"context_lines":[{"line_number":524,"context_line":"                service_constants.L3_ROUTER_NAT)"},{"line_number":525,"context_line":"            topic \u003d None"},{"line_number":526,"context_line":"            if l3plugin:"},{"line_number":527,"context_line":"                router \u003d l3plugin.get_router(context, router_id)"},{"line_number":528,"context_line":"                topic \u003d router[\u0027tenant_id\u0027]"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"            self.nb_api.delete_lrouter(name\u003drouter_name, topic\u003dtopic)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_a1e4c9e0","line":527,"range":{"start_line":527,"start_character":25,"end_line":527,"end_character":33},"updated":"2016-02-05 07:07:18.000000000","message":"I think that you can just call self \nas we are \"core\" plugin at the moment","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"3030812ee9794145a61a805219cf24385f611575","unresolved":false,"context_lines":[{"line_number":524,"context_line":"                service_constants.L3_ROUTER_NAT)"},{"line_number":525,"context_line":"            topic \u003d None"},{"line_number":526,"context_line":"            if l3plugin:"},{"line_number":527,"context_line":"                router \u003d l3plugin.get_router(context, router_id)"},{"line_number":528,"context_line":"                topic \u003d router[\u0027tenant_id\u0027]"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"            self.nb_api.delete_lrouter(name\u003drouter_name, topic\u003dtopic)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_0057c526","line":527,"range":{"start_line":527,"start_character":25,"end_line":527,"end_character":33},"in_reply_to":"5a5ae5dd_a1e4c9e0","updated":"2016-02-05 14:41:22.000000000","message":"you are correct probably, i will fix","commit_id":"32e346a4a5cc22604ec68ab1dffd680118dd89be"}]}
