[Samba] ctdb tcp settings for statd failover

Martin Schwenke martin at meltin.net
Wed Oct 16 02:19:20 UTC 2024


Hi Ulrich,

On Tue, 15 Oct 2024 15:22:51 +0000, Ulrich Sibiller via samba
<samba at lists.samba.org> wrote:

> In current (6140c3177a0330f42411618c3fca28930ea02a21) samba's
> ctdb/tools/statd_callout_helper I find this comment:
> 
> notify)
> ...
>         # we need these settings to make sure that no tcp connections
> survive # across a very fast failover/failback
>         #echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
>         #echo 0 > /proc/sys/net/ipv4/tcp_max_tw_buckets
>         #echo 0 > /proc/sys/net/ipv4/tcp_max_orphans
> 
> 
> The comment is also present in the statd-callout shell script used in
> previous versions (like the one included in RHEL8, 4.18.6) - and it
> is commented everywhere.
> 
> I have never seen these settings in any of the ctdb guides that I
> know of. 
> 
> So I am wondering about the correct setup. Should these values be set
> system wide? Should they be set at all? Are they still required with
> the current code base or kernels?

I have been blissfully ignoring these line for many years, while working
on the code around them.  I have certainly never set them in a product.

Let's look at why they were commented out...

commit caad5dc38d790d76f6720b312c1557ec3151a084
Author: Ronnie Sahlberg <sahlberg at ronnie>
Date:   Sun Oct 21 06:42:33 2007 +1000

    dont set some of the sysctl variables in statd-callout.    these are
    mainly useful for avoiding ack-storms when doing very rapid
    failover/failback during testing   but should not be required in
    real-world.
    
    this gets rid of a lof of annoying messages from the messages file
    
    (This used to be ctdb commit 50d289dcce2caa7c7be9b6faa3b38b69c2237038)

diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout
index f582a1a8e02..7709df411b0 100755
--- a/ctdb/config/statd-callout
+++ b/ctdb/config/statd-callout
@@ -50,9 +50,9 @@ case "$1" in
 
        # we need these settings to make sure that no tcp connections survive
        # across a very fast failover/failback
-       echo 0 > /proc/sys/net/ipv4/tcp_max_tw_buckets
-       echo 0 > /proc/sys/net/ipv4/tcp_fin_timeout
-       echo 0 > /proc/sys/net/ipv4/tcp_max_orphans
+       echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
+       #echo 0 > /proc/sys/net/ipv4/tcp_max_tw_buckets
+       #echo 0 > /proc/sys/net/ipv4/tcp_max_orphans
 
        # rebuild the state directory for the local statd to use the correct
        # state value and to initally send notifications to all clients

commit f022df1d40c9c1e3e528f178204f404ee395d5c2
Author: Ronnie Sahlberg <sahlberg at ronnie>
Date:   Mon Oct 22 10:18:38 2007 +1000

    dont set parameters in statd-callout     if they should be set they
    bshould be set from 10.interfaces
    
    (This used to be ctdb commit 0c7c2dae0a976922de58793d576855bc37cd38e1)

diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout
index 7709df411b0..b00aeba7a2d 100755
--- a/ctdb/config/statd-callout
+++ b/ctdb/config/statd-callout
@@ -50,7 +50,7 @@ case "$1" in
 
        # we need these settings to make sure that no tcp connections survive
        # across a very fast failover/failback
-       echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
+       #echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
        #echo 0 > /proc/sys/net/ipv4/tcp_max_tw_buckets
        #echo 0 > /proc/sys/net/ipv4/tcp_max_orphans


I'll try to give these lines a 17th birthday present by removing them.
The 2nd commit message is useful because it seems to make it clear that
if these are needed then they are not specific to statd.

I have some more statd_callout/statd_callout_helper changes in my
queue.  I have added this to that queue, along with a Reported-by: tag
acknowledging you - I hope that's OK.

Thanks for finally making me understand these so I can remove them...
:-)

peace & happiness,
martin



More information about the samba mailing list