[SCM] CTDB repository - branch master updated - ctdb-2.0-5-g54e24a1

2012-11-18 Thread Amitay Isaacs
The branch, master has been updated
   via  54e24a151d2163954e5a2a1c0f41a2b5c19ae44b (commit)
   via  718233c445cd6627ab3962b6565c2655f1f8efd0 (commit)
   via  a5c6bb1fffb8dc3960af113957a1fd080cc7c245 (commit)
  from  f243a916ee71013f7402b9c396c2ead88eb3aab0 (commit)

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


- Log -
commit 54e24a151d2163954e5a2a1c0f41a2b5c19ae44b
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Nov 14 15:51:59 2012 +1100

locking: Do not use RECLOCK for tracking DB locks and latencies

RECLOCK is for recovery lock in CTDB. Do not override the meaning for
tracking locks on databases.  Database lock latency has nothing to do
with recovery lock latency.

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 718233c445cd6627ab3962b6565c2655f1f8efd0
Author: Amitay Isaacs ami...@gmail.com
Date:   Tue Nov 6 17:06:54 2012 +1100

tools/ctdb: Do not use function return value as pnn

This fixes the wrong code where same variable 'ret' is used to track the pnn
and the return value of a function call.

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit a5c6bb1fffb8dc3960af113957a1fd080cc7c245
Author: Amitay Isaacs ami...@gmail.com
Date:   Tue Oct 23 16:23:12 2012 +1100

recoverd: Track the nodes that fail takeover run and set culprit count

If any of the nodes fail takeover run (either due to timeout or failure
to complete within takeover_timeout interval) from main loop, recovery
master will give up trying takeover run with following message:

  Unable to setup public takeover addresses. Try again later

And as a side-effect the monitoring is disabled on all the nodes. Before
ctdb_takeover_run() is called from main loop, monitoring get disabled via
startrecovery event. Since ctdb_takeover_run() fails, it never runs
recovered event and monitoring does not get re-enabled.

In main_loop, ctdb_takeover_run() is called with a takeover_fail_callback.
This callback will get called if any of the nodes fail in handling
takeip/releaseip/ipreallocated events in ctdb_takeover_run().

Signed-off-by: Amitay Isaacs ami...@gmail.com

---

Summary of changes:
 include/ctdb_private.h |   14 +++---
 server/ctdb_lock.c |   10 --
 server/ctdb_recoverd.c |   34 +-
 server/ctdb_takeover.c |   14 +++---
 tools/ctdb.c   |8 +---
 5 files changed, 60 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 2da9c50..f06a1f1 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -365,7 +365,7 @@ struct ctdb_daemon_data {
}   
\
}
 
-#define CTDB_UPDATE_DB_RECLOCK_LATENCY(ctdb_db, name, counter, value) \
+#define CTDB_UPDATE_DB_LATENCY(ctdb_db, operation, counter, value) 
\
{   
\
if (value  ctdb_db-statistics.counter.max)
\
ctdb_db-statistics.counter.max = value;
\
@@ -377,10 +377,10 @@ struct ctdb_daemon_data {
ctdb_db-statistics.counter.num++;  
\

\
if (ctdb_db-ctdb-tunable.reclock_latency_ms != 0) {   
\
-   if (value*1000  
ctdb_db-ctdb-tunable.reclock_latency_ms) {   \
+   if (value*1000  ctdb_db-ctdb-tunable.log_latency_ms) 
{   \
DEBUG(DEBUG_ERR,
\
- (High RECLOCK latency %fs for operation 
%s\n,   \
-  value, name));   
\
+ (High latency %.6fs for operation %s on 
database %s\n,\
+  value, operation, ctdb_db-db_name));
\
}   
\
}   
\
}
@@ -1195,6 +1195,8 @@ char *ctdb_get_process_name(pid_t pid);
 bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info);
 bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid);
 
