log_manager.cc :

tuned error printing and log writing output format
dcb.c : 
	dcb_connect, check return value of poll_add_dcb and behave accordingly.
	dcb_write, in case of SIFPIPE, only write to trace log.
	dcb_close, dassert with incorrect dcb states.
gateway.c :
	added file_write_header to print header similar than in logs to stderr.
	main, add signal handler for SIGPIPE
poll.c : 
	poll_remove_dcb, don't fail if dcb is in NOPOLLING or in ZOMBIE states.
	poll_waitevents, write EPOLLHUPs to trace log, don't even attempt to write to closed socket.
readconnection.h : 
	shortened comment.
readwritesplit.h : 
	replaced generic names with more specific ones. 
httpd.c : 
	Check listen return value and behave accordingly.
mysql_backend.c : 
	 Tiny clean up.
mysql_client.c : 
	gw_MySQLListener, Check listen return value and behave accordingly. 
mysql_common.c : 
	Shortened a header.
telnetd.c : 
	telnetd_listen, check listen return value and behave accordingly.
readconnroute.c : 
	Tuned log writing format.
readwritesplit.c : 
	Added function search_backend_servers, which chooses suitable backend and master server among those known by Maxscale. Fixed clean-up routines. Not ready yet but works somehow.
testroute.c : 
	Cleanup.
skygw_utils.cc : 
	Log writing clean up.
This commit is contained in:
vraatikka
2013-10-04 12:06:44 +03:00
parent 9f2f0ac006
commit 849a366e95
14 changed files with 955 additions and 533 deletions

View File

@ -46,7 +46,7 @@ typedef struct backend {
*/
typedef struct router_client_session {
BACKEND *backend; /**< Backend used by the client session */
DCB *backend_dcb; /**< DCB Connection to the backend */
DCB *backend_dcb; /**< DCB Connection to the backend */
struct router_client_session
*next;
} ROUTER_CLIENT_SES;
@ -67,7 +67,7 @@ typedef struct router_instance {
SERVICE *service; /**< Pointer to the service using this router */
ROUTER_CLIENT_SES *connections; /**< Link list of all the client connections */
SPINLOCK lock; /**< Spinlock for the instance data */
BACKEND **servers; /**< The set of backend servers for this router*/
BACKEND **servers; /**< List of backend servers */
unsigned int bitmask; /**< Bitmask to apply to server->status */
unsigned int bitvalue; /**< Required value of server->status */
ROUTER_STATS stats; /**< Statistics for this router */

View File

@ -31,28 +31,26 @@
#include <dcb.h>
typedef struct client_session CLIENT_SESSION;
typedef struct instance INSTANCE;
/**
* Internal structure used to define the set of backend servers we are routing
* connections to. This provides the storage for routing module specific data
* that is required for each of the backend servers.
*/
typedef struct backend {
SERVER* server; /**< The server itself */
int count; /**< Number of connections to the server */
SERVER* backend_server; /**< The server itself */
int backend_conn_count; /**< Number of connections to the server */
} BACKEND;
/**
* The client session structure used within this router.
*/
struct client_session {
BACKEND* slave; /**< Slave used by the client session */
BACKEND* master; /**< Master used by the client session */
DCB* slaveconn; /**< Slave connection */
DCB* masterconn; /**< Master connection */
CLIENT_SESSION* next;
};
typedef struct router_client_session {
BACKEND* be_slave; /**< Slave backend used by client session */
BACKEND* be_master; /**< Master backend used by client session */
DCB* slave_dcb; /**< Slave connection */
DCB* master_dcb; /**< Master connection */
struct router_client_session* next;
} ROUTER_CLIENT_SES;
/**
* The statistics for this router instance
@ -60,24 +58,26 @@ struct client_session {
typedef struct {
int n_sessions; /**< Number sessions created */
int n_queries; /**< Number of queries forwarded */
int n_master; /**< Number of statements sent to master */
int n_slave; /**< Number of statements sent to slave */
int n_all; /**< Number of statements sent to all */
int n_master; /**< Number of stmts sent to master */
int n_slave; /**< Number of stmts sent to slave */
int n_all; /**< Number of stmts sent to all */
} ROUTER_STATS;
/**
* The per instance data for the router.
*/
struct instance {
SERVICE* service; /**< Pointer to the service using this router */
CLIENT_SESSION* connections; /**< Link list of all the client connections */
SPINLOCK lock; /**< Spinlock for the instance data */
BACKEND** servers; /**< The set of backend servers for this instance */
BACKEND* master; /**< NULL if not known, pointer otherwise */
ROUTER_STATS stats; /**< Statistics for this router */
INSTANCE* next;
};
typedef struct router_instance {
SERVICE* service; /**< Pointer to service */
ROUTER_CLIENT_SES* connections; /**< List of client connections */
SPINLOCK lock; /**< Lock for the instance data */
BACKEND** servers; /**< Backend servers */
BACKEND* master; /**< NULL or pointer */
unsigned int bitmask; /**< Bitmask to apply to server->status */
unsigned int bitvalue; /**< Required value of server->status */
ROUTER_STATS stats; /**< Statistics for this router */
struct router_instance* next; /**< Next router on the list */
} ROUTER_INSTANCE;
#endif