Skip to contentSkip to conversation

ipvs: fix synchronization on connection close

PATCH Applied Xiaotian Feng 3 participants 3 messages Dec 10, 2009 – Dec 14, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipvs: fix synchronization on connection close

commit 9d3a0de makes slaves expire as they would do on the master with much shorter timeouts. But it introduces another problem:
When we close a connection, on master server the connection became CLOSE_WAIT/TIME_WAIT, it was synced to slaves, but if master is finished within it's timeouts (CLOSE), it will not be synced to slaves. Then slaves will be kept on CLOSE_WAIT/TIME_WAIT until timeout reaches. Thus we should also sync with CLOSE.

Cc Wensong Zhang <[email protected]>
Cc Simon Horman <[email protected]>
Cc Julian Anastasov <[email protected]>
Cc David S. Miller <[email protected]>
---
 net/netfilter/ipvs/ip_vs_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/netfilter/ipvs/ip_vs_core.c +1 -0
index b95699f..847ffca 100644
@@ -1366,6 +1366,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb,
 	       == sysctl_ip_vs_sync_threshold[0])) ||
 	     ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) &&
 	      ((cp->state == IP_VS_TCP_S_FIN_WAIT) ||
+	       (cp->state == IP_VS_TCP_S_CLOSE) ||
 	       (cp->state == IP_VS_TCP_S_CLOSE_WAIT) ||
 	       (cp->state == IP_VS_TCP_S_TIME_WAIT)))))
 		ip_vs_sync_conn(cp);
Signature · 1 line
1.6.5.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Xiaotian Feng

commit 9d3a0de makes slaves expire as they would do on the master with much shorter timeouts. But it introduces another problem:
When we close a connection, on master server the connection became CLOSE_WAIT/TIME_WAIT, it was synced to slaves, but if master is finished within it's timeouts (CLOSE), it will not be synced to slaves. Then slaves will be kept on CLOSE_WAIT/TIME_WAIT until timeout reaches. Thus we should also sync with CLOSE.

Quoted 5 lines
Cc Wensong Zhang <[email protected]>
Cc Simon Horman <[email protected]>
Cc Julian Anastasov <[email protected]>
Cc David S. Miller <[email protected]>

This seems reasonable to me.

Quoted 23 lines
---
 net/netfilter/ipvs/ip_vs_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/netfilter/ipvs/ip_vs_core.c +1 -0
index b95699f..847ffca 100644
@@ -1366,6 +1366,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb,
 	       == sysctl_ip_vs_sync_threshold[0])) ||
 	     ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) &&
 	      ((cp->state == IP_VS_TCP_S_FIN_WAIT) ||
+	       (cp->state == IP_VS_TCP_S_CLOSE) ||
 	       (cp->state == IP_VS_TCP_S_CLOSE_WAIT) ||
 	       (cp->state == IP_VS_TCP_S_TIME_WAIT)))))
 		ip_vs_sync_conn(cp);
Signature · 6 lines
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 15 lines · Simon Horman
Quoted 8 lines · Xiaotian Feng

commit 9d3a0de makes slaves expire as they would do on the master with much shorter timeouts. But it introduces another problem:
When we close a connection, on master server the connection became CLOSE_WAIT/TIME_WAIT, it was synced to slaves, but if master is finished within it's timeouts (CLOSE), it will not be synced to slaves. Then slaves will be kept on CLOSE_WAIT/TIME_WAIT until timeout reaches. Thus we should also sync with CLOSE.

Quoted 5 lines
Cc Wensong Zhang <[email protected]>
Cc Simon Horman <[email protected]>
Cc Julian Anastasov <[email protected]>
Cc David S. Miller <[email protected]>
Quoted 3 lines

This seems reasonable to me.

Applied, thanks.