Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory
23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27224/src/backends/monet5/merovingian
Modified Files:
merovingian_forkmserver.c
Log Message:
propagated changes of Wednesday Sep 30 2009 - Thursday Oct 01 2009
from the Nov2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/30 - mr-meltdown:
src/backends/monet5/merovingian/merovingian_forkmserver.c,1.3.2.1
Add slave property for databases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/10/01 - mr-meltdown:
src/backends/monet5/merovingian/merovingian_forkmserver.c,1.3.2.2
epic fail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: merovingian_forkmserver.c
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_forkmserver.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- merovingian_forkmserver.c 17 Sep 2009 15:28:00 -0000 1.3
+++ merovingian_forkmserver.c 1 Oct 2009 14:25:07 -0000 1.4
@@ -34,10 +34,6 @@
int pfde[2];
dpair dp;
str vaultkey = NULL;
- str nthreads = NULL;
- str master = NULL;
- char mydoproxy;
- confkeyval *ckv, *kv;
struct stat statbuf;
char upmin[8];
char upavg[8];
@@ -205,35 +201,6 @@
database, database));
}
- ckv = getDefaultProps();
- readProps(ckv, (*stats)->path);
-
- kv = findConfKey(ckv, "forward");
- if (kv->val == NULL)
- kv = findConfKey(_mero_props, "forward");
- mydoproxy = strcmp(kv->val, "proxy") == 0;
-
- kv = findConfKey(ckv, "nthreads");
- if (kv->val == NULL)
- kv = findConfKey(_mero_props, "nthreads");
- if (kv->val != NULL) {
- nthreads = alloca(sizeof(char) * 24);
- snprintf(nthreads, 24, "gdk_nr_threads=%s", kv->val);
- }
-
- kv = findConfKey(ckv, "master");
- if (kv->val != NULL && /* can't have master configured by default */
- (!strcmp(kv->val, "true") ||
- !strcmp(kv->val, "yes") ||
- !strcmp(kv->val, "1")))
- {
- master = alloca(sizeof(char) * 24);
- snprintf(master, 24, "replication_master=true");
- }
-
- freeConfFile(ckv);
- GDKfree(ckv); /* can make ckv static and reuse it all the time */
-
/* create the pipes (filedescriptors) now, such that we and the
* child have the same descriptor set */
if (pipe(pfdo) == -1) {
@@ -252,9 +219,48 @@
str conffile = alloca(sizeof(char) * 512);
str dbname = alloca(sizeof(char) * 512);
str port = alloca(sizeof(char) * 24);
- str argv[19]; /* for the exec arguments */
+ char mydoproxy;
+ str nthreads = NULL;
+ str master = NULL;
+ str slave = NULL;
+ str argv[21]; /* for the exec arguments */
+ confkeyval *ckv, *kv;
int c = 0;
+ ckv = getDefaultProps();
+ readProps(ckv, (*stats)->path);
+
+ kv = findConfKey(ckv, "forward");
+ if (kv->val == NULL)
+ kv = findConfKey(_mero_props, "forward");
+ mydoproxy = strcmp(kv->val, "proxy") == 0;
+
+ kv = findConfKey(ckv, "nthreads");
+ if (kv->val == NULL)
+ kv = findConfKey(_mero_props, "nthreads");
+ if (kv->val != NULL) {
+ nthreads = alloca(sizeof(char) * 24);
+ snprintf(nthreads, 24, "gdk_nr_threads=%s", kv->val);
+ }
+
+ kv = findConfKey(ckv, "master");
+ /* can't have master configured by default */
+ if (kv->val != NULL && strcmp(kv->val, "yes") == 0) {
+ master = alloca(sizeof(char) * 24);
+ snprintf(master, 24, "replication_master=true");
+ }
+
+ kv = findConfKey(ckv, "slave");
+ /* can't have slave configured by default */
+ if (kv->val != NULL) {
+ size_t len = 24 + strlen(kv->val);
+ slave = alloca(sizeof(char) * len);
+ snprintf(slave, len, "replication_slave=%s", kv->val);
+ }
+
+ freeConfFile(ckv);
+ GDKfree(ckv); /* can make ckv static and reuse it all the time
*/
+
/* redirect stdout and stderr to a new pair of fds for
* logging help */
close(pfdo[0]);
@@ -293,6 +299,9 @@
if (master != NULL) {
argv[c++] = "--set"; argv[c++] = master;
}
+ if (slave != NULL) {
+ argv[c++] = "--set"; argv[c++] = slave;
+ }
argv[c++] = NULL;
fprintf(stdout, "arguments:");
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins