summaryrefslogtreecommitdiff
path: root/sql/wsrep_applier.cc
Commit message (Collapse)AuthorAgeFilesLines
* Change replication to use uchar for all buffers instead of charMonty2021-05-191-1/+1
| | | | | | | | | | | | | | | This change is to get rid of randomly failing tests, especially those that reads random position of the binary log. From looking at the logs it's clear that some failures is because of a read char (with value >= 128) is converted to a big long value. Using uchar everywhere makes this much less likely to happen. Another benefit is that a lot of cast of char to uchar could be removed. Other things: - Removed some extra space before '=' and '+=' in assignments - Fixed indentations and lines > 80 characters - Replace '16' with 'element_size' (from class definition) in Gtid_list_log_event()
* Change THD->transaction to a pointer to enable multiple transactionsMonty2020-05-231-1/+1
| | | | | | | | | All changes (except one) is of type thd->transaction. -> thd->transaction-> thd->transaction points by default to 'thd->default_transaction' This allows us to 'easily' have multiple active transactions for a THD object, like when reading data from the mysql.proc table
* Galera GTID supportmkaruza2020-01-291-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for galera GTID consistency thru cluster. All nodes in cluster should have same GTID for replicated events which are originating from cluster. Cluster originating commands need to contain sequential WSREP GTID seqno Ignore manual setting of gtid_seq_no=X. In master-slave scenario where master is non galera node replicated GTID is replicated and is preserved in all nodes. To have this - domain_id, server_id and seqnos should be same on all nodes. Node which bootstraps the cluster, to achieve this, sends domain_id and server_id to other nodes and this combination is used to write GTID for events that are replicated inside cluster. Cluster nodes that are executing non replicated events are going to have different GTID than replicated ones, difference will be visible in domain part of gtid. With wsrep_gtid_domain_id you can set domain_id for WSREP cluster. Functions WSREP_LAST_WRITTEN_GTID, WSREP_LAST_SEEN_GTID and WSREP_SYNC_WAIT_UPTO_GTID now works with "native" GTID format. Fixed galera tests to reflect this chances. Add variable to manually update WSREP GTID seqno in cluster Add variable to manipulate and change WSREP GTID seqno. Next command originating from cluster and on same thread will have set seqno and cluster should change their internal counter to it's value. Behavior is same as using @@gtid_seq_no for non WSREP transaction.
* MDEV-17048 Inconsistency voting support (#1373)Alexey Yurchenko2019-08-281-28/+14
| | | | | | * Collect and pass apply error data to provider * Rollback failed transaction and continue operation if provider returns SUCCESS * MTR tests for inconsistency voting
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |
* | | | Moved normal transaction xid to implicit_xidSergey Vojtovich2019-04-251-6/+0
| | | | | | | | | | | | | | | | Part of MDEV-7974 - backport fix for mysql bug#12161 (XA and binlog)
* | | | Galera4Brave Galera Crew2019-01-231-248/+72
|/ / /
* | | MDEV-16211 Contents of transaction_registry not replicated by GaleraEugene Kosov2018-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Patch fixes two bugs: 1) BEGIN_TIMESTAMP of MYSQL.TRANSACTION_REGISTY is '0-0-0' on replication record insertion 2) BEGIN_TIMESTAMP equals COMMMIT_TIMESTAMP in MYSQL.TRANSACTION_REGISTRY Fixed by calling THD::set_time() at appropriate places
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-05-111-4/+4
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-101-4/+4
| |\ \ | | |/
| | * MDEV-16005 sporadic failures with galera tests MW-328B and MW-328Csjaakola2018-04-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These test can sporadically show mutex deadlock warnings between LOCK_wsrep_thd and LOCK_thd_data mutexes. This means that these mutexes can be locked in opposite order by different threads, and thus result in deadlock situation. To fix such issue, the locking policy of these mutexes should be revised and enforced to be uniform. However, a quick code review shows that the number of lock/unlock operations for these mutexes combined is between 100-200, and all these mutex invocations should be checked/fixed. On the other hand, it turns out that LOCK_wsrep_thd is used for protecting access to wsrep variables of THD (wsrep_conflict_state, wsrep_query_state), whereas LOCK_thd_data protects query, db and mysys_var variables in THD. Extending LOCK_thd_data to protect also wsrep variables looks like a viable solution, as there should not be a use case where separate threads need simultaneous access to wsrep variables and THD data variables. In this commit LOCK_wsrep_thd mutex is refactored to be replaced by LOCK_thd_data. By bluntly replacing LOCK_wsrep_thd by LOCK_thd_data, will result in double locking of LOCK_thd_data, and some adjustements have been performed to fix such situations.
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-101-12/+12
|\ \ \
| * | | Add more execution stages (commit, rollback, etc)Monty2017-11-051-12/+12
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to get more information about where time is spent. Now we can get proper timing for time spent in commit, rollback, binlog write etc. Following stages was added: - Commit - Commit_implicit - Rollback - Rollback implicit - Binlog write - Init for update - This is used instead of "Init" for insert, update and delete. - Staring cleanup Following stages where changed: - "Unlocking tables" stage reset stage to previous stage at end - "binlog write" stage resets stage to previous stage at end - "end" -> "end of update loop" - "cleaning up" -> "Reset for next command" - Added stage_searching_rows_for_update when searching for rows to be deleted. Other things: - Renamed all stages to start with big letter (before there was no consitency) - Increased performance_schema_max_stage_classes from 150 to 160. - Most of the test changes in performance schema comes from renaming of stages. - Removed duplicate output of variables and inital state in a lot of performance schema tests. This was done to make it easier to change a default value for a performance variable without affecting all tests. - Added start_server_variables.test to check configuration - Removed some duplicate "closing tables" stages - Updated position for "stage_init_update" and "stage_updating" for delete, insert and update to be just before update loop (for more exact timing). - Don't set "Checking permissions" twice in a row. - Remove stage_end stage from creating views (not done for create table either). - Updated default performance history size from 10 to 20 because of new stages - Ensure that ps_enabled is correct (to be used in a later patch)
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-011-2/+5
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2017-08-311-2/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For running the Galera tests, the variable my_disable_leak_check was set to true in order to avoid assertions due to memory leaks at shutdown. Some adjustments due to MDEV-13625 (merge InnoDB tests from MySQL 5.6) were performed. The most notable behaviour changes from 10.0 and 10.1 are the following: * innodb.innodb-table-online: adjustments for the DROP COLUMN behaviour change (MDEV-11114, MDEV-13613) * innodb.innodb-index-online-fk: the removal of a (1,NULL) record from the result; originally removed in MySQL 5.7 in the Oracle Bug #16244691 fix https://github.com/mysql/mysql-server/commit/377774689bf6a16af74182753fe950d514c2c6dd * innodb.create-index-debug: disabled due to MDEV-13680 (the MySQL Bug #77497 fix was not merged from 5.6 to 5.7.10) * innodb.innodb-alter-autoinc: MariaDB 10.2 behaves like MySQL 5.6/5.7, while MariaDB 10.0 and 10.1 assign different values when auto_increment_increment or auto_increment_offset are used. Also MySQL 5.6/5.7 exhibit different behaviour between LGORITHM=INPLACE and ALGORITHM=COPY, so something needs to be tested and fixed in both MariaDB 10.0 and 10.2. * innodb.innodb-wl5980-alter: disabled because it would trigger an InnoDB assertion failure (MDEV-13668 may need additional effort in 10.2)
| | * Merge remote-tracking branch 'origin/10.0-galera' into 10.1Jan Lindström2017-08-211-2/+5
| | |\
| | | * Fix test failure on test MW-86 and remove MW-360 test.Jan Lindström2017-08-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged from mysql-wsrep-bugs following: GCF-1058 MTR test galera.MW-86 fails on repeated runs Wait for the sync point sync.wsrep_apply_cb to be reached before executing the test and clearing the debug flag sync.wsrep_apply_cb. The race scenario: Intended behavior: node2: set sync.wsrep_apply_cb in order to start waiting in the background INSERT node1: INSERT start node2 (background): INSERT start node1: INSERT end node2: send signal to background INSERT: "stop waiting and continue executing" node2: clear sync.wsrep_apply_cb as no longer needed node2 (background): consume the signal node2 (background): INSERT end node2: DROP TABLE node2: check no pending signals are left - ok What happens occasionally (unexpected): node2: set sync.wsrep_apply_cb in order to start waiting in the background INSERT node1: INSERT start node2 (background): INSERT start node1: INSERT end // The background INSERT still has _not_ reached the place where it starts // waiting for the signal: // DBUG_EXECUTE_IF("sync.wsrep_apply_cb", "now wait_for..."); node2: send signal to background INSERT: "stop waiting and continue executing" node2: clear sync.wsrep_apply_cb as no longer needed // The background INSERT reaches DBUG_EXECUTE_IF("sync.wsrep_apply_cb", ...) // but sync.wsrep_apply_cb has already been cleared and the "wait" code is not // executed. The signal remains unconsumed. node2 (background): INSERT end node2: DROP TABLE node2: check no pending signals are left - failure, signal.wsrep_apply_cb is pending (not consumed) Remove MW-360 test case as it is not intended for MariaDB (uses MySQL GTID).
| | | * MW-357 Reset thd->wsrep_apply_toi regardless of applier exitingDaniele Sciascia2017-08-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applier does not reset thd->wsrep_apply_toi if applier thread decides to exit by setting 'exit= true'. The problem is that galera side may decide not to kill the applier thread: for instance if we try to SET wsrep_slave_threads = 0; then galera refuses to kill the last applier thread. If this happens we are left with a thd which has not been reset to the initial state. This patch ensures that the thd is reset regardless of the applier thread exiting or not.
* | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-12-291-0/+5
|\ \ \ | |/ /
| * | MDEV-10545: Server crashed in my_copy_fix_mb on querying I_S and P_S tablesNirbhay Choubey2016-12-121-0/+2
| | | | | | | | | | | | | | | After applying/replaying the transaction, the memory that stored the query string was also wrongly freed.
| * | MDEV-11179: WSREP transaction excceded size limit in Galera clusterNirbhay Choubey2016-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... causes MariaDB to crash On error, the wsrep replication buffer (binlog) is dumped to a file to aid investigations. In order to also include the binlog header, FDLE object is also needed. This object is only available for wsrep- threads. Fix: Instantiate an FDLE object for non-wsrep threads.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-8/+2
|\ \ \ | |/ /
| * | Merge branch '10.0-galera' into bb-10.1-sergNirbhay Choubey2016-08-251-8/+2
| |\ \ | | |/
| | * MW-267 Enforce wsrep_max_ws_size limit in wsrep providerDaniele Sciascia2016-07-251-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes variable wsrep_max_ws_size so that its value is linked to the value of provider option repl.max_ws_size. That is, changing the value of variable wsrep_max_ws_size will change the value of provider option repl.max_ws_size, and viceversa. The writeset size limit is always enforced in the provider, regardless of which option is used.
* | | MDEV-7563 Support CHECK constraint as in (or close to) SQL StandardMichael Widenius2016-06-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-10134 Add full support for DEFAULT - Added support for using tables with MySQL 5.7 virtual fields, including MySQL 5.7 syntax - Better error messages also for old cases - CREATE ... SELECT now also updates timestamp columns - Blob can now have default values - Added new system variable "check_constraint_checks", to turn of CHECK constraint checking if needed. - Removed some engine independent tests in suite vcol to only test myisam - Moved some tests from 'include' to 't'. Should some day be done for all tests. - FRM version increased to 11 if one uses virtual fields or constraints - Changed to use a bitmap to check if a field has got a value, instead of setting HAS_EXPLICIT_VALUE bit in field flags - Expressions can now be up to 65K in total - Ensure we are not refering to uninitialized fields when handling virtual fields or defaults - Changed check_vcol_func_processor() to return a bitmap of used types - Had to change some functions that calculated cached value in fix_fields to do this in val() or getdate() instead. - store_now_in_TIME() now takes a THD argument - fill_record() now updates default values - Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL - Automatically generate a name for constraints that doesn't have a name - Added support for ALTER TABLE DROP CONSTRAINT - Ensure that partition functions register virtual fields used. This fixes some bugs when using virtual fields in a partitioning function
* | | MDEV-5535: Cannot reopen temporary tableNirbhay Choubey2016-06-101-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-02-251-7/+20
|\ \ \ | |/ /
| * | Merge branch '10.0-galera' into bb-10.1-sergNirbhay Choubey2016-02-241-7/+20
| |\ \ | | |/
| | * Fix for test failures.Nirbhay Choubey2016-02-231-0/+11
| | |
| | * refs codership/mysql-wsrep#31Daniele Sciascia2016-02-221-0/+3
| | | | | | | | | | | | - Erronously removed call to wsrep_xid_init() in previous commit.
| | * refs codership/mysql-wsrep#31Daniele Sciascia2016-02-221-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | - Removes useless call to wsrep_xid_init() in wsrep_apply_events(). Transaction's xid is already initialized at that point. - Adds call to wsrep_set_SE_checkpoint() for committing TOI events in the applier side. - Includes test case that reproduced the issue.
| | * MDEV-8239 : Idle threads post-execution end up in closing tables stateNirbhay Choubey2015-06-191-8/+8
| | | | | | | | | | | | | | | Set thd's state to 'committed' only after it has done closing tables (called indirectly by relay_group_info::cleanup_context()).
| | * Refs codership/mysql-wsrep#33Alexey Yurchenko2015-05-081-4/+5
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Merge branch '5.5-galera' into 10.0-galeraNirbhay Choubey2015-03-281-7/+4
| | |\
| | | * MDEV-7194: galera fails to replicate DDL queries when using binlog_checksumNirbhay Choubey2015-03-271-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | * Backport fix for MDEV-7673, MDEV-7203 and MDEV-7192 from 10.0-galeraNirbhay Choubey2015-03-111-4/+15
| | | |
| | | * bzr merge -r4015..4026 codership/5.5Nirbhay Choubey2014-10-091-2/+3
| | | |
| | | * bzr merge -r3997..4010 codership-mysql/5.5Nirbhay Choubey2014-08-061-0/+11
| | | |
| | | * Fixes for some compiler warnings.Nirbhay Choubey2014-01-091-1/+1
| | | |
| | | * Merging revision 3839..3932 from codership-mysql/5.5.Nirbhay Choubey2014-01-091-0/+351
| | |
| | * MDEV-7203: replicate_events_marked_for_skip didn't work on Galera clusterNirbhay Choubey2015-03-061-2/+7
| | | | | | | | | | | | | | | OPTION_SKIP_REPLICATION flag needs to be preserved for events received on non-originating nodes.
| | * MDEV-7192: binlog_annotate_row_events not completely compatible with galeraNirbhay Choubey2015-03-051-3/+5
| | | | | | | | | | | | | | | | | | Annotate_rows event needs to be preserved until the last Rows event has been applied because after it has been applied thd->query points to the query stored inside this event.
* | | Changed my_thread_id to int64 to fix compilation problem withMonty2016-02-081-2/+2
|/ / | | | | | | | | | | my_atomic_add32_explicit on windows Fixed that server_audit.c also works if one compiles with safemalloc Fixed compiler warnings
* | Merge branch '10.0-galera' into 10.1Nirbhay Choubey2015-07-141-24/+29
| |
* | MDEV-7867: Add binlog header to GRA_.log fileNirbhay Choubey2015-04-011-6/+4
|/
* bzr merge -r4123..4144 codership/5.6Nirbhay Choubey2014-09-301-1/+2
|