Closed HW-lj closed 5 years ago
@pqarmitage
@HW-lj ?
Commit ad95140, in conjunction with the proceeding commits, resolves this issue.
Many thanks for your work on this. It works well while the solution seems a bit complicated. And I got the following solution to solve this.
diff --git a/keepalived/check/ipvswrapper.c b/keepalived/check/ipvswrapper.c
index 2861889..6ab3448 100644
--- a/keepalived/check/ipvswrapper.c
+++ b/keepalived/check/ipvswrapper.c
@@ -474,8 +474,8 @@ ipvs_group_cmd(int cmd, ipvs_service_t *srule, ipvs_dest_t *drule, virtual_serve
if (ipvs_talk(cmd, srule, drule, NULL, false))
return -1;
}
+ ipvs_set_vsge_alive_state(cmd, vsg_entry, vs);
}
- ipvs_set_vsge_alive_state(cmd, vsg_entry, vs);
}
/* visit vfwmark list */
@@ -494,8 +494,8 @@ ipvs_group_cmd(int cmd, ipvs_service_t *srule, ipvs_dest_t *drule, virtual_serve
if (ipvs_change_needed(cmd, vsg_entry, vs, rs)) {
if (ipvs_talk(cmd, srule, drule, NULL, false))
return -1;
+ ipvs_set_vsge_alive_state(cmd, vsg_entry, vs);
}
- ipvs_set_vsge_alive_state(cmd, vsg_entry, vs);
}
return 0;
--
The reason it is a bit complicated is that that was what was necessary to ensure that it all worked properly. The changes also resolved some other, related, issues.
The reason it is a bit complicated is that that was what was necessary to ensure that it all worked properly. The changes also resolved some other, related, issues
In fact, according to the commit d010df02 , I think maybe it's better to move ipvs_set_vsge_alive_state into the condition ipvs_change_needed. As to the other, related, issues, we should modify they in another dependent commit.
config:
step to reproduce: 1、start the keepalived until real server online 2、reload the keepalived and wait for a while 3、stop the keepalived and watch 'ipvsadm -ln' The virtual server will still there. : (