[SCM] CTDB repository - branch master updated - ctdb-1.0.89-20-g12e14a0

Ronnie Sahlberg sahlberg at samba.org
Tue Sep 8 20:51:11 MDT 2009


The branch, master has been updated
       via  12e14a09dd28ed005c8eb8fca7cd38a96aab938e (commit)
       via  e978b274a6af94ea7734675243ec65c5b17a583d (commit)
       via  f6cf586d8f6384e48215b7d2c20fb83e98504878 (commit)
       via  fb47cce86c0edae5caaf485f13ae7a151b6cb00d (commit)
       via  10ebeb215e7260186dab8f4f2403c48db9df9a00 (commit)
       via  cd65d8acb97aa9f83ff0d0585bf09caef2d2f3eb (commit)
       via  9bceef2b13fe9560ca02a266ce5a1fbbcef3af22 (commit)
       via  448cd8db1305c1e6dfab323f92eac4a576596e4e (commit)
       via  8ed4fa0eb09238952044645b72234185e498a40c (commit)
       via  49de8429d2a996dc055370541a12ea36762abe94 (commit)
       via  0e9c3e0cf76dd33a24241f02709e56bc330f009a (commit)
       via  abf4540bfb06de56b0a7b5976b5f1b2a24a8743d (commit)
       via  f9b71757f034732647228d4b8a8f00528028b6b0 (commit)
       via  c53353c6402f378f29200313d82f1f9262d628b1 (commit)
       via  878437a909ea44dfc3635f082e34741ee256e505 (commit)
       via  8fcc4610de926f44e18ec85fb57ca5f7d3c28bd6 (commit)
       via  b7787255391eddef8458f81ff9b75d9116e2afd3 (commit)
      from  affa6f47432507e84b7e76b88a2c27fff8e6e2e4 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 12e14a09dd28ed005c8eb8fca7cd38a96aab938e
Merge: affa6f47432507e84b7e76b88a2c27fff8e6e2e4 e978b274a6af94ea7734675243ec65c5b17a583d
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Sep 9 12:50:21 2009 +1000

    Merge commit 'martins/master'

commit e978b274a6af94ea7734675243ec65c5b17a583d
Merge: f6cf586d8f6384e48215b7d2c20fb83e98504878 8903b858ddd3a016d9cf765187839814443a67ca
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 9 12:48:40 2009 +1000

    Merge commit 'origin/master'

commit f6cf586d8f6384e48215b7d2c20fb83e98504878
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Sep 8 15:19:24 2009 +1000

    Document onnode "onnode any".
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit fb47cce86c0edae5caaf485f13ae7a151b6cb00d
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Sep 8 15:10:20 2009 +1000

    onnode: add "any" nodespec to select any node with running CTDB.
    
    In testing and other situations (e.g. eventscripts) it is necessary to
    select a node where a ctdb command can be run.  The whole idea here is
    to avoid nodes where ctdbd is not running and where most ctdb commands
    would fail.  This implements a standard way of doing this involving a
    recursive onnode command.
    
    There is still a small window for a race, where the selected node is
    suddenly shutdown, but this is unavoidable.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 10ebeb215e7260186dab8f4f2403c48db9df9a00
Merge: cd65d8acb97aa9f83ff0d0585bf09caef2d2f3eb f76132b0d555e52ee0a379ec2c156350b37b0280
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 7 15:29:34 2009 +1000

    Merge commit 'origin/master'

commit cd65d8acb97aa9f83ff0d0585bf09caef2d2f3eb
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 27 12:35:52 2009 +1000

    Test suite: fix minor typo in complex/32_cifs_tickle.sh
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 9bceef2b13fe9560ca02a266ce5a1fbbcef3af22
Merge: 448cd8db1305c1e6dfab323f92eac4a576596e4e 85590e9dfaab0db16ce8103e509fd4d51aef4ad5
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 27 12:33:43 2009 +1000

    Merge commit 'origin/master'

