On Wed, Jan 6, 2010 at 11:16 PM, Lars Marowsky-Bree <[email protected]> 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?
>
> 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.
Yeah, using a file is to try to keep up the performance especially for
the scenario where there are the file-level shared storage. For the
sync_script, I originally wanted to just let it equal to "csync2 -xv".
The reason of I introduced $sync_script is that I have ever thought it
can give more choice to the user, if he likes, he can replace the
$sync_script with some _wrapper_ of rsync, like:
for i in membership_list; do
rsync the statefile to $i
done
Sure, using the wrapper of rsync is not as good as directly to call
csync2, and I also recommend the user to use csync2.
For now, I think maybe we give more choices to the user may make the
user more confused about what to do. So, can we agree on just using
"csync2 -xv"?
For using the OpenAIS CKPT to sync the TCP state file, in fact it was
in my _todo_ list as I said in previous mail, I have not implemented
it so far is because I'm also considering some other approaches which
have been kindly suggested, I don't know which approach I should go
ahead :)
But for this solution, I think it is simple, it works. So I posted
this patch for now :)
>
>> +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?
>
> How does this scale?
I have tested this with "iperf", about 500 connections in my PC,
"netstat -tn" will take less than 0.05s.
>
> Is there really no interface by which we can be notified when TCP
> connections get established and deleted?
>
> How is this done in Samba?
Samba is using "netstat -tn", in the first mail I have posted, I said
I quickly borrowed some code from Samba and integrate it into our
project. Thanks to the open source and GPL, I think that can be reused
for us, right?
Thanks,
Jiaju
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/