On Tue, Dec 22, 2009 at 07:01:54PM +1100, Simon Horman wrote:
> On Tue, Dec 22, 2009 at 12:43:09AM +0800, Jiaju Zhang wrote:
I'd add the "borrowed from ctdb.samba.org" (attribution,
and hint for further maintenance, in case they improve upon
their code...) and a onliner "this is GPL"
to the source code, to make it explicit.
I see that the tickle_ack binary supports ipv6,
yet:
> [snip]
>
> > +save_tcp_connections() {
> > + mydir=$OCF_RESKEY_tickle_dir/`hostname`
> > + rm -f $mydir/*
> > + netstat -tn |egrep
> > '^tcp[[:space:]]+[0-9]+[[:space:]]+[0-9]+[[:space:]]+[0-9\.]+:[0-9]+.*ESTABLISHED'
> > |
... you specifically grep only for tcp (ipv4).
which is correct, since netstat in general truncates ipv6 addresses in
its output, see e.g. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=254243
so maybe add the -W option, if supported by the respective netstat in use,
and also grep for tcp6 ?
> > + awk '{print $4" "$5}' |
> > + while read server client; do
> > + ip=${server%:*}
> > + echo $client $server >> $mydir/$ip
> > + done
> > +}
>
>
> Can the filtering being done be egrep be rolled into the awk script?
It sure can, but it would not necessarily be faster.
> > +
> > +run_tickle_tcp() {
> > + for f in $OCF_RESKEY_tickle_dir/*/$OCF_RESKEY_ip; do
> > + [ -f $f ] && cat $f | while read client server; do
> > + for i in `seq 1 3`; do
> > + $TICKLETCP $client $server
> > + done
> > + done
> > + done
> > +}
> > +
>
> Would it be worth allowing $TICKLETCP to tickle multiple connections
> in a single invocation - for instance by reading $client $server from stdin?
> I'm concerned about a situation where there are lots of connections,
> it might take a while to spawn $TICKLETCP lots of times.
Yes please.
That would be a very important improvement.
Thank you for stepping forward!
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/