50 Commits

Author SHA1 Message Date
vraatikka
9d6b13c288 Replaced macros with enumereted type. 2013-08-31 12:04:02 +03:00
Mark Riddoch
a445b6ff37 Fixes for NULL test for function returns such as malloc() - as reported by Coverity 2013-08-29 13:34:21 +02:00
vraatikka
527df6c7f3 Merge, mostly. 2013-08-28 23:26:09 +03:00
vraatikka
48165bf5cd Removed unused protocol_mutex and references to it. 2013-08-28 23:25:27 +03:00
vraatikka
50a3cfdf49 Commented out some dead code. 2013-08-28 23:17:18 +03:00
vraatikka
786468fc5d Added status checks, removed some dead code, changed macros to enumerated types, renamed variables to reflect better what they mean. 2013-08-28 22:59:53 +03:00
Massimiliano Pinto
ff109c6319 dcb->state set wheere missing or changed 2013-08-27 10:52:43 +02:00
Massimiliano Pinto
d0d68a69ca Added DCB_STATE_XXX in EPOLLIN/EPOLLOUT handlers and in accept() 2013-08-27 10:08:03 +02:00
vraatikka
49036894f5 In gw_connect_to_backend, first create socket, and establish socket connection, then in the end, dcb is added to epoll set. 2013-08-24 00:18:46 +03:00
vraatikka
df5f2f29b2 Removed undefined function declaration. Added trace and error log. 2013-08-23 23:25:12 +03:00
vraatikka
e345b23bcf Merge 2013-08-23 22:47:16 +03:00
vraatikka
0a182913a1 in gw_MySQLAccept moved authentication packet send before adding new dcb to epoll set. 2013-08-23 22:39:42 +03:00
vraatikka
0612dae890 Added error log printing. 2013-08-23 22:31:08 +03:00
Massimiliano Pinto
52c30c3e58 Removed dcb->state set after func.close() 2013-08-23 14:17:00 +02:00
vraatikka
68a5a389ee Removed SS_DEBUG macros around necessary include directives. 2013-08-23 13:42:10 +03:00
vraatikka
481096ccef Added trace log to newSession and to closeSession. 2013-08-22 10:46:14 +03:00
vraatikka
0401290021 Added spinlock ses_lock to struct SESSION to ensure that for each session closeSession is called only once.
closeSession is called from mysql_backend.c:gw_read_backend_event, and from dcb.c:dcb_close.

