summaryrefslogtreecommitdiff
path: root/sql/log.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.4' into 10.5Oleksandr Byelkin2020-02-121-20/+14
|\
| * Merge branch '10.3' into 10.4Oleksandr Byelkin2020-02-111-20/+14
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-01-311-20/+14
| | |\
| | | * Merge 10.1 into 10.2Marko Mäkelä2020-01-311-18/+12
| | | |\
| | | | * MDEV-20923:UBSAN: member access within address … which does not point to ↵Sujatha2020-01-291-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an object of type 'xid_count_per_binlog' Problem: ------- Accessing a member within 'xid_count_per_binlog' structure results in following error when 'UBSAN' is enabled. member access within address 0xXXX which does not point to an object of type 'xid_count_per_binlog' Analysis: --------- The problem appears to be that no constructor for 'xid_count_per_binlog' is being called, and thus the vtable will not be initialized. Fix: --- Defined a parameterized constructor for 'xid_count_per_binlog' class.
| | | | * imporve clang buildEugene Kosov2019-06-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about deprecated `register` keyword. Too much warnings came from Mroonga and I gave up on it.
* | | | | Galera GTID supportmkaruza2020-01-291-84/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-01-201-1/+2
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-01-201-1/+2
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | The MDEV-17062 fix in commit c4195305b2a8431f39a4c75cc1c66ba43685f7a0 was omitted.
| | * | | Merge branch '10.2' into 10.3Sergei Petrunia2020-01-171-1/+2
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # mysql-test/suite/galera/r/MW-388.result # mysql-test/suite/galera/t/MW-388.test # mysql-test/suite/innodb/r/truncate_inject.result # mysql-test/suite/innodb/t/truncate_inject.test # mysql-test/suite/rpl/r/rpl_stop_slave.result # mysql-test/suite/rpl/t/rpl_stop_slave.test # sql/sp_head.cc # sql/sp_head.h # sql/sql_lex.cc # sql/sql_yacc.yy # storage/xtradb/buf/buf0dblwr.cc
| | | * | MDEV-18514: Assertion `!writer.checksum_len || writer.remains == 0' failedSujatha2020-01-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: ======== 'max_binlog_cache_size' is configured and a huge transaction is executed. When the transaction specific events size exceeds 'max_binlog_cache_size' the event cannot be written to the binary log cache and cache write error is raised. Upon cache write error the statement is rolled back and the transaction cache should be truncated to a previous statement specific position. The truncate operation should reset the cache to earlier valid positions and flush the new changes. Even though the flush is successful the cache write error is still in marked state. The truncate code interprets the cache write error as cache flush failure and returns abruptly without modifying the write cache parameters. Hence cache is in a invalid state. When a COMMIT statement is executed in this session it tries to flush the contents of transaction cache to binary log. Since cache has partial events the cache write operation will report 'writer.remains' assert. Fix: === Binlog truncate function resets the cache to a specified size. As a first step of truncation, clear the cache write error flag that was raised during earlier execution. With this new errors that surface during cache truncation can be clearly identified.
* | | | | MDEV-21497 Make Field_time, Field_datetime, Field_timestamp abstractAlexander Barkov2020-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Making classes Field_time, Field_datetime, Field_timestamp abstract - Adding instantiable Field_time0, Field_datetime0, Field_timestamp0 classes - Removing redundant cast in field_conv.cc, item_timefunc.cc, sp.cc in calls for set_time() and get_timestamp() - Replacing store_TIME() to store_timestamp() in log.cc and removing redundant cast
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-141-6/+13
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-20707: Missing memory barrier in parallel replication error handler in ↵Sujatha2019-11-141-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wait_for_prior_commit() revision-id: 673e253724979fd9fe43a4a22bd7e1b2c3a5269e Author: Kristian Nielsen Fix missing memory barrier in wait_for_commit. The function wait_for_commit::wait_for_prior_commit() has a fast path where it checks without locks if wakeup_subsequent_commits() has already been called. This check was missing a memory barrier. The waitee thread does two writes to variables `waitee' and `wakeup_error', and if the waiting thread sees the first write it _must_ also see the second or incorrect behavior will occur. This requires memory barriers between both the writes (release semantics) and the reads (acquire semantics) of those two variables. Other accesses to these variables are done under lock or where only one thread will be accessing them, and can be done without barriers (relaxed semantics).
* | | | | Merge 10.4 into 10.5Oleksandr Byelkin2019-11-071-5/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2019-11-011-3/+2
| |\ \ \ \ | | |/ / /
| | * | | Remove \n from DBUG_PRINT statementsMichael Widenius2019-10-211-1/+1
| | | | |
| | * | | Fixes for binary logging --read-only modeMonty2019-10-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Any temporary tables created under read-only mode will never be logged to binary log. Any usage of these tables to update normal tables, even after read-only has been disabled, will use row base logging (as the temporary table will not be on the slave). - Analyze, check and repair table will not be logged in read-only mode. Other things: - Removed not used varaibles in MYSQL_BIN_LOG::flush_and_set_pending_rows_event. - Set table_share->table_creation_was_logged for all normal tables. - THD::binlog_query() now returns -1 if statement was not logged., This is used to update table_share->table_creation_was_logged. - Don't log admin statements in opt_readonly is set. - Table's that doesn't have table_creation_was_logged will set binlog format to row logging. - Removed not needed/wrong setting of table->s->table_creation_was_logged in create_table_from_items()
| * | | | MDEV-17099 Preliminary changes for Galera XA support (#1404)Daniele Sciascia2019-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Redo changes reverted in commit 8f46e3833c7acb3ec3e4c7b389ae8cdd98eff1ce, this time without build issues in wsrep-lib.
| * | | | Revert MDEV-17099 Preliminary changes for Galera XA support (#1401)Marko Mäkelä2019-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2b5f4b3ed68585b310b7ebede474928ff90d9aa2 due to build failures.
| * | | | MDEV-17099 Preliminary changes for Galera XA support (#1401)Daniele Sciascia2019-10-241-2/+2
| | | | | | | | | | | | | | | Update wsrep-lib, and adapt to wsrep-lib interface changes.
* | | | | MDEV-17048 Inconsistency voting support (#1373)Alexey Yurchenko2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Collect and pass apply error data to provider * Rollback failed transaction and continue operation if provider returns SUCCESS * MTR tests for inconsistency voting
* | | | | Removed redundant log_type == LOG_BIN checksSergey Vojtovich2019-08-221-30/+28
| | | | |
* | | | | Cleanup log_type_arg of MYSQL_BIN_LOG::open()Sergey Vojtovich2019-08-221-7/+4
| | | | | | | | | | | | | | | | | | | | It is always LOG_BIN anyway.
* | | | | Cleanup MYSQL_LOGSergey Vojtovich2019-08-221-30/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Embed MYSQL_LOG::init(). Reduce visibility of MYSQL_LOG::init_and_set_log_file_name(). Cleanup unused mysql_bin_log_file_name() and mysql_bin_log_file_pos().
* | | | | Revert "MDEV-20342 Turn Field::flags from a member to a method"Alexander Barkov2019-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e86010f909fb6b8c4ffd9d6df92991ac079e67e7. Reverting on Monty's request, as this change makes merging things from 10.5 to 10.2 much harder.
* | | | | MDEV-20342 Turn Field::flags from a member to a methodAlexander Barkov2019-08-141-1/+1
| | | | |
* | | | | MDEV-17709 Remove handlerton::stateRobert Bindar2019-06-061-5/+5
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-7/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-7/+7
| |\ \ \ \ | | |/ / /
| | * | | 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
| | | | |\
| | | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| | * | | | MDEV-17710 "unknown error" with FLUSH LOGS if log directory is not writeableSergei Golubchik2019-05-071-6/+6
| | | | | |
* | | | | | Improved ha_close_connection() scalabilitySergey Vojtovich2019-05-211-1/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than iterating global plugin collection, iterate THD local collection. Removes two LOCK_plugin locks per connection. Part of MDEV-19515 - Improve connect speed
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-05-051-0/+2
|\ \ \ \ \ | |/ / / /
| * | | | Make connect speed great againSergey Vojtovich2019-05-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than parsing session_track_system_variables when thread starts, do it when first trackable event occurs. Benchmarked on a 2socket/20core/40threads Broadwell system using sysbench connect brencmark @40 threads (with select 1 disabled): 101379.77 -> 143016.68 CPS, whereas 10.2 is currently at 137766.31 CPS. Part of MDEV-14984 - regression in connect performance
* | | | | Fix -Wformat and -Wnonnull-compare for WSREPMarko Mäkelä2019-04-031-3/+3
| | | | |
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-04-021-3/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-291-3/+3
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-291-3/+3
| | |\ \ \ | | | |/ /
| | | * | cmake: re-enable -Werror in the maintainer modeSergei Golubchik2019-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now we can afford it. Fix -Werror errors. Note: * old gcc is bad at detecting uninit variables, disable it. * time_t is int or long, cast it for printf's
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-191-0/+51
| |\ \ \ \ | | |/ / /
| | * | | MDEV-17262: mysql crashed on galera while node rejoined cluster (#895)sysprg2019-03-181-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains a fix for the MDEV-17262/17243 issues and new mtr test. These issues (MDEV-17262/17243) have two reasons: 1) After an intermediate commit, a transaction loses its status of "transaction that registered in the MySQL for 2pc coordinator" (in the InnoDB) due to the fact that since version 10.2 the write_row() function (which located in the ha_innodb.cc) does not call trx_register_for_2pc(m_prebuilt->trx) during the processing of split transactions. It is necessary to restore this call inside the write_row() when an intermediate commit was made (for a split transaction). Similarly, we need to set the flag of the started transaction (m_prebuilt->sql_stat_start) after intermediate commit. The table->file->extra(HA_EXTRA_FAKE_START_STMT) called from the wsrep_load_data_split() function (which located in sql_load.cc) will also do this, but it will be too late. As a result, the call to the wsrep_append_keys() function from the InnoDB engine may be lost or function may be called with invalid transaction identifier. 2) If a transaction with the LOAD DATA statement is divided into logical mini-transactions (of the 10K rows) and binlog is rotated, then in rare cases due to the wsrep handler re-registration at the boundary of the split, the last portion of data may be lost. Since splitting of the LOAD DATA into mini-transactions is technical, I believe that we should not allow these mini-transactions to fall into separate binlogs. Therefore, it is necessary to prohibit the rotation of binlog in the middle of processing LOAD DATA statement. https://jira.mariadb.org/browse/MDEV-17262 and https://jira.mariadb.org/browse/MDEV-17243
* | | | | MDEV-19116 Speed up rotation of binary logsMonty2019-04-011-36/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed by caching last binary log number used in last_used_log_number Other things: - Moved locking of LOCK_log form new_file_impl() to new_file(). This fixed a bug where LOCK_log could have been unlocked even if 'need_lock' was not set. Removed not anymore used argument need_lock. - Made generate_new_name() virtual to simplify the code between other logs and binary log. Reviewed by Andrei Elkin
* | | | | MDEV-19068 - rename eventlog source to MariaDB.Vladislav Vaintroub2019-03-291-5/+21
| | | | |
* | | | | 10.4 wsrep group commit fixes (#1224)Teemu Ollakka2019-03-151-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MDEV-16509 Improve wsrep commit performance with binlog disabled Release commit order critical section early after trx_commit_low() if binlog is not transaction coordinator. In order to avoid two phase commit, binlog_hton is not registered for THD during IO_CACHE population. Implemented a test which verifies that the transactions release commit order early. This optimization will change behavior during recovery as the commit is not two phase when binlog is off. Fixed and recorded wsrep-recover-v25 and wsrep-recover to match the behavior. * MDEV-18730 Ordering for wsrep binlog group commit Previously out of order execution was allowed for wsrep commits. Established proper ordering by populating wait_for_commit for every wsrep THD and making group commit leader to wait for prior commits before proceeding to trx_group_commit_leader(). * MDEV-18730 Added a test case to verify correct commit ordering * MDEV-16509, MDEV-18730 Review fixes Use WSREP_EMULATE_BINLOG() macro to decide if the binlog_hton should be registered. Whitespace/syntax fixes and cleanups. * MDEV-16509 Require binlog for galera_var_innodb_disallow_writes test If the commit to InnoDB is done in one phase, the native InnoDB behavior is that the transaction is committed in memory before it is persisted to disk. This means that the innodb_disallow_writes=ON may not prevent transaction to become visible to other readers before commit is completely over. On the other hand, if the commit is two phase (as it is with binlog), the transaction will be blocked in prepare phase. Fixed the test to use binlog, which enforces two phase commit, which in turn makes commit to block before the changes become visible to other connections. This guarantees that the test produces expected result.
* | | | | MDEV-18631 Fix streaming replication with wsrep_gtid_mode=ONTeemu Ollakka2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With wsrep_gtid_mode=ON, the appropriate commit hooks were not called in all cases for applied streaming transactions. As a fix, removed all special handling of commit order critical section from Wsrep_high_priority_service and Wsrep_storage_service. Now commit order critical section is always entered in ha_commit_trans(). Check for wsrep_run_commit_hook is now done in handler.cc, log.cc. This makes it explicit that the transaction is an active wsrep transaction which must go through commit hooks.
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-02-211-3/+3
|\ \ \ \ \ | |/ / / /