)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"be2ffee084e6d6a817fbe59b2d355d51adee6194","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Sometimes in case of HA routers it may happend that"},{"line_number":10,"context_line":"keepalived will set status of router to MASTER before"},{"line_number":11,"context_line":"neutron-keepalived-state-change daemon will spawn \"ip monitor\""},{"line_number":12,"context_line":"to monitor changes of IPs in router\u0027s namespace."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"In such case neutron-keepalived-state-change process will never"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5fc1f717_503e6e8b","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":62},"updated":"2019-03-13 16:49:09.000000000","message":"IMO, this also address bug:\nhttps://bugs.launchpad.net/neutron/+bug/1819160\n\nHere is an example of \"test_dvr_ha_router_failover_without_gw\":\nhttp://logs.openstack.org/66/641866/3/check/neutron-functional/1fca834/logs/journal.log\nhttp://logs.openstack.org/66/641866/3/check/neutron-functional/1fca834/logs/testr_results.html.gz\n\nAfter the update_initial_state, router \"7c862c16\" never get state change transfer again.\nhttp://logs.openstack.org/66/641866/3/check/neutron-functional/1fca834/logs/dsvm-functional-logs/neutron.tests.functional.agent.l3.test_dvr_router.TestDvrRouter.test_dvr_ha_router_failover_without_gw.txt.gz#_2019-03-12_10_49_25_873\n\nThe state change python process was started here:\n\nMar 12 10:49:31 ubuntu-xenial-ovh-gra1-0003686087 neutron-rootwrap-daemon[11727]: (zuul \u003e root) Executing [\u0027/sbin/ip\u0027, \u0027netns\u0027, \u0027exec\u0027, \u0027snat-7c862c16-81ec-4a0e-9151-027c841f610d@agent2\u0027, \u0027neutron-keepalived-state-change\u0027, \u0027--router_id\u003d7c862c16-81ec-4a0e-9151-027c841f610d\u0027, \u0027--namespace\u003dsnat-7c862c16-81ec-4a0e-9151-027c841f610d@agent2\u0027, \u0027--conf_dir\u003d/tmp/tmps1lq9gtl/tmpgquywzn8/ha_confs/7c862c16-81ec-4a0e-9151-027c841f610d\u0027, \u0027--monitor_interface\u003dha-287e9556-f8\u0027, \u0027--monitor_cidr\u003d169.254.0.1/24\u0027, \u0027--pid_file\u003d/tmp/tmps1lq9gtl/tmpgquywzn8/external/pids/7c862c16-81ec-4a0e-9151-027c841f610d.monitor.pid\u0027, \u0027--state_path\u003d/tmp/tmps1lq9gtl/tmpgquywzn8\u0027, \u0027--user\u003d1001\u0027, \u0027--group\u003d1001\u0027] (filter match \u003d ip_exec)\n\nBut after 25s, the IP monitor was started lately.\n\nMar 12 10:49:46 ubuntu-xenial-ovh-gra1-0003686087 neutron-keepalived-state-change[18178]: 2019-03-12 10:49:46.700 18178 DEBUG neutron.agent.common.async_process [-] Launching async process [ip netns exec snat-7c862c16-81ec-4a0e-9151-027c841f610d@agent2 ip -o monitor address]. start /opt/stack/new/neutron/neutron/agent/common/async_process.py:112\n\nBut, during this long 25s seconds, the manually HA failover was fired done. So the new \u0027master\u0027 state will never be written to the state file.\n\n[yulong@devstack ~]$ grep \"Wrote router\" journal.log |grep 7c862c16\n[yulong@devstack ~]$ \n[yulong@devstack ~]$ \n[yulong@devstack ~]$ grep \"Wrote router\" journal.log |grep 7a46468f\nMar 12 10:49:38 ubuntu-xenial-ovh-gra1-0003686087 neutron-keepalived-state-change[16619]: 2019-03-12 10:49:38.417 16619 DEBUG neutron.agent.l3.keepalived_state_change [-] Wrote router 7a46468f-1a89-444a-8d97-781b30884cbf state master write_state_change /opt/stack/new/neutron/neutron/agent/l3/keepalived_state_change.py:96\nMar 12 10:49:40 ubuntu-xenial-ovh-gra1-0003686087 neutron-keepalived-state-change[16619]: 2019-03-12 10:49:40.420 16619 DEBUG neutron.agent.l3.keepalived_state_change [-] Wrote router 7a46468f-1a89-444a-8d97-781b30884cbf state backup write_state_change /opt/stack/new/neutron/neutron/agent/l3/keepalived_state_change.py:96","commit_id":"8fec1ffc833eba9b3fc5f812bf881f44b4beba0c"}],"neutron/agent/l3/keepalived_state_change.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1391dfc4288dfd28551a059e3ffb442102c81a56","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":102,"context_line":"                              self.router_id, state)"},{"line_number":103,"context_line":"                    self.write_state_change(state)"},{"line_number":104,"context_line":"                    self.notify_agent(state)"},{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                LOG.debug(\u0027Initial status of router %s is %s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_bd847d0d","line":104,"updated":"2019-03-11 16:28:46.000000000","message":"What about the case this is the backup?  We want to write the state in that case too right?","commit_id":"6a9604227e8a7a64608bc7b1d0efacad4a081afb"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"10fb413618d9a79a98ce1efe57915dc9437841e1","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":102,"context_line":"                              self.router_id, state)"},{"line_number":103,"context_line":"                    self.write_state_change(state)"},{"line_number":104,"context_line":"                    self.notify_agent(state)"},{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                LOG.debug(\u0027Initial status of router %s is %s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_fd1445a2","line":104,"in_reply_to":"5fc1f717_bd847d0d","updated":"2019-03-11 16:35:16.000000000","message":"in case when it\u0027s backup, it will be set \"by default\" like that. Later when keepalived will change state, it will be changed by \"parse_and_handle_event\" method above.","commit_id":"6a9604227e8a7a64608bc7b1d0efacad4a081afb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1391dfc4288dfd28551a059e3ffb442102c81a56","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":108,"context_line":"                          self.router_id, state)"},{"line_number":109,"context_line":"        except Exception:"},{"line_number":110,"context_line":"            LOG.exception(\u0027Failed to get initial status of router %s\u0027,"},{"line_number":111,"context_line":"                          self.router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_5d9a396e","line":108,"updated":"2019-03-11 16:28:46.000000000","message":"nit: i guess you could not have this under an \u0027else\u0027 and just log the initial state for both cases here?","commit_id":"6a9604227e8a7a64608bc7b1d0efacad4a081afb"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"10fb413618d9a79a98ce1efe57915dc9437841e1","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":108,"context_line":"                          self.router_id, state)"},{"line_number":109,"context_line":"        except Exception:"},{"line_number":110,"context_line":"            LOG.exception(\u0027Failed to get initial status of router %s\u0027,"},{"line_number":111,"context_line":"                          self.router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_bd0ebd8a","line":108,"in_reply_to":"5fc1f717_5d9a396e","updated":"2019-03-11 16:35:16.000000000","message":"right, changed","commit_id":"6a9604227e8a7a64608bc7b1d0efacad4a081afb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"efdeb7339125085f801b0e0289dc5e7f9818a318","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    self.write_state_change(state)"},{"line_number":102,"context_line":"                    self.notify_agent(state)"},{"line_number":103,"context_line":"                    break"},{"line_number":104,"context_line":"                    "},{"line_number":105,"context_line":"            LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":106,"context_line":"                      self.router_id, state)"},{"line_number":107,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_f1378eaf","line":104,"updated":"2019-03-11 19:30:28.000000000","message":"pep8 won\u0027t like that :(","commit_id":"8bae9b71fcf99617a4456fb4c6ed0d1cb755fb0b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"fec2947a7c1fd1ffe0036f8281ebbe0b6a97e639","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    self.write_state_change(state)"},{"line_number":102,"context_line":"                    self.notify_agent(state)"},{"line_number":103,"context_line":"                    break"},{"line_number":104,"context_line":"                    "},{"line_number":105,"context_line":"            LOG.debug(\u0027Initial status of router %s is %s\u0027,"},{"line_number":106,"context_line":"                      self.router_id, state)"},{"line_number":107,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_3108b62a","line":104,"in_reply_to":"5fc1f717_f1378eaf","updated":"2019-03-11 20:18:19.000000000","message":"arghh, me neither :)","commit_id":"8bae9b71fcf99617a4456fb4c6ed0d1cb755fb0b"}]}