This is part of Bug #163.
2013-08-22 10:42:18 +03:00
vraatikka
8dfd5de923 Fix merge 2013-08-22 00:01:44 +03:00
Jan Lindström
b6ba1954f5 Merge 2013-08-19 08:48:33 +03:00
Mark Riddoch
2135a76f7b Bug 172 - Compile errors in Galera Monitor 2013-08-21 17:25:43 +02:00
Mark Riddoch
1a18632920 Move fprintf to log 2013-08-21 16:35:01 +02:00
Mark Riddoch
4e41fc49f5 Bug 166 - NULL pointer dereferenced if candidate server is NULL 2013-08-21 12:08:41 +02:00
Mark Riddoch
2499378af9 Bug 160 - fixed freeing of username 2013-08-21 12:06:31 +02:00
Massimiliano Pinto
73ffa5a648 dcb->data is allocated before poll_add_dcb in httpd_accept()
This will prevent dcb->data to be NULL with threads
2013-08-20 11:37:57 +02:00
vraatikka
21dabda848 Removed redundant log writings. 2013-08-20 10:49:35 +03:00
vraatikka
2ad0b12d79 Check dcb->status and set new state with writeqlock on. 2013-08-19 19:41:47 +03:00
vraatikka
ea79b38e4f Check return value of dcb_read and if it failed, don't access head of linked list. 2013-08-19 19:39:47 +03:00
Mark Riddoch
0021eddfee Bug 154 - Added warning if options are set for the read/write splitter and updated example config file. 2013-08-19 15:53:08 +02:00
vraatikka
05a3978442 Modified gw_read_client_event so that it only calls mysql_send_ok after new sessions has been set up and initialized. 2013-08-19 13:02:04 +03:00
vraatikka
97b3da1d79 Added simple_mutex_t dcb->mutex to DCB struct to protect processing of single dcb in poll.c:poll_waitevents. This is a coarse locking but seems to work with multiple threads at least with very simple load.
Added trace logging to many locations.
2013-08-16 23:52:10 +03:00
Mark Riddoch
fbc311730c Bug 124: Add log message when an invalid router option is supplied 2013-08-13 15:14:32 +02:00
Jan Lindström
2e11a26f41 Fixed bug on candidate selection. I misinterpreted count and n_connections variables. Thus, renamed count as current_connection_count to make it more understandable. 2013-08-13 12:12:19 +03:00
Jan Lindström
c1c8bf9fc5 Removed unnecessary loop of servers. Now we loop over all the servers, if running server is found and candidate is not set we set that server as candidate. If candidate is set and we find any that have fewer connections than our candidate server. If a server has less connections than the current candidate we mark this as the new candidate to connect to. If a server has the same number of connections currently as the candidate and has had less connections over time than the candidate it will also become the new candidate. This has the effect of spreading the connections over different servers during periods of very low load. 2013-08-13 11:55:34 +03:00
vraatikka
2d31d9ff5b Initialized addr length indicator in telnetd_accept 2013-08-12 21:06:44 +03:00
vraatikka
0c5125a44d Typos 2013-08-12 13:11:05 +03:00
Massimiliano Pinto
7522eb617d Added enable/disable commands, now for log_witer only 2013-08-09 15:12:23 +02:00
vraatikka
6c106bb9be Removed #if defined(SS_DEBUG) macros around trace log print commands. Trace log is disabled by default but it is meant to be possible to enable it with other than debug build only. 2013-08-09 15:27:02 +03:00
vraatikka
1ab8420e91 Added an example to user command : help show dbusers and removed erroneous complain about unknown subcommand if show dbusers is called without arguments. 2013-08-08 15:46:33 +03:00
vraatikka
d94153c29f If maxscale is compiled with DEBUG=Y readconnrouter module writes slave selection info to trace log. Example:
SkySQL MaxScale Thu Aug  8 00:01:08 2013
------------------------------------------
2013 08/08 00:01:17  Selected server in port 3003 to as candidate. Connections : 0 
2013 08/08 00:01:17  Examine server in port 3002 with 0 connections. Status is 5, inst->bitvalue is 6
2013 08/08 00:01:17  Examine server in port 3001 with 0 connections. Status is 5, inst->bitvalue is 6
2013 08/08 00:01:17  Examine server in port 3000 with 0 connections. Status is 3, inst->bitvalue is 6
2013 08/08 00:01:17  Final selection is server in port 3003. Connections : 1 
2013 08/08 00:01:22  Selected server in port 3003 to as candidate. Connections : 1 
2013 08/08 00:01:22  Examine server in port 3002 with 0 connections. Status is 5, inst->bitvalue is 6
2013 08/08 00:01:22  Examine server in port 3001 with 0 connections. Status is 5, inst->bitvalue is 6
2013 08/08 00:01:22  Examine server in port 3000 with 0 connections. Status is 3, inst->bitvalue is 6
2013 08/08 00:01:22  Final selection is server in port 3002. Connections : 1
2013-08-08 00:10:33 +03:00
Massimiliano Pinto
75e7de182f fprintf debug for added backend connection is protected by if (backend->fd > 0) 2013-08-07 09:39:29 +02:00
vraatikka
cae4d38a7e Removed unnecessary argument from log manager commands because it is not used and it is always NULL. 2013-08-04 23:30:47 +03:00
vraatikka
b3302b1bad Renamed reload users to reload dbusers. 2013-08-03 23:29:45 +03:00
vraatikka
26e4422c4d Removed shutdown gateway command from debug commands 2013-08-03 23:21:21 +03:00
vraatikka
ca3638ae2c Added 'remove user' to client API. New functions are
debugcmd.c : telnetdRemoveUser
adminusers.c : admin_remove_user

Also renamed admin_test_user to admin_search_user .
2013-08-02 23:03:43 +03:00
Massimiliano Pinto
3357748aad Some typos fixed 2013-08-02 10:00:56 +02:00
Massimiliano Pinto
ce8ce5b8fd Added a check for candidate server, if NULL return 2013-07-31 16:18:45 +02:00
vraatikka
b71b22b18a Removed dependency files because they are now created as a part of makefile processing. 2013-07-30 15:07:50 +03:00
vraatikka
f3cf1d703e Removed depend.mk files. Added command 'touch depend.mk' to each Makefile which attempts to include depend.mk. That is for the makefile process phase where only the existence of depend.mk is checked. Later the real file is created in 'depend' target. 2013-07-30 11:43:39 +03:00
skysql
636e5b619c fix Makefile to comply with new dirs 2013-07-29 09:39:46 +03:00
Timofey Turenko
a7c82310f9 moving files to /server to make merge possible 2013-07-28 05:31:11 +00:00