Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived的vip检查似乎有问题 #631

Open
silveric10 opened this issue Aug 12, 2020 · 5 comments
Open

keepalived的vip检查似乎有问题 #631

silveric10 opened this issue Aug 12, 2020 · 5 comments
Assignees
Labels
issue/reproduced the bug report in the issue is reproduced, need to solve issue/to-reproduce issues to be reproduced and verified

Comments

@silveric10
Copy link

silveric10 commented Aug 12, 2020

tools/keepalived/keepliaved/check/ipvswrapper.c
这个接口

static void
update_vsge_alive_count(virtual_server_group_entry_t *vsge, const virtual_server_t *vs, bool up)
{
	unsigned *alive_p;

	if (vsge->is_fwmark) {
		if (vs->af == AF_INET)
			alive_p = &vsge->fwm4_alive;
		else
			alive_p = &vsge->fwm6_alive;
	}
	else if (vs->service_type == IPPROTO_TCP)
		alive_p = &vsge->tcp_alive;
	else if (vs->service_type == IPPROTO_UDP)
		alive_p = &vsge->udp_alive;
	else
		alive_p = &vsge->sctp_alive;

	if (up)
		(*alive_p)++;
	else
               (*alive_p)--; // 这个值可能本身已经是0了,再去做--导致溢出,后面的clear diff vip的检查就会失败,导致已失效的vip没有成功清除掉
}
@ywc689
Copy link
Collaborator

ywc689 commented Aug 14, 2020

可否给一个能够复现这个问题的配置实例?

@silveric10
Copy link
Author

比如定义一个
virtual_server_group vip_group_1_80 {
1.1.1.1 80
}
之后修改keepalived.conf 将这个vip group修改成
virtual_server_group vip_group_1_80 {
2.2.2.2 80
}

然后 “kill -s 1 $(cat /var/run/keepalived.pid)”
一般都能复现,通过./ipvsadm -ln 可以看到 1.1.1.1还在,但是telnet确实是发现已经停止服务了

@ywc689 ywc689 added the issue/to-reproduce issues to be reproduced and verified label Aug 24, 2020
@azura27
Copy link
Collaborator

azura27 commented Aug 25, 2020

@silveric10 Hi,想请问一下你们的VIP ,dpip addr是通过什么方式添加的,quorum_up/down 里面配置的是dpip addr add/del命令,还是脚本,如果是脚本,那是否传VIP参数呢?

@silveric10
Copy link
Author

@silveric10 Hi,想请问一下你们的VIP ,dpip addr是通过什么方式添加的,quorum_up/down 里面配置的是dpip addr add/del命令,还是脚本,如果是脚本,那是否传VIP参数呢?

你好,我们的配置都是通过脚本手动配的,在dpvs起来之后一次性配置进去,包括VIP和local ip. Keepalived.conf配置文件里面没有用到quorum

@azura27 azura27 added the issue/reproduced the bug report in the issue is reproduced, need to solve label Aug 25, 2020
@ywc689
Copy link
Collaborator

ywc689 commented Jan 5, 2022

我用你提供的测试用例在 DPVS v1.9.0 上没有复现这个问题。对比了 keepalived v2.0.9 的原始代码,DPVS keeplived
没有修改 update_vsge_alive_count 这个接口。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/reproduced the bug report in the issue is reproduced, need to solve issue/to-reproduce issues to be reproduced and verified
Projects
None yet
Development

No branches or pull requests

3 participants