)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"003e5894785eab05dd931168f7c39fc6c80cb970","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"203db7e5_8faeff09","updated":"2022-03-25 10:12:24.000000000","message":"Question in line","commit_id":"44da2241024e84913bd3074617d5463da0c7f911"}],"neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/maintenance.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"5492a8be1d5a4e152dadf701d9e46da52e3bbd99","unresolved":true,"context_lines":[{"line_number":771,"context_line":"    @periodics.periodic(spacing\u003d60, run_immediately\u003dTrue)"},{"line_number":772,"context_line":"    def ovn_nb_sync(self):"},{"line_number":773,"context_line":"        # This sync neutron DB to OVN-NB DB only in inconsistent states"},{"line_number":774,"context_line":"        if not self.has_lock:"},{"line_number":775,"context_line":"            return"},{"line_number":776,"context_line":"        nb_synchronizer \u003d ovn_db_sync.OvnNbSynchronizer("},{"line_number":777,"context_line":"            self._ovn_client._plugin,"},{"line_number":778,"context_line":"            self._nb_idl,"}],"source_content_type":"text/x-python","patch_set":11,"id":"97abfccc_7ed247a6","line":775,"range":{"start_line":774,"start_character":0,"end_line":775,"end_character":18},"updated":"2022-03-25 10:12:13.000000000","message":"My only problem with this approach is that, if the lock moves around to another worker (e.g shutting down the neutron-server where this lock was held) the new worker who acquired a valid lock will run the sync() again.\n\nIf the mode is \"repair\" it will make changes to OVN NB DB while the cluster is being used, other changes will be coming from the API which could conflict with the sync() specially if it\u0027s a environment with many resources created. So I wonder if we should just \"return\" in case there\u0027s no valid lock here or if we should \"raise periodics.NeverAgain()\" and never run sync() again. \n\nThoughts ?","commit_id":"44da2241024e84913bd3074617d5463da0c7f911"},{"author":{"_account_id":30380,"name":"ZhouHeng","email":"zhouhenglc@inspur.com","username":"zhouhenglc"},"change_message_id":"aaf3926c410081d4bca122b564f78d7bff6cc255","unresolved":true,"context_lines":[{"line_number":771,"context_line":"    @periodics.periodic(spacing\u003d60, run_immediately\u003dTrue)"},{"line_number":772,"context_line":"    def ovn_nb_sync(self):"},{"line_number":773,"context_line":"        # This sync neutron DB to OVN-NB DB only in inconsistent states"},{"line_number":774,"context_line":"        if not self.has_lock:"},{"line_number":775,"context_line":"            return"},{"line_number":776,"context_line":"        nb_synchronizer \u003d ovn_db_sync.OvnNbSynchronizer("},{"line_number":777,"context_line":"            self._ovn_client._plugin,"},{"line_number":778,"context_line":"            self._nb_idl,"}],"source_content_type":"text/x-python","patch_set":11,"id":"d69facac_1a2cbf35","line":775,"range":{"start_line":774,"start_character":0,"end_line":775,"end_character":18},"in_reply_to":"97abfccc_7ed247a6","updated":"2022-03-28 01:02:31.000000000","message":"hi lucas, here\u0027s what I\u0027m worried about: if we \"raise periodics.NeverAgain()\", we may not be able to trigger synchronization by restarting neutron\neg:\nthree neutron-server \nneutron-server-1 no lock\nneutron-server-2 has lock\nneutron-server-3 no lock\n\nstep 1:\nrestart neutron-server-1, neutron-server-1 can not get the lock, not sync.\nnow is,\nneutron-server-1 no lock\nneutron-server-2 has lock\nneutron-server-3 no lock\n\nstep 2:\nrestart neturon-server-2, neutron-server-3 will get lock, but not sync, and neutron-server-2 can not get the lock, not sync.\nnow is,\nneutron-server-1 no lock\nneutron-server-2 no lock\nneutron-server-3 has lock\n\nstep 3:\nrestart neutron-server-3 will like \u0027step 2\u0027, no neutron-server sync.\n\ngenerally, we need two kinds of synchronization:\ncase 1: there is a problem with the code, causing out of synchronization. in this case, the synchronization data is generally small. Even if it is run several times, it should have little impact.\ncase 2: the NB database is abnormal and the data has been deleted. at this time, the most important thing is to start sync quickly.\n\nSo I think it\u0027s better to “return\" if don\u0027t has the lock.\nlucas, what your thoughts?","commit_id":"44da2241024e84913bd3074617d5463da0c7f911"}]}
