Hi,

On Wed, Jan 06, 2010 at 04:16:43PM +0100, Lars Marowsky-Bree wrote:
> On 2010-01-06T15:21:53, Jiaju Zhang <[email protected]> wrote:
> 
> > I have done some testing to the patch, it works as expected. So I
> > regenerate this patch based on the current tip of resource agents
> > repository. Attched is the "hg export" of it.
> 
> Good job! Let's get this polished soon!
> 
> Some feedback:
> 
> > +<parameter name="tickle_dir" unique="0" required="0">
> > +<longdesc lang="en">
> > +The shared directory which stores the established TCP connections.
> > +</longdesc>
> > +<shortdesc lang="en">Tickle directory</shortdesc>
> > +<content type="string" default="" />
> > +</parameter>
> > +
> > +<parameter name="sync_script" unique="0" required="0">
> > +<longdesc lang="en">
> > +The script used for synchronizing TCP connection state file, such as 
> > +csync2, some wrapper of rsync, or whatever.
> > +</longdesc>
> > +<shortdesc lang="en">File sync script</shortdesc>
> > +<content type="string" default="" />
> > +</parameter>
> 
> I'm just wondering; the original idea was to use OpenAIS CKPT
> segments or something similar to synchronize the connection state across
> nodes, why was this abandoned in favor of a file-based solution?

AFAIK not abandoned, but this is what is ready now.

> That said, I'm fine with using a file if it keeps up the performance.
> But the sync_script - we definitely don't want to be calling an external
> script, I guess. csync2 would be automatic anyway.

The script (or program) is invoked once in a while on monitor,
shouldn't be a performance issue.

> > +save_tcp_connections()
> > +{
> > +   [ -z "$OCF_RESKEY_tickle_dir" ] && return
> > +   statefile=$OCF_RESKEY_tickle_dir/$OCF_RESKEY_ip
> > +   netstat -tn |egrep '^tcp.*ESTABLISHED' |awk '{print $4" "$5}' |
> > +           while read server client; do
> > +                   ipaddr=${server%:*}
> > +                   [ "$ipaddr" == "$OCF_RESKEY_ip" ] && echo $server 
> > $client
> > +           done |
> > +           dd of="$statefile".new conv=fsync && mv "$statefile".new 
> > "$statefile"
> > +   [ -n "$OCF_RESKEY_sync_script" ] && $OCF_RESKEY_sync_script $statefile
> > +}
> > +
> > +run_tickle_tcp()
> > +{
> > +   [ -z "$OCF_RESKEY_tickle_dir" ] && return
> > +   echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
> > +   f=$OCF_RESKEY_tickle_dir/$OCF_RESKEY_ip
> > +   [ -f $f ] && cat $f | $TICKLETCP -n 3
> >  }
> 
> Oh. This is quite costly, is it not? Scanning the full TCP connection
> table and regenerating the whole lease-file?

Looking again at it, egrep and while loop could be replaced by a
perl/awk/python snippet. Then it should be fast enough.

> How does this scale?
> 
> Is there really no interface by which we can be notified when TCP
> connections get established and deleted?

In that case we need a daemon to take care of the connection
table. That would obviously be a more elegant solution, but I'm
really not sure if it's absolutely needed. This machinery seems
good enough to me. At least let's first see how it behaves in
some busy environment.

Cheers,

Dejan

> How is this done in Samba?
> 
> 
> Regards,
>     Lars
> 
> -- 
> Architect Storage/HA, OPS Engineering, Novell, Inc.
> SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
> "Experience is the name everyone gives to their mistakes." -- Oscar Wilde
> 
> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to