commit 448cd8db1305c1e6dfab323f92eac4a576596e4e
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 16 14:04:06 2009 +1000

    Test suite: Fix debug code for unexpectedly unhealthy cluster.
    
    The debug code should run "ctdb status" on a cluster node, not on the
    test client.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 8ed4fa0eb09238952044645b72234185e498a40c
Merge: 49de8429d2a996dc055370541a12ea36762abe94 fbfa1c72875dda4d1636d8e72c67ba09b10455df
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 17 13:08:42 2009 +1000

    Merge commit 'origin/master'

commit 49de8429d2a996dc055370541a12ea36762abe94
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 14 20:47:38 2009 +1000

    Test suite: ctdb_persistent.c needs to use transactions.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 0e9c3e0cf76dd33a24241f02709e56bc330f009a
Merge: abf4540bfb06de56b0a7b5976b5f1b2a24a8743d a42dbdb7b9ccf3ce2aed48aa33f1cd3af2e94fe3
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 12 08:48:03 2009 +1000

    Merge commit 'origin/master'

commit abf4540bfb06de56b0a7b5976b5f1b2a24a8743d
Merge: f9b71757f034732647228d4b8a8f00528028b6b0 32a69b0efa078b069802470be6488a4efe32961d
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jul 31 11:04:37 2009 +1000

    Merge commit 'origin/master'

commit f9b71757f034732647228d4b8a8f00528028b6b0
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 14:10:34 2009 +1000

    Test suite: Retrieval NFS_TICKLE_SHARED_DIRECTORY more defensively.
    
    In complex/31_nfs_tickle.sh we run sed against a file that might not
    exist, causing potential garbage from stderr in the output.  Check
    that the file exists before running sed.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit c53353c6402f378f29200313d82f1f9262d628b1
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 14:03:44 2009 +1000

    Test suite: Better diagnostics for recent change to complex/31_nfs_tickle.sh.
    
    Add a -v so we see the output of the command that tries to get the
    value of NFS_TICKLE_SHARED_DIRECTORY.  That way we can tell if a value
    was retrived OK or if we're using the default.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 878437a909ea44dfc3635f082e34741ee256e505
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 13:57:40 2009 +1000

    Test suite: complex/31_nfs_tickle.sh should use NFS_TICKLE_SHARED_DIRECTORY.
    
    Rather than hardcoding the location of the shared tickle directory,
    attempt to use the value of NFS_TICKLE_SHARED_DIRECTORY from
    /etc/sysconfig/nfs on node 0.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 8fcc4610de926f44e18ec85fb57ca5f7d3c28bd6
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 13:45:06 2009 +1000

    Test suite: Ask CTDB about CIFS tickles registered for the actual test node.
    
    This failed when node 0 had no public IPs because we would always run
    "ctdb gettickles" on node.  We now ask node 0 for the tickles on the
    test node.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit b7787255391eddef8458f81ff9b75d9116e2afd3
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 13:20:23 2009 +1000

    Test suite: Turn off strict host key checking in the SSH failover test.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 doc/onnode.1                              |  105 +++++++++++++++++++----------
 doc/onnode.1.html                         |   17 +++--
 doc/onnode.1.xml                          |    8 ++
 tests/complex/31_nfs_tickle.sh            |    8 ++-
 tests/complex/32_cifs_tickle.sh           |    2 +-
 tests/complex/42_failover_ssh_hostname.sh |    4 +-
 tests/scripts/ctdb_test_functions.bash    |    4 +-
 tests/src/ctdb_persistent.c               |   25 +++++--
 tools/onnode                              |   25 ++++++-
 9 files changed, 140 insertions(+), 58 deletions(-)


Changeset truncated at 500 lines:

diff --git a/doc/onnode.1 b/doc/onnode.1
index 99abd80..44b8aad 100644
--- a/doc/onnode.1
+++ b/doc/onnode.1
@@ -1,146 +1,177 @@
+'\" t
 .\"     Title: onnode
-.\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/12/2009
-.\"    Manual: 
-.\"    Source: 
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
+.\"      Date: 09/08/2009
+.\"    Manual: [FIXME: manual]
+.\"    Source: [FIXME: source]
+.\"  Language: English
 .\"