+typedef void (*client_async_callback)(struct ctdb_context *ctdb, uint32_t 
node_pnn, int32_t res, TDB_DATA outdata, void *callback_data);
+
 int ctdb_set_public_addresses(struct ctdb_context *ctdb, 

[SCM] CTDB repository - branch master updated - ctdb-2.0-7-gd8f0103

2012-11-18 Thread Amitay Isaacs
The branch, master has been updated
   via  d8f010355b715e49709836e057a5d0f110919897 (commit)
   via  9275a69a414482f1053ae14528d5972575b9214e (commit)
  from  54e24a151d2163954e5a2a1c0f41a2b5c19ae44b (commit)

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


- Log -
commit d8f010355b715e49709836e057a5d0f110919897
Author: Martin Schwenke mar...@meltin.net
Date:   Fri Nov 16 20:21:15 2012 +1100

Eventscripts: 10.interface should list configured interfaces

The current code lists available interfaces.  If IPs are configured in
some other way than the public addresses file (e.g. ctdb addip) and their
interfaces default to being marked down then, since down interfaces are
not available, these interfaces can never be marked up.

The configured interfaces should be listed instead.

Signed-off-by: Martin Schwenke mar...@meltin.net

commit 9275a69a414482f1053ae14528d5972575b9214e
Author: Martin Schwenke mar...@meltin.net
Date:   Fri Nov 16 19:43:14 2012 +1100

ctdbd: Make the link status of new interfaces more flexible

Neither up nor down is a good default value for the link status of a
new interface.  Up means that IPs can be assigned to interfaces before
the true state is known and they can move away quickly if the interface
is actually down.  Down means that IPs can't be assigned to an interface
for a variable amount of time - until a monitor cycle occurs - and this
can result in imbalanced IPs.

This is a neat compromise.  Before the startup event completes, IPs
can't be assigned to interfaces because all interfaces begin in a down
state.  As soon as the startup event completes, IPs can be allocated
to any interface that has been marked up by the eventscript.  Later,
during normal operation, newly added IPs can be assigned to new
interfaces immediately.  The IPs will still move away if an interface
is noticed to be down in the next monitor cycle, but that is the
exception rather than the rule.

Signed-off-by: Martin Schwenke mar...@meltin.net

---

Summary of changes:
 config/events.d/10.interface |6 +++---
 server/ctdb_takeover.c   |   15 ++-
 2 files changed, 17 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/10.interface b/config/events.d/10.interface
index 80b1368..7a85892 100755
--- a/config/events.d/10.interface
+++ b/config/events.d/10.interface
@@ -41,9 +41,9 @@ get_all_interfaces ()
 [ $CTDB_PUBLIC_INTERFACE ]  all_interfaces=$CTDB_PUBLIC_INTERFACE 
$all_interfaces
 [ $CTDB_NATGW_PUBLIC_IFACE ]  all_interfaces=$CTDB_NATGW_PUBLIC_IFACE 
$all_interfaces
 
-# For all but the 1st line, get the 2nd last field with commas
-# changes to spaces.
-ctdb_ifaces=$(ctdb -Y ip -v | sed -e '1d' -e 's/:[^:]*:$//' -e 's/^.*://' 
-e 's/,/ /g')
+# Get the configured interfaces for each IP.  That is, for all but
+# the 1st line, get the last field with commas changed to spaces.
+ctdb_ifaces=$(ctdb -Y ip -v | sed -e '1d' -e 's/:$//' -e 's/^.*://' -e 
's/,/ /g')
 
 # Add $ctdb_interfaces and uniquify
 all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u)
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index d324e3f..5345251 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -65,7 +65,20 @@ static int ctdb_add_local_iface(struct ctdb_context *ctdb, 
const char *iface)
CTDB_NO_MEMORY_FATAL(ctdb, i);
i-name = talloc_strdup(i, iface);
CTDB_NO_MEMORY(ctdb, i-name);
-   i-link_up = false;
+   /*
+* If link_up defaults to true then IPs can be allocated to a
+* node during the first recovery.  However, then an interface
+* could have its link marked down during the startup event,
+* causing the IP to move almost immediately.  If link_up
+* defaults to false then, during normal operation, IPs added
+* to a new interface can't be assigned until a monitor cycle
+* has occurred and marked the new interfaces up.  This makes
+* IP allocation unpredictable.  The following is a neat
+* compromise: early in startup link_up defaults to false, so
+* IPs can't be assigned, and after startup IPs can be
+* assigned immediately.
+*/
+   i-link_up = ctdb-done_startup;
 
DLIST_ADD(ctdb-ifaces, i);
 


-- 
CTDB repository