svn commit: samba r20896 - in
branches/SAMBA_4_0/source/cluster/ctdb: . common include
tridge at samba.org
tridge at samba.org
Fri Jan 19 04:32:06 GMT 2007
Author: tridge
Date: 2007-01-19 04:32:04 +0000 (Fri, 19 Jan 2007)
New Revision: 20896
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20896
Log:
make the maximum lacount configurable in smb.conf
at the moment the brlock_ctdb backend will sometimes fail after
dmaster migrations. So to pass tests this needs to be set high. Thats
a priority to fix.
Modified:
branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb.c
branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_call.c
branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb_private.h
Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb.c 2007-01-19 04:09:32 UTC (rev 20895)
+++ branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb.c 2007-01-19 04:32:04 UTC (rev 20896)
@@ -48,6 +48,13 @@
ctdb->flags |= flags;
}
+/*
+ set max acess count before a dmaster migration
+*/
+void ctdb_set_max_lacount(struct ctdb_context *ctdb, unsigned count)
+{
+ ctdb->max_lacount = count;
+}
/*
add a node to the list of active nodes
@@ -281,6 +288,7 @@
ctdb->ev = ev;
ctdb->upcalls = &ctdb_upcalls;
ctdb->idr = idr_init(ctdb);
+ ctdb->max_lacount = CTDB_DEFAULT_MAX_LACOUNT;
return ctdb;
}
Modified: branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_call.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_call.c 2007-01-19 04:09:32 UTC (rev 20895)
+++ branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_call.c 2007-01-19 04:32:04 UTC (rev 20896)
@@ -345,7 +345,7 @@
/* if this nodes has done enough consecutive calls on the same record
then give them the record */
if (header.laccessor == c->hdr.srcnode &&
- header.lacount >= CTDB_MAX_LACOUNT) {
+ header.lacount >= ctdb->max_lacount) {
ctdb_call_send_dmaster(ctdb, c, &header, &key, &data);
talloc_free(data.dptr);
return;
Modified: branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c 2007-01-19 04:09:32 UTC (rev 20895)
+++ branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c 2007-01-19 04:32:04 UTC (rev 20896)
@@ -68,7 +68,7 @@
const char *address;
const char *transport;
struct cluster_state *state;
- int ret;
+ int ret, lacount;
nlist = lp_parm_string(-1, "ctdb", "nlist");
if (nlist == NULL) return;
@@ -101,6 +101,11 @@
ctdb_set_flags(state->ctdb, CTDB_FLAG_SELF_CONNECT);
}
+ lacount = lp_parm_int(-1, "ctdb", "maxlacount", -1);
+ if (lacount != -1) {
+ ctdb_set_max_lacount(state->ctdb, lacount);
+ }
+
/* tell ctdb what address to listen on */
ret = ctdb_set_address(state->ctdb, address);
if (ret == -1) {
Modified: branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h 2007-01-19 04:09:32 UTC (rev 20895)
+++ branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h 2007-01-19 04:32:04 UTC (rev 20896)
@@ -59,6 +59,11 @@
void ctdb_set_flags(struct ctdb_context *ctdb, unsigned flags);
/*
+ set max acess count before a dmaster migration
+*/
+void ctdb_set_max_lacount(struct ctdb_context *ctdb, unsigned count);
+
+/*
tell ctdb what address to listen on, in transport specific format
*/
int ctdb_set_address(struct ctdb_context *ctdb, const char *address);
Modified: branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb_private.h
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb_private.h 2007-01-19 04:09:32 UTC (rev 20895)
+++ branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb_private.h 2007-01-19 04:32:04 UTC (rev 20896)
@@ -93,6 +93,7 @@
const struct ctdb_methods *methods; /* transport methods */
const struct ctdb_upcalls *upcalls; /* transport upcalls */
void *private; /* private to transport */
+ unsigned max_lacount;
};
#define CTDB_NO_MEMORY(ctdb, p) do { if (!(p)) { \
@@ -115,7 +116,7 @@
/* number of consecutive calls from the same node before we give them
the record */
-#define CTDB_MAX_LACOUNT 7000
+#define CTDB_DEFAULT_MAX_LACOUNT 7
/*
the extended header for records in the ltdb
More information about the samba-cvs
mailing list