The branch, master has been updated
       via  9381c33dfd40192b7532d942059c2959dfae059d (commit)
       via  46615c8e0e63291605d76a6d35f1a93180718c36 (commit)
       via  59489019ad15a5ad6b0f295e742fc9832745a842 (commit)
      from  370022e1ff654db99d0c3ce0c49914c249e57289 (commit)

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


- Log -----------------------------------------------------------------
commit 9381c33dfd40192b7532d942059c2959dfae059d
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Thu Nov 7 16:01:49 2013 +1100

    tests: Fix calling of ctdb tool from test
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>

commit 46615c8e0e63291605d76a6d35f1a93180718c36
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Thu Nov 7 15:54:28 2013 +1100

    Revert "tests: If transaction_start fails, try again"
    
    This reverts commit ed7d999214ee009e480c26410a04fa105028cb8e.
    
    This is not necessary since ctdb_transaction_start() now will return NULL
    only when there is a failure and not when another transaction is currently
    active.
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>

commit 59489019ad15a5ad6b0f295e742fc9832745a842
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Thu Nov 7 15:54:20 2013 +1100

    client: Make g_lock_lock() wait till lock is obtained
    
    This makes the behaviour of g_lock_lock() similar to that implemented in
    Samba.  Now ctdb_transaction_start() will return NULL only when there are
    failures and not when another transaction is active.
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>

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

Summary of changes:
 client/ctdb_client.c                         |   12 +++++++++++-
 tests/simple/54_ctdb_transaction_recovery.sh |    2 +-
 tests/src/ctdb_transaction.c                 |    2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 6ccc4c9..fddbd02 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -3856,10 +3856,20 @@ static bool g_lock_lock(TALLOC_CTX *mem_ctx,
        struct ctdb_record_handle *h;
        struct g_lock_recs *locks;
        struct server_id id;
+       struct timeval t_start;
        int i;
 
        key.dptr = (uint8_t *)discard_const(keyname);
        key.dsize = strlen(keyname) + 1;
+
+       t_start = timeval_current();
+
+again:
+       /* Keep trying for an hour. */
+       if (timeval_elapsed(&t_start) > 3600) {
+               return false;
+       }
+
        h = ctdb_fetch_lock(ctdb_db, mem_ctx, key, &data);
        if (h == NULL) {
                return false;
@@ -3899,7 +3909,7 @@ static bool g_lock_lock(TALLOC_CTX *mem_ctx,
                                   id.task_id, id.vnn,
                                   (unsigned long long)id.unique_id));
                talloc_free(h);
-               return false;
+               goto again;
        }
 
        locks->lock = talloc_realloc(locks, locks->lock, struct g_lock_rec,
diff --git a/tests/simple/54_ctdb_transaction_recovery.sh 
b/tests/simple/54_ctdb_transaction_recovery.sh
index baeea22..d796e94 100755
--- a/tests/simple/54_ctdb_transaction_recovery.sh
+++ b/tests/simple/54_ctdb_transaction_recovery.sh
@@ -28,7 +28,7 @@ recovery_loop()
 
        while true ; do
                echo Recovery $COUNT
-               ctdb recover
+               try_command_on_node 0 $CTDB recover
                sleep 2
                COUNT=$((COUNT + 1))
        done
diff --git a/tests/src/ctdb_transaction.c b/tests/src/ctdb_transaction.c
index 7671992..78a63f1 100644
--- a/tests/src/ctdb_transaction.c
+++ b/tests/src/ctdb_transaction.c
@@ -137,7 +137,7 @@ static void test_store_records(struct ctdb_context *ctdb, 
struct event_context *
                        DEBUG(DEBUG_ERR, ("Failed to start transaction on node 
%d\n",
                               ctdb_get_pnn(ctdb)));
                        talloc_free(tmp_ctx);
-                       continue;
+                       return;
                }
                if (verbose) DEBUG(DEBUG_ERR, ("transaction started\n"));
                do_sleep(delay);


-- 
CTDB repository

Reply via email to