diff --git a/core/depend.mk b/core/depend.mk index 116e7a526..b20eea9e4 100644 --- a/core/depend.mk +++ b/core/depend.mk @@ -10,7 +10,7 @@ buffer.o: buffer.c /usr/include/stdlib.h /usr/include/features.h \ /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/bits/sigset.h /usr/include/bits/time.h \ /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h ../include/buffer.h + /usr/include/alloca.h ../include/buffer.h ../include/atomic.h spinlock.o: spinlock.c ../include/spinlock.h ../include/thread.h \ /usr/include/pthread.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ @@ -73,7 +73,7 @@ gateway.o: gateway.c ../include/gw.h /usr/include/stdio.h \ /usr/include/mysql/mysql.h /usr/include/mysql/mysql_version.h \ /usr/include/mysql/mysql_com.h /usr/include/mysql/mysql_time.h \ /usr/include/mysql/my_list.h /usr/include/mysql/typelib.h \ - /usr/include/mysql/my_alloc.h \ + /usr/include/mysql/my_alloc.h /usr/include/sys/stat.h \ /home/mriddoch/Repository/skygateway/utils/skygw_utils.h \ /home/mriddoch/Repository/skygateway/utils/skygw_types.h \ /usr/include/math.h /usr/include/bits/huge_val.h \ @@ -351,7 +351,18 @@ service.o: service.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/setjmp.h ../include/dcb.h ../include/buffer.h \ ../include/gwbitmask.h ../include/server.h ../include/router.h \ ../include/modules.h ../include/users.h ../include/hashtable.h \ - ../include/atomic.h ../include/dbusers.h ../include/poll.h + ../include/atomic.h ../include/dbusers.h ../include/poll.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_utils.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_types.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_debug.h \ + /usr/include/assert.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /home/mriddoch/Repository/skygateway/log_manager/log_manager.h server.o: server.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ @@ -371,7 +382,18 @@ server.o: server.c /usr/include/stdio.h /usr/include/features.h \ ../include/server.h ../include/dcb.h ../include/spinlock.h \ ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h + ../include/gwbitmask.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_utils.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_types.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_debug.h \ + /usr/include/assert.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /home/mriddoch/Repository/skygateway/log_manager/log_manager.h poll.o: poll.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ @@ -477,7 +499,18 @@ dbusers.o: dbusers.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/sched.h /usr/include/xlocale.h \ /usr/include/bits/setjmp.h ../include/buffer.h ../include/gwbitmask.h \ ../include/service.h ../include/server.h ../include/users.h \ - ../include/hashtable.h ../include/atomic.h + ../include/hashtable.h ../include/atomic.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_utils.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_types.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /home/mriddoch/Repository/skygateway/utils/skygw_debug.h \ + /usr/include/assert.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /home/mriddoch/Repository/skygateway/log_manager/log_manager.h thread.o: thread.c ../include/thread.h /usr/include/pthread.h \ /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ @@ -524,3 +557,26 @@ monitor.o: monitor.c /usr/include/stdio.h /usr/include/features.h \ ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ ../include/gwbitmask.h ../include/modules.h +adminusers.o: adminusers.c /usr/include/stdio.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/crypt.h \ + ../include/users.h ../include/hashtable.h ../include/spinlock.h \ + ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/atomic.h \ + ../include/dcb.h ../include/buffer.h ../include/gwbitmask.h \ + ../include/adminusers.h diff --git a/core/server.c b/core/server.c index eb5ff965c..5d1698edf 100644 --- a/core/server.c +++ b/core/server.c @@ -234,6 +234,8 @@ char *status = NULL; strcat(status, "Master, "); if (server->status & SERVER_SLAVE) strcat(status, "Slave, "); + if (server->status & SERVER_JOINED) + strcat(status, "Joined, "); if (server->status & SERVER_RUNNING) strcat(status, "Running"); else diff --git a/include/server.h b/include/server.h index ab7f544b9..008d6fbd3 100644 --- a/include/server.h +++ b/include/server.h @@ -30,6 +30,7 @@ * Date Who Description * 14/06/13 Mark Riddoch Initial implementation * 21/06/13 Mark Riddoch Addition of server status flags + * 22/07/13 Mark Riddoch Addition of JOINED status for Galera * * @endverbatim */ @@ -69,6 +70,7 @@ typedef struct server { #define SERVER_RUNNING 0x0001 /**<< The server is up and running */ #define SERVER_MASTER 0x0002 /**<< The server is a master, i.e. can handle writes */ #define SERVER_SLAVE 0x0004 /**<< The server is a slave, i.e. can handle reads */ +#define SERVER_JOINED 0x0008 /**<< The server is joined in a Galera cluster */ /** * Is the server running - the macro returns true if the server is marked as running diff --git a/modules/monitor/Makefile b/modules/monitor/Makefile index 853e168d1..553c3f385 100644 --- a/modules/monitor/Makefile +++ b/modules/monitor/Makefile @@ -29,11 +29,13 @@ LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ -Wl,-rpath,$(MARIADB_SRC_PATH)/libmysqld MYSQLSRCS=mysql_mon.c MYSQLOBJ=$(MYSQLSRCS:.c=.o) +GALERASRCS=mysql_mon.c +GALERAOBJ=$(GALERASRCS:.c=.o) SRCS=$(MYSQLSRCS) OBJ=$(SRCS:.c=.o) LIBS=$(UTILSPATH)/skygw_utils.o -llog_manager \ -L$(MARIADB_SRC_PATH)/libmysqld -lmysqld -MODULES=libmysqlmon.so +MODULES=libmysqlmon.so libgaleramon.so all: $(MODULES) @@ -41,6 +43,9 @@ all: $(MODULES) libmysqlmon.so: $(MYSQLOBJ) $(CC) $(LDFLAGS) $(MYSQLOBJ) $(LIBS) -o $@ +libgaleramon.so: $(GALERAOBJ) + $(CC) $(LDFLAGS) $(GALERAOBJ) $(LIBS) -o $@ + .c.o: $(CC) $(CFLAGS) $< -o $@ diff --git a/modules/monitor/depend.mk b/modules/monitor/depend.mk index 0d721d25f..bc757dc22 100644 --- a/modules/monitor/depend.mk +++ b/modules/monitor/depend.mk @@ -13,14 +13,15 @@ mysql_mon.o: mysql_mon.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/select.h /usr/include/bits/sigset.h \ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - ../../include/monitor.h ../../include/server.h ../../include/dcb.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h /usr/include/xlocale.h \ - /usr/include/bits/setjmp.h ../../include/buffer.h \ - ../../include/gwbitmask.h mysqlmon.h /usr/include/mysql/mysql.h \ - /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ - /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ - /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/include/string.h /usr/include/xlocale.h ../../include/monitor.h \ + ../../include/server.h ../../include/dcb.h ../../include/spinlock.h \ + ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/bits/sched.h /usr/include/bits/setjmp.h \ + ../../include/buffer.h ../../include/gwbitmask.h mysqlmon.h \ + /usr/include/mysql/mysql.h /usr/include/mysql/mysql_version.h \ + /usr/include/mysql/mysql_com.h /usr/include/mysql/mysql_time.h \ + /usr/include/mysql/my_list.h /usr/include/mysql/typelib.h \ + /usr/include/mysql/my_alloc.h /usr/include/mysql/mysqld_error.h \ /home/mriddoch/Repository/skygateway/utils/skygw_utils.h \ /home/mriddoch/Repository/skygateway/utils/skygw_types.h \ /usr/include/math.h /usr/include/bits/huge_val.h \ diff --git a/modules/monitor/galera_mon.c b/modules/monitor/galera_mon.c new file mode 100644 index 000000000..294f54afd --- /dev/null +++ b/modules/monitor/galera_mon.c @@ -0,0 +1,273 @@ +/* + * This file is distributed as part of the SkySQL Gateway. It is free + * software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, + * version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright SkySQL Ab 2013 + */ + +/** + * @file galera_mon.c - A MySQL Galera cluster monitor + * + * @verbatim + * Revision History + * + * Date Who Description + * 22/07/13 Mark Riddoch Initial implementation + * + * @endverbatim + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void monitorMain(void *); + +static char *version_str = "V1.0.0"; + +static void *startMonitor(); +static void stopMonitor(void *); +static void registerServer(void *, SERVER *); +static void unregisterServer(void *, SERVER *); + +static MONITOR_OBJECT MyObject = { startMonitor, stopMonitor, registerServer, unregisterServer }; + +/** + * Implementation of the mandatory version entry point + * + * @return version string of the module + */ +char * +version() +{ + return version_str; +} + +/** + * The module initialisation routine, called when the module + * is first loaded. + */ +void +ModuleInit() +{ + fprintf(stderr, "Initialise the MySQL Galera Monitor module.\n"); +} + +/** + * The module entry point routine. It is this routine that + * must populate the structure that is referred to as the + * "module object", this is a structure with the set of + * external entry points for this module. + * + * @return The module object + */ +MONITOR_OBJECT * +GetModuleObject() +{ + return &MyObject; +} + +/** + * Start the instance of the monitor, returning a handle on the monitor. + * + * This function creates a thread to execute the actual monitoring. + * + * @return A handle to use when interacting with the monitor + */ +static void * +startMonitor() +{ +MYSQL_MONITOR *handle; + + if ((handle = (MYSQL_MONITOR *)malloc(sizeof(MYSQL_MONITOR))) == NULL) + return NULL; + handle->databases = NULL; + handle->shutdown = 0; + spinlock_init(&handle->lock); + thread_start(monitorMain, handle); + return handle; +} + +/** + * Stop a running monitor + * + * @param arg Handle on thr running monior + */ +static void +stopMonitor(void *arg) +{ +MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg; + + handle->shutdown = 1; +} + +/** + * Register a server that must be added to the monitored servers for + * a monitoring module. + * + * @param arg A handle on the running monitor module + * @param server The server to add + */ +static void +registerServer(void *arg, SERVER *server) +{ +MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg; +MONITOR_SERVERS *ptr, *db; + + if ((db = (MONITOR_SERVERS *)malloc(sizeof(MONITOR_SERVERS))) == NULL) + return; + db->server = server; + db->con = NULL; + db->next = NULL; + spinlock_acquire(&handle->lock); + if (handle->databases == NULL) + handle->databases = db; + else + { + ptr = handle->databases; + while (ptr->next != NULL) + ptr = ptr->next; + ptr->next = db; + } + spinlock_release(&handle->lock); +} + +/** + * Remove a server from those being monitored by a monitoring module + * + * @param arg A handle on the running monitor module + * @param server The server to remove + */ +static void +unregisterServer(void *arg, SERVER *server) +{ +MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg; +MONITOR_SERVERS *ptr, *lptr; + + spinlock_acquire(&handle->lock); + if (handle->databases == NULL) + { + spinlock_release(&handle->lock); + return; + } + if (handle->databases->server == server) + { + ptr = handle->databases; + handle->databases = handle->databases->next; + free(ptr); + } + else + { + ptr = handle->databases; + while (ptr->next != NULL && ptr->next->server != server) + ptr = ptr->next; + if (ptr->next) + { + lptr = ptr->next; + ptr->next = ptr->next->next; + free(lptr); + } + } + spinlock_release(&handle->lock); +} + +/** + * Monitor an individual server + * + * @param database The database to probe + */ +static void +monitorDatabase(MONITOR_SERVERS *database) +{ +MYSQL_ROW row; +MYSQL_RES *result; +int num_fields; +int isjoined = 0; + + if (database->con == NULL || mysql_ping(database->con) != 0) + { + database->con = mysql_init(NULL); + if (mysql_real_connect(database->con, database->server->name, + database->server->monuser, database->server->monpw, + NULL, database->server->port, NULL, 0) == NULL) + { + server_clear_status(database->server, SERVER_RUNNING); + return; + } + } + + /* If we get this far then we have a working connection */ + server_set_status(database->server, SERVER_RUNNING); + + /* Check if the the Galera FSM shows this node is joined to the cluster */ + if (mysql_query(database->con, "SHOW STATUS LIKE 'wsrep_local_state_comment'") == 0 + && (result = mysql_store_result(database->con)) != NULL) + { + num_fields = mysql_num_fields(result); + while ((row = mysql_fetch_row(result))) + { + if (strncmp(row[0], "JOINED", 3) == 0) + isjoined = 1; + } + mysql_free_result(result); + } + + if (isjoined) + server_set_status(database->server, SERVER_JOINED); + else + server_clear_status(database->server, SERVER_JOINED); +} + +/** + * The entry point for the monitoring module thread + * + * @param arg The handle of the monitor + */ +static void +monitorMain(void *arg) +{ +MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg; +MONITOR_SERVERS *ptr; + + if (mysql_thread_init()) + { + skygw_log_write_flush(NULL, + LOGFILE_ERROR, + "Fatal : mysql_init_thread failed in monitor " + "module. Exiting.\n"); + return; + } + while (1) + { + if (handle->shutdown) + { + mysql_thread_end(); + return; + } + ptr = handle->databases; + while (ptr) + { + monitorDatabase(ptr); + ptr = ptr->next; + } + thread_millisleep(10000); + } +} diff --git a/modules/protocol/depend.mk b/modules/protocol/depend.mk index c03348e46..79a4eaaaa 100644 --- a/modules/protocol/depend.mk +++ b/modules/protocol/depend.mk @@ -186,9 +186,11 @@ telnetd.o: telnetd.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/select.h /usr/include/bits/sigset.h \ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/dcb.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/string.h /usr/include/xlocale.h \ + ../../include/dcb.h ../../include/spinlock.h ../../include/thread.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ /usr/include/bits/setjmp.h ../../include/buffer.h \ ../../include/gwbitmask.h ../../include/service.h ../../include/server.h \ ../../include/session.h /usr/include/sys/ioctl.h \ @@ -209,9 +211,7 @@ telnetd.o: telnetd.c /usr/include/stdio.h /usr/include/features.h \ ../../include/atomic.h ../../include/gw.h /usr/include/ctype.h \ /usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/bits/netdb.h \ /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/syslog.h /usr/include/sys/syslog.h \ + /usr/include/syslog.h /usr/include/sys/syslog.h \ /usr/include/bits/syslog-path.h /usr/include/pwd.h \ /usr/include/sys/epoll.h /usr/include/signal.h \ /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ @@ -220,7 +220,7 @@ telnetd.o: telnetd.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/sigthread.h \ /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \ ../../include/gateway_mysql.h ../../include/mysql_protocol.h \ - ../../include/dcb.h + ../../include/dcb.h ../include/telnetd.h ../../include/adminusers.h httpd.o: httpd.c ../include/httpd.h /usr/include/stdio.h \ /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ diff --git a/modules/routing/debugcmd.c b/modules/routing/debugcmd.c index 2713cfc22..b947c718e 100644 --- a/modules/routing/debugcmd.c +++ b/modules/routing/debugcmd.c @@ -399,6 +399,7 @@ static struct { { "running", SERVER_RUNNING }, { "master", SERVER_MASTER }, { "slave", SERVER_SLAVE }, + { "joined", SERVER_JOINED }, { NULL, 0 } }; /** diff --git a/modules/routing/depend.mk b/modules/routing/depend.mk index b51f55927..19835f6cd 100644 --- a/modules/routing/depend.mk +++ b/modules/routing/depend.mk @@ -48,7 +48,27 @@ readconnroute.o: readconnroute.c /usr/include/stdio.h \ /usr/include/assert.h /usr/include/unistd.h \ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/mriddoch/Repository/skygateway/log_manager/log_manager.h + /home/mriddoch/Repository/skygateway/log_manager/log_manager.h \ + ../include/mysql_client_server_protocol.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h /usr/include/openssl/sha.h \ + /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ + /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ + /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/netinet/in.h /usr/include/bits/in.h \ + /usr/include/arpa/inet.h \ + /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ + ../../include/poll.h ../../include/users.h ../../include/hashtable.h debugcli.o: debugcli.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ @@ -93,4 +113,5 @@ debugcmd.o: debugcmd.c /usr/include/stdio.h /usr/include/features.h \ ../../include/gwbitmask.h ../../include/server.h ../../include/session.h \ ../../include/router.h ../../include/modules.h ../../include/atomic.h \ ../../include/poll.h ../../include/users.h ../../include/hashtable.h \ - ../include/debugcli.h + ../../include/dbusers.h ../../include/config.h ../include/telnetd.h \ + ../../include/adminusers.h ../include/debugcli.h diff --git a/modules/routing/readconnroute.c b/modules/routing/readconnroute.c index 6cca0b338..5136ce885 100644 --- a/modules/routing/readconnroute.c +++ b/modules/routing/readconnroute.c @@ -51,11 +51,13 @@ * 27/06/2013 Vilho Raatikka Added skygw_log_write command as an example * and necessary headers. * 17/07/2013 Massimiliano Pinto Added clientReply routine: - called by backend server to send data to client - Included mysql_client_server_protocol.h - with macros and MySQL commands with MYSQL_ prefix - avoiding any conflict with the standard ones - in mysql.h + * called by backend server to send data to client + * Included mysql_client_server_protocol.h + * with macros and MySQL commands with MYSQL_ prefix + * avoiding any conflict with the standard ones + * in mysql.h + * 22/07/13 Mark Riddoch Addition of joined router option for Galera + * clusters * * @endverbatim */ @@ -209,6 +211,11 @@ int i, n; inst->bitmask |= (SERVER_MASTER|SERVER_SLAVE); inst->bitvalue |= SERVER_SLAVE; } + else if (!strcasecmp(options[i], "joined")) + { + inst->bitmask |= (SERVER_JOINED); + inst->bitvalue |= SERVER_JOINED; + } } }