[SCM] CTDB repository - branch master updated -
ctdb-1.0.57-32-g4237bd3
Ronnie Sahlberg
sahlberg at samba.org
Tue Oct 7 07:15:05 GMT 2008
The branch, master has been updated
via 4237bd3753dcb024c17461e974414bef1b609416 (commit)
via e701a531868149f16561011e65794a4a46ee6596 (commit)
from d9779c310e98c9d4eab71a8d1705849ac90deb10 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4237bd3753dcb024c17461e974414bef1b609416
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 7 18:14:44 2008 +1100
remove an unused variable
commit e701a531868149f16561011e65794a4a46ee6596
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 7 18:12:54 2008 +1100
When we reload the nodes file
instead of shutting down/restarting the entire tcp layer
just bounce all outgoing connections and reconnect
-----------------------------------------------------------------------
Summary of changes:
server/ctdb_recover.c | 24 +++++++-----------------
tcp/tcp_init.c | 6 ++----
2 files changed, 9 insertions(+), 21 deletions(-)
Changeset truncated at 500 lines:
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index dc6533c..54276d8 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -178,28 +178,18 @@ static void
ctdb_reload_nodes_event(struct event_context *ev, struct timed_event *te,
struct timeval t, void *private_data)
{
- int ret;
- struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
- int ctdb_tcp_init(struct ctdb_context *);
+ int i;
- /* shut down the transport */
- if (ctdb->methods != NULL) {
- ctdb->methods->shutdown(ctdb);
- }
+ struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
- /* start the transport again */
ctdb_load_nodes_file(ctdb);
- ret = ctdb_tcp_init(ctdb);
- if (ret != 0) {
- DEBUG(DEBUG_CRIT, (__location__ " Failed to init TCP\n"));
- exit(1);
- }
- if (ctdb->methods == NULL) {
- DEBUG(DEBUG_ALERT,(__location__ " Can not restart transport. ctdb->methods==NULL\n"));
- ctdb_fatal(ctdb, "can not reinitialize transport.");
+ for (i=0; i<ctdb->num_nodes; i++) {
+ if (ctdb->methods->add_node(ctdb->nodes[i]) != 0) {
+ DEBUG(DEBUG_CRIT, (__location__ " methods->add_node failed at %d\n", i));
+ ctdb_fatal(ctdb, "failed to add node. shutting down\n");
+ }
}
- ctdb->methods->initialise(ctdb);
ctdb->methods->start(ctdb);
return;
diff --git a/tcp/tcp_init.c b/tcp/tcp_init.c
index 5c53caf..8b33efe 100644
--- a/tcp/tcp_init.c
+++ b/tcp/tcp_init.c
@@ -31,16 +31,14 @@
*/
static int ctdb_tcp_add_node(struct ctdb_node *node)
{
- struct ctdb_tcp *ctcp = talloc_get_type(node->ctdb->private_data,
- struct ctdb_tcp);
struct ctdb_tcp_node *tnode;
- tnode = talloc_zero(ctcp, struct ctdb_tcp_node);
+ tnode = talloc_zero(node, struct ctdb_tcp_node);
CTDB_NO_MEMORY(node->ctdb, tnode);
tnode->fd = -1;
node->private_data = tnode;
- tnode->out_queue = ctdb_queue_setup(node->ctdb, ctcp, tnode->fd, CTDB_TCP_ALIGNMENT,
+ tnode->out_queue = ctdb_queue_setup(node->ctdb, node, tnode->fd, CTDB_TCP_ALIGNMENT,
ctdb_tcp_tnode_cb, node);
return 0;
--
CTDB repository
More information about the samba-cvs
mailing list