ctdb-scripts: Optimise update_tickles()
authorMartin Schwenke <martin@meltin.net>
Mon, 23 Mar 2015 08:37:35 +0000 (19:37 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 8 Sep 2016 04:57:21 +0000 (06:57 +0200)
Use addtickle and deltickle with stdin.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index a29daf58f6e6889d66cf453211599a6906fe25a4..d5443f5767abd2f0e743d23a90c066e62df7d2dc 100755 (executable)
@@ -1276,16 +1276,12 @@ update_tickles ()
        sort >"$_my_tickles"
 
        # Add tickles for connections that we haven't already got tickles for
-       comm -23 "$_my_connections" "$_my_tickles" |
-       while read _src _dst ; do
-               $CTDB addtickle "$_src" "$_dst"
-       done
+       comm -23 "$_my_connections" "$_my_tickles" | \
+               $CTDB addtickle
 
        # Remove tickles for connections that are no longer there
-       comm -13 "$_my_connections" "$_my_tickles" |
-       while read _src _dst ; do
-               $CTDB deltickle "$_src" "$_dst"
-       done
+       comm -13 "$_my_connections" "$_my_tickles" | \
+               $CTDB deltickle
 
        rm -f "$_my_connections" "$_my_tickles"