Fix MDEV-4275 - I/O thread restart duplicates events in the relay log.
The first time we connect to master after CHANGE MASTER or restart, we connect
from the GTID position. But then subsequent reconnects or IO thread restarts
reconnect with the old-style file/offset binlog pos from where it left off at
last disconnect. This is necessary to avoid duplicate events in the relay
logs, as there is nothing that synchronises the SQL thread update of GTID
state (multiple threads in case of multi-source) with IO thread reconnects.
Test cases.
Some small cleanups and fixes.
Fix things so that a master can switch with MASTER_GTID_POS=AUTO to a slave
that was previously running with log_slave_updates=0, by looking into the
slave replication state on the master when the slave requests something not
present in the binlog.
Be a bit more strict about what position the slave can ask for, to avoid some
easy-to-hit misconfiguration errors.
Start over with seq_no counter when RESET MASTER.
Improvements to record_gtid():
- Check for correct table definition of mysql.rpl_slave_state
- Use autocommit, to save one call to ha_commit_trans()
- Slightly more efficient way to set table->write_set
- Use ha_index_read_map() to locate rows to support any storage engine.
Fix that CHANGE MASTER ... MASTER_GTID_POS="" works to start from the very
beginning of the binary log (with test case).
Fix that not finding the requested GTID position in master binlog results in
fatal error, not endless connect retry.
Add test case demonstrating multi-source replication with GTID.
Test that we can move from being slave of two masters to be a slave
deeper down in the hierarchy (of a higher-up multi-source slave),
and vice versa.
Remove the two-component form of GTID with implicit domain_id=0, as it
is likely to cause more confusion than help.
Give a better error for CHANGE MASTER ... MASTER_GTID_POS='gtid,gitd,...'
when two specified GTIDs have conflicting domain_id.
Fix lock order violation. Make sure we temporarily release
LOCK_global_system_variables before taking LOCK_active_mi.
Otherwise we get a lock dependency cycle when we use
open_tables() under LOCK_active_mi.
- Fix skipping initial MyISAM DML when connecting using GTID.
- Fix RESET MASTER not clearing in-memory binlog state.
- Fix not reading standalone flag in Gtid_log_event::peek().
- Fix skipping DDL that the slave has already seen when using GTID position.
- Fix that binlog_gtid_pos() (and hence slave connect) does not work
correctly in the very first binlog file (due to not logging empty
Gtid_list_log_event).
- Remove one instance of the stupid domain_id-0-is-implicit.
- Rename the confusing Gtid_Pos_Auto in SHOW SLAVE STATUS to Using_Gtid.
- Fix memory leak.
- Add first basic mysql-test-run test case which tests switch to new master
using MASTER_GTID_POS=AUTO.
- When we connect with GTID, do not use any old relay logs, as they may
contain the wrong events or be corrupt after crash.
- Fix old bug that fails replication if we receive a heartbeat event
immediately after an event was omitted in the stream from the master.
- Fix rpl_end to clear Gtid_Pos_Auto, to keep check_testcase happy.
- Fix that slave GTID state was updated from the wrong place in the code,
causing random crashing and other misery.
- Fix updates to mysql.rpl_slave_state to not go to binlog (this would cause
duplicate key errors on the slave and is generally the wrong thing to do).
Slave now loads the GTID state from the master when connecting with
old-style filename/offset position.
This allows the user to use MASTER_GTID_POS=AUTO on next CHANGE MASTER
without any other action needed.
Implement binlog_gtid_pos() function. This will be used so that
the slave can obtain the gtid position automatically from first
connect with old-style position - then MASTER_GTID_POS=AUTO will
work the next time. Can also be used by mysqldump --master-data
to give the current gtid position directly.
When starting slave, check binlog state in addition to mysql.rpl_slave.state.
This allows to switch a previous master to be a slave directly
with MASTER_GTID_POS=AUTO.
Now slave can connect to master, sending start position as slave state
rather than old-style binlog name/position.
This enables to switch to a new master by changing just connection
information, replication slave GTID state ensures that slave starts
at the correct point in the new master.
MDEV-26: Global transaction id, partial commit
Change server_id to be a session variable.
User with SUPER can set it to binlog with different server_id.
Implement backward-compatible ::server_id mirror for plugins.
Mini-benchmarking demonstrates up to 10% improvement in latin1->utf8
conversion.
modified:
@ strings/ctype-latin1.c
redundant test in ctype-latin1.c removed
@ strings/ctype-utf8.c
my_uni_utf8 rewritten in a more efficient way
mysql-test/suite/heap/heap.result:
Added test case
mysql-test/suite/heap/heap.test:
Added test case
storage/heap/hp_delete.c:
Fixed that we don't change order of keys for the current key when we delete them from the hash table.
Fixed that 'current_hash_ptr' is correct after heap_delete_key().
Don't "reset current_hash_ptr" on delete; This will improve time a lot for delete of rows when not all rows matches the search criteria.
committer: Sergei Golubchik <sergii@pisem.net>
fix for a valgrind builds.
my_alloca() cannot have MY_THREAD_SPECIFIC, because can be used
outside of the THD context.
instead of single_select_engine
This task changes the IN-EXISTS rewrite for multi-column subqueries
"(a, b) IN (select b, c ...)" to work in the same way as for
single-column subqueries "a IN (select b ...) with respect to the
injection of NULL-rejecting predicates.
More specifically, the method
Item_in_subselect::create_row_in_to_exists_cond()
adds Item_is_not_null_test and Item_func_trig_cond only if the left
IN operand can be NULL. Not having these predicates when not necessary,
makes it possible to rewrite the subquery into a "unique_subquery" or
"index_subquery" when there is a suitable index on the only
subquery table.
When CHANGE MASTER fails, it may or may not have already added
the Master_info * to the index. Implement logic that properly
handles removal and freeing in both cases.
storage/cassandra/CMakeLists.txt:
more thourough CHECK_CXX_SOURCE_COMPILES test, that checks whether
boost::shared_ptr can work with --fno-rtti
don't install anything in INSTALL_SYSCONFDIR, if the latter is unset