-.TH "ONNODE" "1" "05/12/2009" "" ""
+.TH "ONNODE" "1" "09/08/2009" "[FIXME: source]" "[FIXME: manual]"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 .SH "NAME"
-onnode - run commands on ctdb nodes
+onnode \- run commands on ctdb nodes
 .SH "SYNOPSIS"
-.HP 38
-\fBonnode [OPTION] \.\.\. NODES COMMAND \.\.\.\fR
+.HP \w'\fBonnode\ [OPTION]\ \&.\&.\&.\ NODES\ COMMAND\ \&.\&.\&.\fR\ 'u
+\fBonnode [OPTION] \&.\&.\&. NODES COMMAND \&.\&.\&.\fR
 .SH "DESCRIPTION"
 .PP
-onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\.
+onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\&.
 .PP
-The NODES option specifies which node to run a command on\. You can specify a numeric node number (from 0 to N\-1) or a descriptive node specification (see DESCRIPTIVE NODE SPECIFICATIONS below)\. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\. If nodes are specified multiple times then the command will be executed multiple times on those nodes\. The order of nodes is significant\.
+The NODES option specifies which node to run a command on\&. You can specify a numeric node number (from 0 to N\-1) or a descriptive node specification (see DESCRIPTIVE NODE SPECIFICATIONS below)\&. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\&. If nodes are specified multiple times then the command will be executed multiple times on those nodes\&. The order of nodes is significant\&.
 .PP
-The COMMAND can be any shell command\. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\.
+The COMMAND can be any shell command\&. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\&.
 .SH "DESCRIPTIVE NODE SPECIFICATIONS"
 .PP
 The following descriptive node specification can be used in place of numeric node numbers:
 .PP
 all
 .RS 4
-All nodes\.
+All nodes\&.
+.RE
+.PP
+any
+.RS 4
+A node where ctdbd is running\&. This semi\-random but there is a bias towards choosing a low numbered node\&.
 .RE
 .PP
 ok | healthy
 .RS 4
-All nodes that are not disconnected, banned, disabled or unhealthy\.
+All nodes that are not disconnected, banned, disabled or unhealthy\&.
 .RE
 .PP
 con | connected
 .RS 4
-All nodes that are not disconnected\.
+All nodes that are not disconnected\&.
 .RE
 .PP
 lvs | lvsmaster
 .RS 4
-The current LVS master\.
+The current LVS master\&.
 .RE
 .PP
 natgw | natgwlist
 .RS 4
-The current NAT gateway\.
+The current NAT gateway\&.
 .RE
 .PP
 rm | recmaster
 .RS 4
-The current recovery master\.
+The current recovery master\&.
 .RE
 .SH "OPTIONS"
 .PP
 \-c
 .RS 4
-Execute COMMAND in the current working directory on the specified nodes\.
+Execute COMMAND in the current working directory on the specified nodes\&.
 .RE
 .PP
 \-o <prefix>
 .RS 4
-Causes standard output from each node to be saved into a file with name <prefix>\.<ip>\.
+Causes standard output from each node to be saved into a file with name <prefix>\&.<ip>\&.
 .RE
 .PP
 \-p
 .RS 4
-Run COMMAND in parallel on the specified nodes\. The default is to run COMMAND sequentially on each node\.
+Run COMMAND in parallel on the specified nodes\&. The default is to run COMMAND sequentially on each node\&.
 .RE
 .PP
 \-q
 .RS 4
-Do not print node addresses\. Normally, onnode prints informational node addresses if more than one node is specified\. This overrides \-v\.
+Do not print node addresses\&. Normally, onnode prints informational node addresses if more than one node is specified\&. This overrides \-v\&.
 .RE
 .PP
 \-v
 .RS 4
-Print a node addresses even if only one node is specified\. Normally, onnode prints informational node addresses when more than one node is specified\.
+Print a node addresses even if only one node is specified\&. Normally, onnode prints informational node addresses when more than one node is specified\&.
 .RE
 .PP
 \-h, \-\-help
 .RS 4
