Commit graph

130 commits

Author SHA1 Message Date
Sergei Golubchik
935033aea7 fix wsrep test crashes on startup 2016-06-05 11:24:10 +02:00
Sergei Golubchik
562c1df7d9 cleanup: thread_count
move thread_count handling into THD:
* increment thread_count in THD constructor
* decrement thread_count in THD destructor
* never modify thread_count directly!
2016-06-04 09:06:00 +02:00
Nirbhay Choubey
de7eafc7ce MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno
- Validate the specified wsrep_start_position value by also
checking the return status of wsrep->sst_received. This also
ensures that changes in wsrep_start_position is not allowed
when the node is not in JOINING state.
- Do not allow decrease in seqno within same UUID.
- The initial checkpoint in SEs should be [0...:-1].
2016-05-31 20:37:00 -04:00
Monty
636bb59034 Final fixes for Memory_used
- Change some static variables to dynamic to ensure that we don't do any memory
  allocations before server starts or stops
- Print more memory information on SIGHUP. Fixed output.
- Write out if memory was lost if run with --debug-at-exit
- Fixed wrong #ifdef in sql_cache.cc
2016-04-28 17:15:38 +03:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Nirbhay Choubey
0251232f8c Fix to ensure updates in gtid_slave_state table do not get binlogged.
Also, renamed wsrep_skip_append_keys to wsrep_ignore_table.
Test case : galera.galera_as_slave_gtid.test
2016-02-24 23:32:37 -05:00
Nirbhay Choubey
cceec7858f Merge branch '10.0-galera' into bb-10.1-serg 2016-02-24 01:21:40 -05:00
Daniele Sciascia
ace86a2375 refs codership/mysql-wsrep#201
- Fixes query cache so that it is aware of wsrep_sync_wait.
  Query cache would return (possibly stale) results to the
  client, regardless of the value of wsrep_sync_wait.
- Includes the test case that reproduced the issue.
2016-02-22 17:46:22 -05:00
sjaakola
4bdf0258b6 refs MW-246
- skipping desync and resync before and after DDL execution in RSU mode, if wsrep_desync is set upfront
2016-02-17 16:02:57 -05:00
Monty
b3093073b1 Changed my_thread_id to int64 to fix compilation problem with
my_atomic_add32_explicit on windows
Fixed that server_audit.c also works if one compiles with safemalloc
Fixed compiler warnings
2016-02-08 22:34:41 +02:00
Monty
1ab711bebb Corrected freeing of thd when running with wsrep and thread pool
This is needed because of the new code where THD creation was moved to the new thread
2016-02-07 15:23:08 +02:00
Monty
3d4a7390c1 MDEV-6150 Speed up connection speed by moving creation of THD to new thread
Creating a CONNECT object on client connect and pass this to the working thread which creates the THD.
Split LOCK_thread_count to different mutexes
Added LOCK_thread_start to syncronize threads
Moved most usage of LOCK_thread_count to dedicated functions
Use next_thread_id() instead of thread_id++

