Commit graph

88 commits

Author SHA1 Message Date
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Marko Mäkelä
4e7b382d31 Merge 10.1 to 10.2
Most conflicts are related to the MDEV-11638 InnoDB shutdown refactoring.
2017-01-05 10:48:03 +02:00
Sachin Setiya
b4616c40be MDEV-7955 WSREP() appears on radar in OLTP RO
This commit is for optimizing WSREP(thd) macro.

#define WSREP(thd) \
  (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))

In this we can safely remove wsrep and thd. We are not removing WSREP_ON
because this will change WSREP(thd) behaviour.

Patch Credit:- Nirbhay Choubay, Sergey Vojtovich
2017-01-03 10:45:55 +05:30
Sachin Setiya
0c79de2419 MDEV-11479 Improved wsrep_dirty_reads
Tasks:-
         Changes in wsrep_dirty_reads variable
         1.) Global + Session scope (Current: session-only)
         2.) Can be set using command line.
         3.) Allow all commands that do not change data (besides SELECT)
         4.) Allow prepared Statements that do not change data
         5.) Works with wsrep_sync_wait enabled
2016-12-14 09:30:43 +05:30
Nirbhay Choubey
3575618237 Post merge fixes. 2016-08-25 21:28:26 -04:00
Nirbhay Choubey
90266e8a0e Merge branch '10.0-galera' into bb-10.1-serg 2016-08-25 15:39:39 -04:00
sjaakola
5996c7baad refs: MW-279
- At startup time global wsrep_on is set too late and some wsrep paths may be executed
  because of this. e.g. replication slave restart could happen before wsrep_on state is defined.
- This fix checks both global wsrep_on and wsrep_provider values to determine if wsrep
  processing should happen
- Fix affects all instances where WSREP_ON macro is used
2016-08-21 16:17:14 -04:00
sjaakola
d246630d73 Refs MW-252
- changed the condition when to do implicit desync as part of FTWRL to
  cover only case when node is PC and synced. Donor node has alreaydy desycned
  and other states mean that node is not in cluster, so desync is not even possible.
2016-08-21 16:17:05 -04:00
sjaakola
8ec50ebda3 Refs MW-252
- reverted from tracking donor servicing thread. With xtrabackup SST,
  xtrabackup thread will call FTWRL and node is desynced upfront
- Skipping desync in FTWRL if node is operating as donor
2016-08-21 16:17:02 -04:00
Nirbhay Choubey
7f9fcfe00e Code cleanup (wsrep patch). 2016-06-27 18:07:43 -04: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
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
Nirbhay Choubey
18173ddfc4 MDEV-9162 : MariaDB Galera Cluster memory leak on async slave node
As galera node (slave) received query log events from an async
replication master, it partially wrote the updates made to replication
state table (mysql.gtid_slave_pos) to galera transaction writeset post
TOI. As a result, the transaction handle, thus created within galera,
was never freed/purged as the corresponding trx did not commit.
Thus, it kept piling up for every query log event and was only reclaimed
upon server shutdown when the transaction map object got destructed.
Fixed by making sure that updates in replication slave state table
are not written to galera transaction writeset and thus, not replicated
to other nodes.
2015-12-14 11:33:52 -05:00
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01: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
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
6d3bd6588e MDEV-8492: Windows builds fail on current 10.1
In non-wsrep builds, wsrep_running_threads should be defined to (0).
2015-07-19 21:33:12 -04:00
Nirbhay Choubey
dced5146bd Merge branch '10.0-galera' into 10.1 2015-07-14 16:05:29 -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
Teemu Ollakka
0115ca2ae1 refs codership/mysql-wsrep#98 fixed sidno initialization
Sidno initialization was skipped in wsrep_sst_received() if the
received position matched to current position. However, sidno
initialization must be done every time server is started to
add inverted group uuid into sidno map.
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
Nirbhay Choubey
44b44dd1d7 Comments for wsrep_exec_mode's. 2015-04-22 18:30:27 -04:00
Nirbhay Choubey
575dd77504 MDEV-7867: Add binlog header to GRA_.log file 2015-04-01 18:25:40 -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
Monty
0ee879ff8a Improve performance for calculating memory allocation
Extend interface for 'show variables' with current scope
2015-02-01 15:24:22 +02:00
Nirbhay Choubey
369c02674c MDEV-7053: WSREP_STATUS & WSREP_MEMBERSHIP I_S tables
wsrep_info INFORMATION_SCHEMA plugin to provide WSREP_STATUS
and WSREP_MEMBERSHIP tables.
2014-11-22 14:33:51 -05:00
Sergei Golubchik
03ec3511a8 cleanup: galera misc cleanups
also disable galera-specific output in mysql_tzinfo_to_sql,
it'll be enabled later.
2014-10-10 22:27:36 +02:00
Sergei Golubchik
8596b70f96 cleanup: simplify the usage of WSREP_FORMAT macro 2014-10-10 22:27:36 +02:00
Nirbhay Choubey
542968cf0a bzr merge -r4015..4026 codership/5.5 2014-10-09 18:28:14 -04:00
Monty
cc8aed3eb7 MDEV 4427: query timeouts
Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired.