-Show a short usage guide\.
+Show a short usage guide\&.
 .RE
 .SH "EXAMPLES"
 .PP
 The following command would show the process ID of ctdb on all nodes
 .sp
+.if n \{\
 .RS 4
+.\}
 .nf
       onnode all pidof ctdbd
     
 .fi
+.if n \{\
 .RE
+.\}
 .PP
 The following command would show the last 5 lines of log on each node, preceded by the node\'s hostname
 .sp
+.if n \{\
 .RS 4
+.\}
 .nf
-      onnode all "hostname; tail \-5 /var/log/log\.ctdb"
+      onnode all "hostname; tail \-5 /var/log/log\&.ctdb"
     
 .fi
+.if n \{\
 .RE
+.\}
 .PP
-The following command would restart the ctdb service on all nodes\.
+The following command would restart the ctdb service on all nodes\&.
 .sp
+.if n \{\
 .RS 4
+.\}
 .nf
       onnode all service ctdb restart
     
 .fi
+.if n \{\
 .RE
+.\}
 .PP
-The following command would run \./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\.
+The following command would run \&./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\&.
 .sp
+.if n \{\
 .RS 4
+.\}
 .nf
-      onnode \-c \-p 0,2\-4 \./foo
+      onnode \-c \-p 0,2\-4 \&./foo
     
 .fi
+.if n \{\
 .RE
+.\}
 .SH "FILES"
 .PP
 /etc/ctdb/nodes
 .RS 4
-Contains a list of each node\'s IP address or hostname\.
+Contains a list of each node\'s IP address or hostname\&.
 .RE
 .PP
-/etc/ctdb/onnode\.conf
+/etc/ctdb/onnode\&.conf
 .RS 4
-If this file exists it is sourced by onnode\. The main purpose is to allow the administrator to set $SSH to something other than "ssh"\. In this case the \-t option is ignored\. For example, the administrator may choose to use use rsh instead of ssh\.
+If this file exists it is sourced by onnode\&. The main purpose is to allow the administrator to set $SSH to something other than "ssh"\&. In this case the \-t option is ignored\&. For example, the administrator may choose to use use rsh instead of ssh\&.
 .RE
 .SH "SEE ALSO"
 .PP
 ctdbd(1), ctdb(1),
-\fI\%http://ctdb.samba.org/\fR
+\m[blue]\fB\%http://ctdb.samba.org/\fR\m[]
 .SH "COPYRIGHT/LICENSE"
 .sp
+.if n \{\
 .RS 4
+.\}
 .nf
 Copyright (C) Andrew Tridgell 2007
 Copyright (C) Ronnie sahlberg 2007
@@ -149,14 +180,16 @@ Copyright (C) Martin Schwenke 2008
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or (at
-your option) any later version\.
+your option) any later version\&.
 
 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\.  See the GNU
-General Public License for more details\.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&.  See the GNU
+General Public License for more details\&.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, see http://www\.gnu\.org/licenses/\.
+along with this program; if not, see http://www\&.gnu\&.org/licenses/\&.
 .fi
+.if n \{\
 .RE
+.\}
diff --git a/doc/onnode.1.html b/doc/onnode.1.html
index 03d4055..c662d7c 100644
--- a/doc/onnode.1.html
+++ b/doc/onnode.1.html
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode &#8212; run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2477311"></a><h2>DESCRIPTION</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" title="onnode"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode &#8212; run commands on ctdb nodes</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" title="DESCRIPTION"><a name="id2998330"></a><h2>DESCRIPTION</h2><p>
       onnode is a utility to run commands on a specific node of a CTDB
       cluster, or on all nodes.
     </p><p>
@@ -13,11 +13,14 @@
     </p><p>
       The COMMAND can be any shell command. The onnode utility uses
       ssh or rsh to connect to the remote nodes and run the command.
-    </p></div><div class="refsect1" lang="en"><a name="id2478322"></a><h2>DESCRIPTIVE NODE SPECIFICATIONS</h2><p>
+    </p></div><div class="refsect1" title="DESCRIPTIVE NODE SPECIFICATIONS"><a name="id2998358"></a><h2>DESCRIPTIVE NODE SPECIFICATIONS</h2><p>
       The following descriptive node specification can be used in
       place of numeric node numbers:
     </p><div class="variablelist"><dl><dt><span class="term">all</span></dt><dd><p>
             All nodes.
