d403018fd9Surrounded every log writing command with LOGIF macro, which tests if the given logfile id matches with those enabled. The comparison is done against local variable and expensive function call is avoided.
vraatikka
2013-12-12 16:14:33 +02:00
272ca036e4log_manager.h Added macros which allow for testing locally if log is enabled or not.
vraatikka
2013-12-12 07:05:38 +02:00
06ebc6f4b5Added QUERY_TYPE_GLOBAL_WRITE for writes which don't reflect on binary log, but need to be present in every back-end server once executed.
vraatikka
2013-12-11 14:34:01 +02:00
a016a4aa96server/core/Makefile Added librt (-lrt), required for building MaxScale with static libmysqld in some platforms (CentOS 6)
Massimiliano Pinto
2013-12-10 10:23:35 +01:00
a673fc9c48Read-write split router doesn't handle QUERY_TYPE_SESSION_WRITE in any special way. Behavior defaults to same as in the case of QUERY_TYPE_WRITE. That is, modification is executed in master only.
vraatikka
2013-12-09 15:30:47 +02:00
10eafd61bcAdded more information to error message in case where mysql_error provides wrong error message.
vraatikka
2013-12-09 13:35:45 +02:00
1c55a4cee7Added a hint for the user in case the libmysqld fails to init.
vraatikka
2013-12-09 11:58:06 +02:00
f50de7a084build_gateway.inc Removed MARIADB_SRC_PATH Added MYSQL_ROOT - root directory where MariaDB headers are installed Added MYSQL_HEADERS - -I notation for three header directories Added EMBEDDED_LIB - for embedded library directory Added ERRMSG - for errmsg.sys file
vraatikka
2013-12-06 00:12:41 +02:00
258bcb27dalog_manager.cc Added global variable lm_enabled_logfiles_bitmask which holds a bit for each enbaled logfile. It is updated when situation changes.
vraatikka
2013-12-04 09:56:48 +02:00
84fbf15befUpdates configuration for backward compatibility and improved error handling
Mark Riddoch
2013-12-02 15:14:52 +00:00
37426a8be6Updated in line with changes made to the code by Vilho
Mark Riddoch
2013-12-02 10:09:04 +00:00
4a006dd707Log manager is initialized before configu file name resolution so that if home directory is successfully set, further issues would be logged in log files located under home directory instead of /tmp/..
vraatikka
2013-12-01 21:37:40 +02:00
6d0d85396eAdded global default configuration file name "etc/MaxScale.cnf"
vraatikka
2013-11-29 23:49:37 +02:00
41298a09dfBugzilla entry # 363: skygw_thread_t and simple_mutex_t make own copy of name argrument. Changed init calls to both accordingly.
vraatikka
2013-11-27 10:51:45 +02:00
f9a2a75987Removed specific version number from MariaDB source path. Replaced it with 'mariadb/5.5' because 5.5 is supported and all existing versions still have serious issues. First possibly working version is 5.5.35 which isn't released yet.
vraatikka
2013-11-26 16:57:25 +02:00
4057ae0b0flog_manager.cc renamed file_exists to file_exists_and_is_writable, added missing file open flags.
vraatikka
2013-11-26 16:52:48 +02:00
8951f446ac- Removed the MARIADB_SRC_PATH twice set. - Removed team member names from path examples
Massimiliano Pinto
2013-11-26 12:49:29 +01:00
973a9a34d7Added comment about '-m <modules directory>'
vraatikka
2013-11-26 13:07:14 +02:00
bc97b7f5eclog_manager.cc external optind variable must be reset before using it because getopt may have been called earlier in the same process and without resetting argument parsing fails.
vraatikka
2013-11-26 12:53:46 +02:00
f88969c214Code tidyup
Mark Riddoch
2013-11-25 16:53:17 +01:00
1437d3f18aUpdate to arguemnt parsing
Mark Riddoch
2013-11-25 15:50:56 +00:00
050ca7ac7eSome fixes for doxygen generation
Mark Riddoch
2013-11-25 10:12:08 +01:00
3b0d6c23adlog_manager.cc Commented why spread-down logging is disabled. In MaxScale start, log paths are printed in their complete form to make it easier to copy-paste the names.
vraatikka
2013-11-25 10:49:45 +02:00
4f14c65040Polished error mesesages, and made them consistent.
vraatikka
2013-11-22 21:17:38 +02:00
841c51fc5cPolished error messages in main, and made them consistent.
vraatikka
2013-11-22 12:01:41 +02:00
323fb8164emysql_send_auth_error didn't check whether dcb is in DCB_STATE_POLLING state. If it is, function now returns.
vraatikka
2013-11-21 15:35:55 +02:00
4ed4419327mysql_send_custom_error writes to client dcb but didn't check whether it was in the correct state.
vraatikka
2013-11-21 09:47:02 +02:00
a30e2ab29bAdded back read and write mutex to dcb. Locks are acquired in poll.c before calling call-back functions. Additional locks efficiently hide memory corruption issue, which appears when readconn router is used without using those mutexes, with multiple parallel maxscale threads and intensive load.
vraatikka
2013-11-20 17:23:04 +02:00
35d34862b9Replaced with MaxScale_template.cnf
vraatikka
2013-11-20 16:07:12 +02:00
4b1527b1c8query_classifier.cc Replaced fprintf's with log write commands, removed the second argument from call of mysql_reset_thd_for_next_command(thd) according to changes in mariadb/5.5/sql/sql_parse.c #rev 3958.
vraatikka
2013-11-20 15:55:43 +02:00
1c96824cb3log_manager.cc Declared program_invocation_name, and program_invocation_short_name. They are used as identifier strings in syslog logging in cases where log_manager is not initialized explicitly and/or the caller hasn't specified program name as one of the arguments in arguments array.
vraatikka
2013-11-13 22:08:10 +02:00
1a3fa578daFixed snprint_timestamp function which left one byte garbage to log file.
vraatikka
2013-11-12 17:49:28 +02:00
836c7ad76dRemoved erroneous Warning print. Monitor users and passwords are read in different place.
vraatikka
2013-11-12 15:20:04 +02:00
4487817f59Renamed shutdown_maxscale to shutdown_server according to definition in gateway.c.
vraatikka
2013-11-12 11:51:31 +02:00
517b6a5ee3Added argument '-m' to skygw_logmanager_init which takes the identity string for syslog as additional argument. If syslog is enabled in configuration, but identity is not specified, host process name is used. 'maxscale', for example.
vraatikka
2013-11-11 11:02:05 +02:00
b996631fc9log_manager.cc Added syslog support. There's a new argument '-l' which takes log file ids as additional arguments. Writes to those logs will be written to syslog as well. syslog write causes additional overhead. Thus, writing frequently may become a bottleneck.
vraatikka
2013-11-10 20:45:48 +02:00
9ba7a0d955log_manager.cc Added new argument '-s' which takes additional argument composed of list of logfile identifiers. Logfiles listed with '-s' will be written on main memory instead of disk. In practice, the log file in question will be written in /dev/shm but corresponding symlink is added to log directory. In the case of name conflicts with log files and links, a differentiating sequence number is included in hte name of the file. This, however, is done only when existing file is not writable or is of different type (symlink <> file). Added new logfile LOGFILE_DEBUG whose contents will be largerly what was included up to date in trace log.
vraatikka
2013-11-08 12:56:39 +02:00
594f1c294fAdded include of stdlib.h because malloc needs it to work. Malloc time to time fails in server/core/buffer.c and produces the following error:
vraatikka
2013-11-03 20:54:41 +02:00
38b44a3a3agw_client_hangup_event, didn't take into account the possibility that session_alloc had failed in which case the session pointer of client dcb is NULL.
vraatikka
2013-10-31 22:57:04 +02:00
3769a02957query_classifier.cc resolve_query_type, added GSYSVAR_FUNC type for functions that read system variables and can be executed in Maxscale instead of backend server.
vraatikka
2013-10-31 22:24:51 +02:00
e803acb036dcb.c, gateway.c little tuning. poll.c Removed mutex from epoll_wait. Removed read and write mutexes from poll_waitevents.
vraatikka
2013-10-30 22:07:51 +02:00
5e6b0a3b1aIncluded log_manager in query classifier's makefile, replaced fprintf's with log manager commands.
vraatikka
2013-10-28 10:44:05 +02:00
f32cfe8546query_classifier.cc resolve_query_type, traverse through the list of items of thd->free_list, identify functions and reason query type according to the function type. This phase can only increase the restrictiviness level of the query.
vraatikka
2013-10-25 11:55:45 +03:00
2cbe46b506gwbuf_consume is protected by spinlock
Massimiliano Pinto
2013-10-24 17:53:38 +02:00
241a0a6175Used sizeof operator for calculating the length of a string.
vraatikka
2013-10-24 10:51:54 +03:00
ddab34fe72mysql_libraray_init failed due to invalid datadir setting. Fixed this by setting the working directory/data as data directory.
vraatikka
2013-10-23 14:16:50 +03:00
1ef015196bAnother case where gw_write fails in EAGAIN/EWOULDBLOCK.
vraatikka
2013-10-16 22:30:59 +03:00
81b52c6256If gw_write returns -1 with errno EAGAIN or EWOULDBLOCK it is not treated like an error.
vraatikka
2013-10-16 21:59:22 +03:00
44c7914f2bIncreased size of following arrays to prevent memory overwrites: dcb_fake_write_errno, dcb_fake_write_ev, conn_open. Note that these are use in DEBUG build only.
vraatikka
2013-10-16 17:32:30 +03:00
a696e041e0gateway.c file_write_footer, added checks for the case of failed memory allocation.
vraatikka
2013-10-16 17:13:50 +03:00
76af245eacAdded the \0 byte to user and db in musql_session
Massimiliano Pinto
2013-10-16 11:01:16 +02:00
94c37799b1dcb.c dcb_write earlier returned an error (== 0) if errno was not set and other conditions were satisfied. In practice, if write was done in write queue, queue pointer was not updated and dcb_write returned and error. Changed the error detection condition so that it requires errno being set, at least.
vraatikka
2013-10-16 08:29:22 +03:00
4db366290dRemoved 'datadir' value from libmysqld's start-up parameters to make it start.
vraatikka
2013-10-15 22:18:59 +03:00
52644db8cetestmain.c Removed embedded server startup parameter '--skip-innodb' and replaced TRUE, and FALSE with true and false, respectively. gateway.c Removed embedded server startup parameter '--skip-innodb' because libmysqld inside MariaDB 5.5.33 + doesn't start with that paramter.
vraatikka
2013-10-15 18:18:09 +03:00
b5da527555myql_common.c:gw_send_change_user_to_backend checks func.write for 0 and 1
Massimiliano Pinto
2013-10-14 18:41:49 +02:00
121cff7ffaGalera cluster status is Synced, all affected files are updated
Massimiliano Pinto
2013-10-14 15:29:26 +02:00
66dbb8ec23dcb.c dcb_write, if write failed, gwbuf wasn't freed. mysql_backend.c gw_MySQLWrite_backend, if dcb wasn'r in POLLING state then write was skpiped but gwbuf wasn't freed. mysql_client.c gw_MySQLWrite_client, disabled the use of dcb_write because it returns different values than the code it replaced. Also removed erroneous call of gwbuf_consume. mysql_common.c mysql_send_custom_error, removed erroneous call of gwbuf_free.
vraatikka
2013-10-14 15:12:30 +03:00
0f2eeff243gw_buffer was not freed.
vraatikka
2013-10-14 13:16:33 +03:00
42417797a9freeSession, trace log write referenced to backend_dcb which may be freed.
vraatikka
2013-10-12 12:40:49 +03:00
1f0e8d5c56Fixed: use row[1] instead of row[0] in monitorDatabase()
Massimiliano Pinto
2013-10-11 09:02:49 +02:00
cd507f1461log_manager.cc blockbuf_get_writepos, when all existing buffers in blockbuf list are full, a new block buffer is created and added to the list. Adding to the list is done with mutex on hold. Mutex shouldn't be freed before the next iteration in while loop, which expects that bblist mutex is on hold. At the end of the function, removed an unnecessary debug assertion.
vraatikka
2013-10-10 16:46:51 +03:00
e1c7887726gw_MySQLWrite_client is now simply a call to dcb_write
Massimiliano Pinto
2013-10-07 16:34:15 +02:00
655a6537b2mysql_client_server_protocol.h : changed gw_receive_backend_auth declaration to return int instead of boolean. mysql_backend.c: gw_read_backend_event calls gw_receive_backend_auth which either fails (== -1), succeeds with nothing to read (== 0) or succeeds (== 1). For each case there is handling. If dcb_read succeeds without read bytes, return asap. mysql_client.c: gw_error_client_event, gw_client_close, gw_client_hangup_event : all close client dcb but now they also close backend dcb. mysql_common.c: gw_receive_backend_auth, return -1, 0, or 1 if read from backend failed, was empty, or succeed, respectively.:
vraatikka
2013-10-07 14:00:44 +03:00
80b67d1083log_manager.cc: State update for filewriter was missing and that caused Maxscale to fail if opening of any log file failed. dcb.c: Added EAGAIN and EWOULDBLOCK handling to dcb_read. If dcb_close is called for freshly created dcb, dcb is only freed. gateway.c: Added file_write_footer and write_footer of which the latter is called at exit time. It simply draws a line to screen. gw_utils.c: Some macros for helping comparison between gw_read_gwbuff and dcb_read, which overlap. poll.c: Some macros to help enable/disable mutexing in poll_waitevents service.c: Check return value of listen and session_alloc and behave accordingly.
vraatikka
2013-10-06 22:31:32 +03:00
e3a4be8b9dgw_write_backend_event, if dcb is not in POLLING state but writeq is NULL it is ok. Only attempt to write when dcb's socket isn't open anymore is failure.
vraatikka
2013-10-04 16:44:21 +03:00
849a366e95log_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.
vraatikka
2013-10-04 12:06:44 +03:00
9f2f0ac006session = dcb->session; was missing in the previous check in mysql_client.c:gw_read_client_event()
Massimiliano Pinto
2013-10-02 15:42:55 +02:00
37bd63b33bDetected closed socket in mysql_client.c:gw_read_client_event now calls the closeSession.
Massimiliano Pinto
2013-10-02 11:15:04 +02:00
c55ca0aaeeBacked dcb close if now forced after routing COM_QUERY and close client dcb, in mysql_client.c gw_read_client_event
Massimiliano Pinto
2013-10-02 09:27:10 +02:00
440a4c7278Missing argument in log command caused maxscale to fail.
vraatikka
2013-09-30 12:36:08 +03:00
701830f0abLogging related (mostly) sanity checks and fixes. - Checked argument types and counts - Removed trailing line feeds - Removed thread ids from error logs (they are used in trace / debug log - Added some state information to dcbs - Added prefix 'Error' or 'Fatal' to error logs. - Switches all error logs to use flushing log write.
vraatikka
2013-09-30 11:14:36 +03:00
c48dd6028fModified dcb_read return: n = 0 means 0 bytes read without errors
Massimiliano Pinto
2013-09-27 19:24:23 +02:00