Other things:
- Thread id now starts from 1 instead of 2
- Added cast for thread_id as thread id is now of type my_thread_id
- Made THD->host const (To ensure it's not changed)
- Removed some DBUG_PRINT() about entering/exiting mutex as these was already logged by mutex code
- Fixed that aborted_connects and connection_errors_internal are counted in all cases
- Don't take locks for current_linfo when we set it (not needed as it was 0 before)
2016-02-07 10:34:03 +02:00
Sergei Golubchik
a2330c820a MDEV-8208 Sporadic SEGFAULT on startup
different fix. remove old ones, wait for THD to be fully
initialized before continuing with the server startup process.

This reverts commits db2e21b, 13615c5, 3f515a0, 70113ee.
2016-01-25 17:04:09 +01:00
Sergei Golubchik
7697bf0bd7 Merge branch 'github/10.0-galera' into 10.1
Note: some tests fail, just as they failed before the merge!
2015-12-22 10:32:33 +01:00
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01:00
Philip Stoev
52a910395a refs codership/mysql-wsrep#202 Fix bad cherry-pick (and the compiler warnings it generated) 2015-10-19 04:14:51 -07:00
Philip Stoev
43b2a451fe refs codership/mysql-wsrep#202 Added schema info into wsrep messages
Added schema info to wsrep messages above debug level.
2015-10-19 01:56:04 -07:00
Nirbhay Choubey
ddb93b427e WSREP_TO_ISOLATION_BEGIN should be called with the table list. 2015-10-14 05:14:06 -04:00
Nirbhay Choubey
6927459e5b MDEV-8208: Sporadic SEGFAULT on startup
Addendum:
* Before calling THD::init_for_queries(), flip the current_thd to wsrep
thread so that memory gets allocated for the right THD.
* Use wsrep_creating_startup_threads instead of plugins_are_initialized
as the condition for the execution of THD::init_for_queries() within
start_wsrep_THD(), as use of latter could still leave some room for
race.
2015-09-25 18:50:57 -04:00
Nirbhay Choubey
59037d9629 MDEV-8208: Sporadic SEGFAULT on startup
Problem:
When mysqld starts as a galera node, it creates 2 system threads
(applier & rollbacker) using start_wsrep_THD(). These threads are
created before plugin initialization (plugin_init()) for SST methods
like rsync and xtrabackup.

The threads' initialization itself can proceed in parallel to mysqld's
main thread of execution. As a result, the thread initialization code
(start_wsrep_THD()) can end up accessing some un/partially initialized
structures (like maria_hton, in this particular case) resulting in
segfault.

Solution:
Fixed by calling THD::init_for_queries() (which accesses maria_hton)
only after the plugins have been initialized.
2015-09-25 18:24:39 -04:00
Nirbhay Choubey
4d33f9dca0 Merge branch '5.5-galera' into 10.0-galera 2015-09-25 14:57:56 -04:00
Nirbhay Choubey
db2e21bf3e MDEV-8208: Sporadic SEGFAULT on startup
Problem:
When mysqld starts as a galera node, it creates 2 system threads
(applier & rollbacker) using start_wsrep_THD(). These threads are
created before plugin initialization (plugin_init()) for SST methods
like rsync and xtrabackup.

The threads' initialization itself can proceed in parallel to mysqld's
main thread of execution. As a result, the thread initialization code
(start_wsrep_THD()) can end up accessing some un/partially initialized
structures (like maria_hton, in this particular case) resulting in
segfault.

Solution:
Fixed by calling THD::init_for_queries() (which accesses maria_hton)
only after the plugins have been initialized.
2015-09-16 23:20:57 -04:00
Nirbhay Choubey
bb52905432 MDEV-8034 : wsrep_node_address can't be IPV6
Updated address parsing logic to include IPv6 format.
2015-09-15 18:58:08 -04:00
sjaakola
63c5bee535 Refs codership/mysql-wsrep#113 - Extended the protection of local FLUSH
sessions to cover all exclusive MDL locks
2015-09-09 21:31:16 -04:00
sjaakola
c66609017b Refs codership/mysql-wsrep#113
Protecting non replicated FLUSH session from brute force aborts
2015-09-09 21:20:34 -04:00
Nirbhay Choubey
fa5f18d673 Merge branch '5.5-galera' into 10.0-galera 2015-09-09 20:51:39 -04:00
Alexey Yurchenko
4f4f3a5e32 Fixes codership/mysql-wsrep#118 2015-09-09 16:57:52 -04:00
Sergei Golubchik
41d68cabee cleanup: Log_event::write() and MYSQL_BIN_LOG::write_cache()
Introduce Log_event_writer() that encapsulates
writing data to an IO_CACHE with automatic checksum calculation.

Now all events properly checksum themselves as needed.

Use Log_event_writer in MYSQL_BIN_LOG::write_cache() instead
of copy-pasting its logic all over.

Later Log_event_writer will also do encryption.
2015-09-04 10:33:55 +02:00
Sergei Golubchik
2d2286faf3 cleanup: use enum_binlog_checksum_alg, not uint8
* fix unireg.h includes
* use enum_binlog_checksum_alg for binlog checksum variables,
  not uint8
2015-09-04 10:33:52 +02:00
Sergei Golubchik
a5b0a32ac3 Merge branch '10.0-galera' into 10.1 2015-09-03 16:32:00 +02:00
Monty
56aa19989f MDEV-6152: Remove calls to current_thd while creating Item
Part 5: Removing calls to current_thd in net_read calls, creating fields,
        query_cache, acl and some other places where thd was available
2015-09-01 18:42:02 +03:00
Nirbhay Choubey
5cf737c07a MDEV-8464 : ALTER VIEW not replicated in some cases
(Additional fix in 10.0-galera branch)
THD's lex->definer initially holds "*current_user" for
CURRENT_USER(). Use get_current_user() to get the real
current user.
2015-08-14 02:46:32 -04:00
Nirbhay Choubey
52f1543ef1 Fix for a memory leak. 2015-08-14 01:37:21 -04:00
Nirbhay Choubey
8a18bb9694 Merge branch '5.5-galera' into 10.0-galera 2015-08-14 01:17:57 -04:00
Nirbhay Choubey
af2f7ce3f9 MDEV-8464 : ALTER VIEW not replicated in some cases
In galera, like other DDLs, CREATE/ALTER VIEW commands are recreated
and replicated during parsing. The ALGORITHM clause is internally set
to VIEW_ALGORITHM_INHERIT if its not explicitly specified by the user.
But since its not a valid type to be used in a command, it leads to an
assertion failure. The solution is to not include the ALGORITHM clause
in the command if its not explicitly specified (or INHERIT).
2015-07-19 22:51:19 -04:00
Monty
872a953b22 MDEV-8469 Add RESET MASTER TO x to allow specification of binlog file nr
Other things:
- Avoid calling init_and_set_log_file_name() when opening binary log.
- Remove newlines early when reading from index file.
- Ensure that reset_logs() will work even if thd is 0 (Can happen on startup)
- Added thd to sart_slave_threads() for better error handling.
2015-07-16 10:36:58 +03:00
Nirbhay Choubey
dced5146bd Merge branch '10.0-galera' into 10.1 2015-07-14 16:05:29 -04:00
Nirbhay Choubey
70714d3597 Merge branch '5.5-galera' into 10.0-galera 2015-06-23 16:46:12 -04:00
Nirbhay Choubey
fc716dc5a5 MDEV-8260 : Issues related to concurrent CTAS
* Wait for aborted thd (victim) to release MDL locks
* Skip aborting an already aborted thd
* Defer setting OK status in case of CTAS
* Minor cosmetic changes
* Added a test case
2015-06-19 19:25:15 -04:00
Sergey Vojtovich
2b253ed41f MDEV-8324 - MariaDB fails to build with performance schema disabled
Various fixes to let MariaDB compile with performance schema disabled.
2015-06-19 15:06:33 +04:00
Nirbhay Choubey
903cfde149 MDEV-7067: Server outputs Galera (WSREP) information, even if Galera is disabled
* mysqld_safe: Since wsrep_on variable is mandatory in 10.1, skip wsrep
position recovery if its OFF.
* mysqld: Remove "-wsrep" from server version
* mysqld: Remove wsrep patch version from @@version_comment
* mysqld: Introduce @@wsrep_patch_version
2015-05-29 11:26:46 -04:00
Teemu Ollakka
00afd63984 refs codership/mysql-wsrep#90 made wsrep_OSU_method session variable 2015-05-08 17:41:07 -04:00
Teemu Ollakka
2df5ff2691 refs codership/mysql-wsrep#90 - fixed race in OSU
Make sure that thd uses the same method to begin and end
OSU operation.
2015-05-08 17:41:07 -04:00
Alexey Yurchenko
4ed9ddd30e Refs codership/mysql-wsrep#33
1. factored XID-related functions to a separate wsrep_xid.cc unit.
  2. refactored them to take refrences instead of pointers where appropriate
  3. implemented wsrep_get/set_SE_position to take wsrep_uuid_t and wsrep_seqno_t instead of XID
  4. call wsrep_set_SE_position() in wsrep_sst_received() to reinitialize SE checkpoint after SST was received, avoid assert() in setting code by first checking current position.
2015-05-08 17:41:06 -04:00
sjaakola
13a9bcc6be refs #11 #13 - skipping TOI, if all affected tables are temporary 2015-05-08 17:41:04 -04:00
Nirbhay Choubey
575dd77504 MDEV-7867: Add binlog header to GRA_.log file 2015-04-01 18:25:40 -04:00
Nirbhay Choubey
84a4db263a Merge branch '5.5-galera' into 10.0-galera 2015-03-28 17:29:10 -04:00
Nirbhay Choubey
d7445ea6df MDEV-7194: galera fails to replicate DDL queries when using binlog_checksum
Restore fix for MDEV-4328 (revno: 3391) that got accidentally
overwritten while merging :
http://bazaar.launchpad.net/~codership/codership-mysql/5.5-23/revision/3900

Added a test case.
2015-03-27 20:35:37 -04:00
Nirbhay Choubey
34d86ac9ff MDEV-6594: Use separate domain_id for Galera transactions 2015-02-27 22:33:41 -05:00
Sergei Golubchik
8e7649867f Merge 10.0-galera into 10.1 2015-02-06 16:14:23 +01:00