Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13177
Modified Files:
Tag: Nov2009
ChangeLog merovingian.c merovingian_forkmserver.c monetdb.c
properties.c utils.c utils.h
Log Message:
Add slave property for databases
U merovingian.c
Index: merovingian.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian.c,v
retrieving revision 1.65.2.1
retrieving revision 1.65.2.2
diff -u -d -r1.65.2.1 -r1.65.2.2
--- merovingian.c 29 Sep 2009 07:54:40 -0000 1.65.2.1
+++ merovingian.c 30 Sep 2009 14:20:07 -0000 1.65.2.2
@@ -609,6 +609,8 @@
}
kv = findConfKey(_mero_props, "master");
kv->val = GDKstrdup("no");
+ kv = findConfKey(_mero_props, "slave");
+ kv->val = NULL; /* MURI */
/* we no longer need prefix */
freeConfFile(ckv);
U utils.h
Index: utils.h
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/utils.h,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- utils.h 23 Sep 2009 11:41:52 -0000 1.9
+++ utils.h 30 Sep 2009 14:20:07 -0000 1.9.2.1
@@ -28,6 +28,7 @@
INT,
BOOL,
STR,
+ MURI,
OTHER
};
U ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/ChangeLog,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -d -r1.29 -r1.29.2.1
--- ChangeLog 25 Sep 2009 09:09:12 -0000 1.29
+++ ChangeLog 30 Sep 2009 14:20:06 -0000 1.29.2.1
@@ -1,6 +1,12 @@
# ChangeLog file for sql/src/backends/monet5
# This file is updated with mchangelog (Gentoo echangelog bastard script)
+*Nov2009
+
+ 30 Sep 2009; Fabian Groffen <[email protected]> merovingian.c,
+ merovingian_forkmserver.c, monetdb.c, properties.c, utils.c, utils.h:
+ Add slave property for databases
+
25 Sep 2009; Fabian Groffen <[email protected]> monetdb.c:
Implemented global -q option to monetdb to suppress status messages when
performing commands
@@ -39,6 +45,7 @@
Always put created databases under maintenance, they have to be explicitly
released after creating and performing the initialisation steps by the DBA
+*Aug2009-SP2
*Aug2009-SP1
25 Aug 2009; Fabian Groffen <[email protected]> merovingian.c:
U monetdb.c
Index: monetdb.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.c,v
retrieving revision 1.65.2.3
retrieving revision 1.65.2.4
diff -u -d -r1.65.2.3 -r1.65.2.4
--- monetdb.c 30 Sep 2009 11:03:58 -0000 1.65.2.3
+++ monetdb.c 30 Sep 2009 14:20:07 -0000 1.65.2.4
@@ -1068,7 +1068,8 @@
if (strcmp(property, "all") == 0) {
/* die hard leak (can't use constant, strtok
modifies
* (and hence crashes)) */
- property =
GDKstrdup("name,forward,shared,nthreads,master");
+ /* FIXME: make this read keys from defaultprops
*/
+ property =
GDKstrdup("name,forward,shared,nthreads,master,slave");
}
} else {
doall = 0;
U utils.c
Index: utils.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/utils.c,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- utils.c 23 Sep 2009 11:41:52 -0000 1.13
+++ utils.c 30 Sep 2009 14:20:07 -0000 1.13.2.1
@@ -173,6 +173,18 @@
return(GDKstrdup(buf));
}
}; break;
+ case MURI: {
+ if (strncmp(val, "mapi:monetdb://",
+ sizeof("mapi:monetdb://") -1)
!= 0)
+ {
+ char buf[256];
+ snprintf(buf, sizeof(buf),
+ "key '%s' requires a
mapi:monetdb:// URI value, got: %s",
+ ckv->key, val);
+ return(GDKstrdup(buf));
+ }
+ /* TODO: check full URL? */
+ }; break;
case STR:
case OTHER:
/* leave as is, not much to check */
U properties.c
Index: properties.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/properties.c,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- properties.c 25 Sep 2009 13:43:30 -0000 1.13
+++ properties.c 30 Sep 2009 14:20:07 -0000 1.13.2.1
@@ -39,6 +39,7 @@
{"shared", NULL, STR},
{"nthreads", NULL, INT},
{"master", NULL, BOOL},
+ {"slave", NULL, MURI},
{ NULL, NULL, INVALID}
};
U merovingian_forkmserver.c
Index: merovingian_forkmserver.c
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_forkmserver.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- merovingian_forkmserver.c 17 Sep 2009 15:28:00 -0000 1.3
+++ merovingian_forkmserver.c 30 Sep 2009 14:20:07 -0000 1.3.2.1
@@ -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")) {
+ 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