+	  </p></dd><dt><span class="term">any</span></dt><dd><p>
+             A node where ctdbd is running.  This semi-random but
+             there is a bias towards choosing a low numbered node.
 	  </p></dd><dt><span class="term">ok | healthy</span></dt><dd><p>
             All nodes that are not disconnected, banned, disabled or
             unhealthy.
@@ -29,7 +32,7 @@
             The current NAT gateway.
 	  </p></dd><dt><span class="term">rm | recmaster</span></dt><dd><p>
             The current recovery master.
-	  </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479544"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
+	  </p></dd></dl></div></div><div class="refsect1" title="OPTIONS"><a name="id2997827"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
             Execute COMMAND in the current working directory on the
             specified nodes.
 	  </p></dd><dt><span class="term">-o &lt;prefix&gt;</span></dt><dd><p>
@@ -48,7 +51,7 @@
             more than one node is specified.
 	  </p></dd><dt><span class="term">-h, --help</span></dt><dd><p>
             Show a short usage guide.
-	  </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479637"></a><h2>EXAMPLES</h2><p>
+	  </p></dd></dl></div></div><div class="refsect1" title="EXAMPLES"><a name="id2997920"></a><h2>EXAMPLES</h2><p>
       The following command would show the process ID of ctdb on all nodes
     </p><pre class="screen">
       onnode all pidof ctdbd
@@ -66,7 +69,7 @@
       directory, in parallel, on nodes 0, 2, 3 and 4.
     </p><pre class="screen">
       onnode -c -p 0,2-4 ./foo
-    </pre></div><div class="refsect1" lang="en"><a name="id2479688"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
+    </pre></div><div class="refsect1" title="FILES"><a name="id2997971"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
             Contains a list of each node's IP address or hostname.
 	  </p></dd><dt><span class="term">/etc/ctdb/onnode.conf</span></dt><dd><p>
             If this file exists it is sourced by onnode.  The main
@@ -74,9 +77,9 @@
             something other than "ssh".  In this case the -t option is
             ignored.  For example, the administrator may choose to use
             use rsh instead of ssh.
-	  </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2479727"></a><h2>SEE ALSO</h2><p>
+	  </p></dd></dl></div></div><div class="refsect1" title="SEE ALSO"><a name="id2998010"></a><h2>SEE ALSO</h2><p>
       ctdbd(1), ctdb(1), <a class="ulink" href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
-    </p></div><div class="refsect1" lang="en"><a name="id2479739"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
+    </p></div><div class="refsect1" title="COPYRIGHT/LICENSE"><a name="id2998022"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
 Copyright (C) Andrew Tridgell 2007<br>
 Copyright (C) Ronnie sahlberg 2007<br>
 Copyright (C) Martin Schwenke 2008<br>
diff --git a/doc/onnode.1.xml b/doc/onnode.1.xml
index 8710d36..d3f6bf4 100644
--- a/doc/onnode.1.xml
+++ b/doc/onnode.1.xml
@@ -55,6 +55,14 @@
 	  </para>
         </listitem>
       </varlistentry>
+      <varlistentry><term>any</term>
+        <listitem>
+          <para>
+             A node where ctdbd is running.  This semi-random but
+             there is a bias towards choosing a low numbered node.
+	  </para>
+        </listitem>
+      </varlistentry>
       <varlistentry><term>ok | healthy</term>
         <listitem>
           <para>
diff --git a/tests/complex/31_nfs_tickle.sh b/tests/complex/31_nfs_tickle.sh
index 45734cc..219fc0e 100755
--- a/tests/complex/31_nfs_tickle.sh
+++ b/tests/complex/31_nfs_tickle.sh
@@ -74,10 +74,16 @@ echo "Source socket is $src_socket"
 echo "Sleeping for MonitorInterval..."
 sleep_for $monitor_interval
 