- Added timer functions based on pthread_cond_timedwait
- Added kill_handlerton() to signal storage engines about kill/timeout
- Added support for GRANT ... MAX_STATEMENT_TIME=#
- Copy max_statement_time to current user, if stored in mysql.user
- Added status variable max_statement_time_exceeded
- Added KILL_TIMEOUT
- Removed digest hash from performance schema tests as they change all the time.
- Updated test results that changed because of the new user variables or new fields in mysql.user

This functionallity is inspired by work done by Davi Arnaut at twitter.
Test case is copied from Davi's work.

Documentation can be found at
https://kb.askmonty.org/en/how-to-limittimeout-queries/

mysql-test/r/mysqld--help.result:
  Updated for new help message
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysql-test/suite/sys_vars/r/max_statement_time_basic.result:
  Added testing of max_statement_time
mysql-test/suite/sys_vars/t/max_statement_time_basic.test:
  Added testing of max_statement_time
mysql-test/t/max_statement_time.test:
  Added testing of max_statement_time
mysys/CMakeLists.txt:
  Added thr_timer
mysys/my_init.c:
mysys/mysys_priv.h:
  Added new mutex and condition variables
  Added new mutex and condition variables
mysys/thr_timer.c:
  Added timer functions based on pthread_cond_timedwait()
  This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime()
sql/lex.h:
  Added MAX_STATEMENT_TIME
sql/log_event.cc:
  Safety fix (timeout should be threated as an interrupted query)
sql/mysqld.cc:
  Added support for timers
  Added status variable max_statement_time_exceeded
sql/share/errmsg-utf8.txt:
  Added ER_QUERY_TIMEOUT
sql/signal_handler.cc:
  Added support for KILL_TIMEOUT
sql/sql_acl.cc:
  Added support for GRANT ... MAX_STATEMENT_TIME=#
  Copy max_statement_time to current user
sql/sql_class.cc:
  Added timer functionality to THD.
  Added thd_kill_timeout()
sql/sql_class.h:
  Added timer functionality to THD.
  Added KILL_TIMEOUT
  Added max_statement_time variable in similar manner as long_query_time was done.
sql/sql_connect.cc:
  Added handling of max_statement_time_exceeded
sql/sql_parse.cc:
  Added starting and stopping timers for queries.
sql/sql_show.cc:
  Added max_statement_time_exceeded for user/connects status in MariaDB 10.0
sql/sql_yacc.yy:
  Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0
sql/structs.h:
  Added max_statement_time user resource
sql/sys_vars.cc:
  Added max_statement_time variables
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
  Removed test as we require all fields in mysql.user table.
scripts/mysql_system_tables.sql
scripts/mysql_system_tables_data.sql
scripts/mysql_system_tables_fix.sql
  Updated mysql.user with new max_statement_time field
2014-10-07 11:37:36 +03:00
Sergei Golubchik
eaec266eb1 restore and fix wsrep status variables 2014-10-01 23:48:35 +02:00
Sergei Golubchik
13af416a82 cleanup: wsrep_check_opts 2014-10-01 23:48:35 +02:00
Sergei Golubchik
7aabc2ded2 fixing embedded: WaaS. Wsrep as a Service. 2014-10-01 23:48:34 +02:00
Sergei Golubchik
3620910eea cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
Nirbhay Choubey
9a57de86be bzr merge -r4123..4144 codership/5.6 2014-09-30 18:06:15 -04:00
Nirbhay Choubey
47fcca0ffc MDEV-6667 : Improved handling of wsrep-new-cluster option
Code refactoring. Using mysql option handling system to
handle 'wsrep-new-cluster' option.
2014-09-08 21:21:37 -04:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Nirbhay Choubey
5add585539 Merged r4014 from codership/5.5 2014-08-12 18:23:53 -04:00
Nirbhay Choubey
8ec02bb836 bzr merge -c4123 codership/5.6/
(minus http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/4122)
2014-08-12 14:50:26 -04:00
Nirbhay Choubey
4788577c20 bzr merge -r3997..4010 codership-mysql/5.5 2014-08-06 15:45:53 -04:00
Nirbhay Choubey
dc377fcbc0 Merge of patch for MDEV-6411 from maria-5.5-galera. 2014-07-09 11:07:23 -04:00