[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-140-gd0c57b9

Ronnie Sahlberg sahlberg at samba.org
Mon Aug 23 22:01:23 MDT 2010


The branch, 1.0.112 has been updated
       via  d0c57b915d225bcf4c924ff57df7abb99b3ebfd1 (commit)
       via  3669e4aa5037fdf582cb05c67839fa7e405a3fb7 (commit)
       via  0f3c950142c38677e9051294586aabbe961f7f43 (commit)
      from  1d1d475d7e18620330aaee95038c40b27e5496d4 (commit)

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


- Log -----------------------------------------------------------------
commit d0c57b915d225bcf4c924ff57df7abb99b3ebfd1
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 24 10:23:38 2010 +1000

    new version 1.0.112-34

commit 3669e4aa5037fdf582cb05c67839fa7e405a3fb7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 24 10:22:17 2010 +1000

    Revert "add some extra debugging statements to the client side code sending controls"
    
    This reverts commit 1d1d475d7e18620330aaee95038c40b27e5496d4.

commit 0f3c950142c38677e9051294586aabbe961f7f43
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Aug 19 07:18:22 2010 +1000

        On RHEL,    "service nfs stop;service nfs start"  and "service nfs restart"
        sometimes (very rarely) fails to restart the service.
    
        Add a function to restart NFSd on SLES and RHEL-like systems.
    
        If we detect the system is unhealthy due to kNFSd not running,
        try to restart the service again "service nfs restart" and
        hope for the best.
    
    CQ1019372

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

Summary of changes:
 client/ctdb_client.c       |   24 +++++-------------------
 config/events.d/60.nfs     |   12 +++++++-----
 config/functions           |    7 +++++++
 packaging/RPM/ctdb.spec.in |    4 +++-
 4 files changed, 22 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 0b65466..7caa5cb 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -282,11 +282,6 @@ int ctdb_socket_connect(struct ctdb_context *ctdb)
 	ctdb->daemon.queue = ctdb_queue_setup(ctdb, ctdb, ctdb->daemon.sd, 
 					      CTDB_DS_ALIGNMENT, 
 					      ctdb_client_read_cb, ctdb);
-	if (ctdb->daemon.queue == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to setup queue to daemon\n"));
-		return -1;
-	}
-
 	return 0;
 }
 
@@ -840,7 +835,6 @@ struct ctdb_client_control_state *ctdb_control_send(struct ctdb_context *ctdb,
 
 	ret = ctdb_client_queue_pkt(ctdb, &(c->hdr));
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to queue packet to ctdb daemon\n"));
 		talloc_free(state);
 		return NULL;
 	}
@@ -870,7 +864,6 @@ int ctdb_control_recv(struct ctdb_context *ctdb,
 	}
 
 	if (state == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control_recv called with state==NULL\n"));
 		return -1;
 	}
 
@@ -886,12 +879,12 @@ int ctdb_control_recv(struct ctdb_context *ctdb,
 	}
 
 	if (state->state != CTDB_CONTROL_DONE) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control_recv failed with state:%d\n", state->state));
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_control_recv failed\n"));
 		if (state->async.fn) {
 			state->async.fn(state);
 		}
 		talloc_free(tmp_ctx);
-		return -2;
+		return -1;
 	}
 
 	if (state->errormsg) {
@@ -903,7 +896,7 @@ int ctdb_control_recv(struct ctdb_context *ctdb,
 			state->async.fn(state);
 		}
 		talloc_free(tmp_ctx);
-		return -3;
+		return -1;
 	}
 
 	if (outdata) {
@@ -1129,16 +1122,9 @@ struct ctdb_client_control_state *
 ctdb_ctrl_getrecmaster_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, 
 			struct timeval timeout, uint32_t destnode)
 {
-	struct ctdb_client_control_state *state;
-
-	state = ctdb_control_send(ctdb, destnode, 0, 
+	return ctdb_control_send(ctdb, destnode, 0, 
 			   CTDB_CONTROL_GET_RECMASTER, 0, tdb_null, 
 			   mem_ctx, &timeout, NULL);
-	if (state == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to send getrecmaster control to node %u\n", destnode));
-	}
-
-	return state;
 }
 
 int ctdb_ctrl_getrecmaster_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, uint32_t *recmaster)
@@ -1148,7 +1134,7 @@ int ctdb_ctrl_getrecmaster_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
 
 	ret = ctdb_control_recv(ctdb, state, mem_ctx, NULL, &res, NULL);
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_ctrl_getrecmaster_recv failed with error:%d\n", ret));
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_ctrl_getrecmaster_recv failed\n"));
 		return -1;
 	}
 
diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs
index 3957283..00cceb3 100755
--- a/config/events.d/60.nfs
+++ b/config/events.d/60.nfs
@@ -75,12 +75,14 @@ case "$1" in
 		echo "ERROR: STATD is not responding. Trying to restart it. [rpc.statd $RPCSTATDOPTS]"
 	}
 
-	# check that NFS is running
-	service nfs status 2>/dev/null >/dev/null || {
-		echo NFS is not running. Trying to restart NFS.
-		ctdb_service_stop
-		ctdb_service_start
+	# check that NFS responds to rpc requests
+	[ "$CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK" = "yes" ] || {
+	    (ctdb_check_rpc "NFS" 100003 3)
+	    [ $? = "0" ] || {
+		echo "Trying to restart NFS service"
+		startstop_nfs restart
 		exit 1
+	    }
 	}
 
 	# and that its directories are available
diff --git a/config/functions b/config/functions
index e0d0735..05c5ed7 100755
--- a/config/functions
+++ b/config/functions
@@ -328,6 +328,9 @@ startstop_nfs() {
 		stop)
 			service nfsserver stop > /dev/null 2>&1
 			;;
+		restart)
+			service nfsserver restart
+			;;
 		esac
 		;;
 	rhel)
@@ -340,6 +343,10 @@ startstop_nfs() {
 			service nfs stop > /dev/null 2>&1
 			service nfslock stop > /dev/null 2>&1
 			;;
+		restart)
+			service nfslock restart
+			service nfs restart
+			;;
 		esac
 		;;
 	*)
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index a71cacf..2b98af5 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0.112
-Release: 33
+Release: 34
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -125,6 +125,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_docdir}/ctdb/tests/bin/ctdb_transaction
 
 %changelog
+* Tue Aug 24 2010 : Version 1.0.112-34
+ - Merge NFS auto-restart patch from master
 * Tue Aug 11 2010 : Version 1.0.112-33
  - CQ : S1019290
    Add a new event "ipreallocated" so that we can update the natgw


-- 
CTDB repository


More information about the samba-cvs mailing list