+echo "Trying to determine NFS_TICKLE_SHARED_DIRECTORY..."
+f="/etc/sysconfig/nfs"
+try_command_on_node -v 0 "[ -r $f ] &&  sed -n -e s@^NFS_TICKLE_SHARED_DIRECTORY=@@p $f" || true
+
+nfs_tickle_shared_directory="${out:-/gpfs/.ctdb/nfs-tickles}"
+
 try_command_on_node $test_node hostname
 test_hostname=$out
 
-try_command_on_node -v 0 cat /gpfs/.ctdb/nfs-tickles/$test_hostname/$test_ip
+try_command_on_node -v 0 cat "${nfs_tickle_shared_directory}/$test_hostname/$test_ip"
 
 if [ "${out/${src_socket}/}" != "$out" ] ; then
     echo "GOOD: NFS connection tracked OK in tickles file."
diff --git a/tests/complex/32_cifs_tickle.sh b/tests/complex/32_cifs_tickle.sh
index 94b2861..4ce74f9 100755
--- a/tests/complex/32_cifs_tickle.sh
+++ b/tests/complex/32_cifs_tickle.sh
@@ -74,7 +74,7 @@ echo "Source socket is $src_socket"
 # CTDB faster than it takes us to wait for netstat to register the
 # connection and then use onnode below to ask CTDB about it.
 
-try_command_on_node -v 0 ctdb gettickles $test_ip
+try_command_on_node -v 0 ctdb gettickles $test_ip -n $test_node
 
 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
     echo "GOOD: CIFS connection tracked OK by CTDB."
diff --git a/tests/complex/42_failover_ssh_hostname.sh b/tests/complex/42_failover_ssh_hostname.sh
index 1965248..4b3ed88 100755
--- a/tests/complex/42_failover_ssh_hostname.sh
+++ b/tests/complex/42_failover_ssh_hostname.sh
@@ -51,7 +51,7 @@ echo "Removing ${test_ip} from the local ARP table..."
 arp -d $test_ip >/dev/null 2>&1 || true
 
 echo "SSHing to ${test_ip} and running hostname..."
-original_hostname=$(ssh $test_ip hostname)
+original_hostname=$(ssh -o "StrictHostKeyChecking no" $test_ip hostname)
 [ $? -eq 0 ]
 
 echo "Hostname is: ${original_hostname}"
@@ -65,7 +65,7 @@ onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
 gratarp_sniff_wait_show
 
 echo "SSHing to ${test_ip} and running hostname (again)..."
-new_hostname=$(ssh $test_ip hostname)
+new_hostname=$(ssh -o "StrictHostKeyChecking no" $test_ip hostname)
 [ $? -eq 0 ]
 
 echo "Hostname is: ${new_hostname}"
diff --git a/tests/scripts/ctdb_test_functions.bash b/tests/scripts/ctdb_test_functions.bash
index 38324d7..8fd6141 100644
--- a/tests/scripts/ctdb_test_functions.bash
+++ b/tests/scripts/ctdb_test_functions.bash
@@ -342,7 +342,7 @@ cluster_is_healthy ()
 	if ! ${ctdb_test_restart_scheduled:-false} ; then
 	    echo "DEBUG:"
 	    local i
-	    for i in "ctdb status" "onnode -q 0 onnode all ctdb scriptstatus" ; do
+	    for i in "onnode -q 0 ctdb status" "onnode -q 0 onnode all ctdb scriptstatus" ; do
 		echo "$i"
 		$i || true
 	    done
@@ -529,7 +529,7 @@ tcpdump_wait ()
     if ! wait_until 30 tcpdump_check ; then
 	echo "DEBUG:"
 	local i
-	for i in "ctdb status" "netstat -tanp" "tcpdump -n -e -r $tcpdump_filename" ; do
+	for i in "onnode -q 0 ctdb status" "netstat -tanp" "tcpdump -n -e -r $tcpdump_filename" ; do
 	    echo "$i"
 	    $i || true
 	done
