Name change to MaxScale rather than gateway
Addition of code for dynamic reconfiguration by editign the cnf file and sendign a SIGHUP Improvements to the make install rule
This commit is contained in:
@ -43,8 +43,7 @@ DEBUGCLIOBJ=$(DEBUGCLISRCS:.c=.o)
|
||||
SRCS=$(TESTSRCS) $(READCONSRCS) $(DEBUGCLISRCS)
|
||||
OBJ=$(SRCS:.c=.o)
|
||||
LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager
|
||||
MODULES=libtestroute.so libreadconnroute.so libdebugcli.so \
|
||||
libreadwritesplit.so
|
||||
MODULES= libdebugcli.so libreadconnroute.so libtestroute.so
|
||||
|
||||
|
||||
all: $(MODULES)
|
||||
@ -78,6 +77,7 @@ depend:
|
||||
(cd readwritesplit; make depend)
|
||||
|
||||
install: $(MODULES)
|
||||
install -D $< $(DEST)/gateway/modules
|
||||
install -D $(MODULES) $(DEST)/MaxScale/modules
|
||||
(cd readwritesplit; make DEST=$(DEST) install)
|
||||
|
||||
include depend.mk
|
||||
|
@ -159,7 +159,7 @@ CLI_SESSION *client;
|
||||
|
||||
session->state = SESSION_STATE_READY;
|
||||
|
||||
dcb_printf(session->client, "Welcome the SkySQL Gateway Debug Interface (%s).\n",
|
||||
dcb_printf(session->client, "Welcome the SkySQL MaxScale Debug Interface (%s).\n",
|
||||
version_str);
|
||||
dcb_printf(session->client, "Type help for a list of available commands.\n\n");
|
||||
|
||||
@ -226,7 +226,7 @@ CLI_SESSION *session = (CLI_SESSION *)router_session;
|
||||
if (strrchr(session->cmdbuf, '\n'))
|
||||
{
|
||||
if (execute_cmd(session))
|
||||
dcb_printf(session->session->client, "Gateway> ");
|
||||
dcb_printf(session->session->client, "MaxScale> ");
|
||||
else
|
||||
session->session->client->func.close(session->session->client);
|
||||
}
|
||||
|
@ -107,6 +107,8 @@ static void shutdown_service(DCB *dcb, SERVICE *service);
|
||||
struct subcommand shutdownoptions[] = {
|
||||
{ "gateway", 0, shutdown_gateway, "Shutdown the gateway",
|
||||
{0, 0, 0} },
|
||||
{ "maxscale", 0, shutdown_gateway, "Shutdown the MaxScale gateway",
|
||||
{0, 0, 0} },
|
||||
{ "service", 1, shutdown_service, "Shutdown a service, e.g. shutdown service 0x4838320",
|
||||
{ARG_TYPE_ADDRESS, 0, 0} },
|
||||
{ NULL, 0, NULL, NULL,
|
||||
|
@ -58,6 +58,6 @@ depend:
|
||||
cc -M $(CFLAGS) $(SRCS) > depend.mk
|
||||
|
||||
install: $(MODULES)
|
||||
install -D $< $(DEST)/gateway/modules
|
||||
install -D $(MODULES) $(DEST)/MaxScale/modules
|
||||
|
||||
include depend.mk
|
||||
|
@ -23,10 +23,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mysql.h>
|
||||
#if defined(SS_DEBUG)
|
||||
#include <skygw_utils.h>
|
||||
#include <log_manager.h>
|
||||
#endif
|
||||
#include <query_classifier.h>
|
||||
#include <dcb.h>
|
||||
#include <spinlock.h>
|
||||
@ -305,8 +303,8 @@ static void* newSession(
|
||||
* Close a session with the router, this is the mechanism
|
||||
* by which a router may cleanup data structure etc.
|
||||
*
|
||||
* @param instance The router instance data
|
||||
* @param session The session being closed
|
||||
* @param instance The router instance data
|
||||
* @param router_session The session being closed
|
||||
*/
|
||||
static void closeSession(
|
||||
ROUTER* instance,
|
||||
@ -361,9 +359,9 @@ static void closeSession(
|
||||
* for buffering the partial query, a later call to the query router will
|
||||
* contain the remainder, or part thereof of the query.
|
||||
*
|
||||
* @param instance The query router instance
|
||||
* @param session The session associated with the client
|
||||
* @param queue Gateway buffer queue with the packets received
|
||||
* @param instance The query router instance
|
||||
* @param router_session The session associated with the client
|
||||
* @param queue Gateway buffer queue with the packets received
|
||||
*
|
||||
* @return The number of queries forwarded
|
||||
*/
|
||||
@ -423,34 +421,34 @@ static int routeQuery(
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(SS_DEBUG_)
|
||||
#if defined(SS_DEBUG_)
|
||||
skygw_log_write(NULL, LOGFILE_TRACE, "String\t\"%s\"", querystr);
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_TRACE,
|
||||
"Packet type\t%s",
|
||||
STRPACKETTYPE(packet_type));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (qtype) {
|
||||
case QUERY_TYPE_WRITE:
|
||||
#if defined(SS_DEBUG_)
|
||||
#if defined(SS_DEBUG_)
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_TRACE,
|
||||
"Query type\t%s, routing to Master.",
|
||||
STRQTYPE(qtype));
|
||||
#endif
|
||||
#endif
|
||||
ret = session->masterconn->func.write(session->masterconn, queue);
|
||||
atomic_add(&inst->stats.n_master, 1);
|
||||
goto return_ret;
|
||||
break;
|
||||
|
||||
case QUERY_TYPE_READ:
|
||||
#if defined(SS_DEBUG_)
|
||||
#if defined(SS_DEBUG_)
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_TRACE,
|
||||
"Query type\t%s, routing to Slave.",
|
||||
STRQTYPE(qtype));
|
||||
#endif
|
||||
#endif
|
||||
ret = session->slaveconn->func.write(session->slaveconn, queue);
|
||||
atomic_add(&inst->stats.n_slave, 1);
|
||||
goto return_ret;
|
||||
@ -458,12 +456,12 @@ static int routeQuery(
|
||||
|
||||
|
||||
case QUERY_TYPE_SESSION_WRITE:
|
||||
#if defined(SS_DEBUG_)
|
||||
#if defined(SS_DEBUG_)
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_TRACE,
|
||||
"Query type\t%s, routing to All servers.",
|
||||
STRQTYPE(qtype));
|
||||
#endif
|
||||
#endif
|
||||
/**
|
||||
* TODO! Connection to all servers must be established, and
|
||||
* the command must be executed in them.
|
||||
@ -484,12 +482,12 @@ static int routeQuery(
|
||||
break;
|
||||
|
||||
default:
|
||||
#if defined(SS_DEBUG_)
|
||||
#if defined(SS_DEBUG_)
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_TRACE,
|
||||
"Query type\t%s, routing to Master by default.",
|
||||
STRQTYPE(qtype));
|
||||
#endif
|
||||
#endif
|
||||
/** Is this really ok? */
|
||||
ret = session->masterconn->func.write(session->masterconn, queue);
|
||||
atomic_add(&inst->stats.n_master, 1);
|
||||
|
Reference in New Issue
Block a user