diff --git a/tests/src/ctdb_persistent.c b/tests/src/ctdb_persistent.c
index 2401255..8110ce1 100644
--- a/tests/src/ctdb_persistent.c
+++ b/tests/src/ctdb_persistent.c
@@ -116,21 +116,27 @@ static void test_store_records(struct ctdb_context *ctdb, struct event_context *
 	while (end_timer() < timelimit) {
 		TDB_DATA data;
 		TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
-		struct ctdb_record_handle *h;
+		struct ctdb_transaction_handle *h;
 		int ret;
 		uint32_t *counters;
 
-		h = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, &data);
+		h = ctdb_transaction_start(ctdb_db, tmp_ctx);
 		if (h == NULL) {
-			printf("Failed to fetch record '%s' on node %d\n", 
-			       (const char *)key.dptr, ctdb_get_pnn(ctdb));
+			printf("Failed to start transaction on node %d\n",
+			       ctdb_get_pnn(ctdb));
 			talloc_free(tmp_ctx);
 			return;
 		}
 
+		ret = ctdb_transaction_fetch(h, tmp_ctx, key, &data);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,("Failed to fetch record\n"));
+			exit(1);
+		}
+
 		if (data.dsize < sizeof(uint32_t) * (pnn+1)) {
 			unsigned char *ptr = data.dptr;
-
+			
 			data.dptr = talloc_zero_size(tmp_ctx, sizeof(uint32_t) * (pnn+1));
 			memcpy(data.dptr, ptr, data.dsize);
 			talloc_free(ptr);
@@ -149,18 +155,23 @@ static void test_store_records(struct ctdb_context *ctdb, struct event_context *
 		/* bump our counter */
 		counters[pnn]++;
 
-		ret = ctdb_record_store(h, data);
+		ret = ctdb_transaction_store(h, key, data);
 		if (ret != 0) {
 			DEBUG(DEBUG_ERR,("Failed to store record\n"));
 			exit(1);
 		}
 
+		ret = ctdb_transaction_commit(h);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,("Failed to commit transaction\n"));
+			exit(1);
+		}
+
 		/* store the counters and verify that they are sane */
 		if (pnn == 0) {
 			check_counters(ctdb, data);
 		}
 
-		talloc_free(h);
 		talloc_free(tmp_ctx);
 	}
 
diff --git a/tools/onnode b/tools/onnode
index e00cd2b..79623a4 100755
--- a/tools/onnode
+++ b/tools/onnode
@@ -35,7 +35,7 @@ Usage: onnode [OPTION] ... <NODES> <COMMAND> ...
     -p          Run command in parallel on specified nodes.
     -q          Do not print node addresses (overrides -v).
     -v          Print node address even for a single node.
-  <NODES>       "all", "ok" (or "healthy"), "con" (or "connected"),
+  <NODES>       "all", "any", "ok" (or "healthy"), "con" (or "connected"),
                 "rm" (or "recmaster"), "lvs" (or "lvsmaster"),
                 "natgw" (or "natgwlist");
                 or a node number (0 base); or
@@ -112,7 +112,7 @@ parse_nodespec ()
 	    case "$i" in
 		*-*) seq "${i%-*}" "${i#*-}" 2>/dev/null || invalid_nodespec ;;
 		# Separate lines for readability.
-		all|ok|healthy|con|connected) echo "$i" ;;
+		all|any|ok|healthy|con|connected) echo "$i" ;;
 		rm|recmaster|lvs|lvsmaster|natgw|natgwlist) echo "$i" ;;
 		*)
 		    [ $i -gt -1 ] 2>/dev/null || invalid_nodespec
@@ -198,6 +198,24 @@ get_node_with_property ()
     fi
 }
 
+get_any_available_node ()
+{
+    local all_nodes="$1"
+
+    # We do a recursive onnode to find which nodes are up and running.
+    local out=$($0 -pq all ctdb pnn 2>&1)
+    local line
+    while read line ; do 
+	local pnn="${line#PNN:}"
+	if [ "$pnn" != "$line" ] ; then
+	    echo_nth "$pnn" $all_nodes
+	    return 0
+	fi


-- 
CTDB repository


More information about the samba-cvs mailing list