Commit graph

76820 commits

Author SHA1 Message Date
unknown
9303ecd022 MDEV-26: Global transaction ID.
Fix some test case races and .result file updates, found with Buildbot.
2013-03-28 10:34:43 +01:00
unknown
b0389850a5 MDEV-26: Global transaction ID.
Test crashing the master, check that it recovers the binlog state.

Fix one bug introduced by previous commit (crash-recoved binlog state was
overwritten by loading stale binlog state file).

Fix Windows build error.
2013-03-27 19:29:59 +01:00
unknown
0fdbdde474 MDEV-26: Global transaction ID.
Implement test case rpl_gtid_stop_start.test to test normal stop and restart
of master and slave mysqld servers.

Fix a couple bugs found with the test:

 - When InnoDB is disabled (no XA), the binlog state was not read when master
   mysqld starts.

 - Remove old code that puts a bogus D-S-0 into the initial binlog state, it
   is not correct in current design.

 - Fix memory leak in gtid_find_binlog_file().
2013-03-27 16:06:45 +01:00
unknown
cb65cee82a MDEV-26: Global transaction ID.
When slave requested to start at some GTID, and that GTID was the very
last event (within its replication domain) in some binlog file, we did
not allow the binlog dump thread on the master to start from the
beginning of a following binlog file. This is a problem, since the
binlog file containing the GTID is likely to be purged if the
replication domain is unused for long.

With this fix, if the Gtid list event at the start of a binlog file
contains exactly the GTID requested by the slave, we allow to start
the binlog dump thread from this file, taking care not to skip any
events from that domain in the file.
2013-03-27 12:29:02 +01:00
unknown
e5b60f0add MDEV-26: Global transaction ID.
Fix bug that RESET SLAVE did not reset Using_Gtid back to 0.
2013-03-27 10:44:28 +01:00
unknown
20e021115f MDEV-26: Global transaction ID.
Fix MDEV-4329. When user does CHANGE MASTER TO
MASTER_GTID_POS='<explicit GTID state>', we check that this state
does not conflict with the binlog. But the code forgot to give an
error in the case where a domain was completely missing from the
requested position (eg. MASTER_GTID_POS='').
2013-03-27 09:37:54 +01:00
unknown
466ceba6f0 MDEV-26: Global transaction ID.
Silence compiler warning.
2013-03-27 08:19:48 +01:00
unknown
f66e3474a8 MDEV-26: Global transaction ID.
Fix missing error check for applying Gtid_log_event.

Fix a couple compiler warnings.
2013-03-26 14:58:14 +01:00
unknown
5fa4c23519 MDEV-26: Global transaction ID.
Fix remaining two sporadic test failures in the full test suite:

 - Remove crash in DBUG_ASSERT() in _db_flush() (bug also exists in main
   tree).

 - Fix locking order violation for LOCK_status by temporarily unlocking it
   while locking LOCK_active_mi (like a similar fix for
   LOCK_global_variables).
2013-03-26 14:44:27 +01:00
unknown
d9f975d08b MDEV-26: Global transaction ID
Adjust full test suite to work with GTID.

Huge patch, mainly due to having to update .result file for all SHOW BINLOG
EVENTS and mysqlbinlog outputs, where the new GTID events pop up.

Everything was painstakingly checked to be still correct and valid .result
file updates.
2013-03-26 10:35:34 +01:00
unknown
a3f651d0f6 MDEV-26: Global transaction ID.
Fix checksums for the new GTID events (reported by Pavel Ivanov).
Fix printing of GTID_LIST_EVENT.
2013-03-22 11:26:28 +01:00
unknown
f1f9c4e4e5 MDEV-26: Global transaction ID.
Fix 3 small issues reported by Pavel Ivanov.
2013-03-22 08:11:37 +01:00
unknown
b6b84d6825 MDEV-26: Global transaction ID.
Fix error handling when record_gtid() fails to update the
mysql.rpl_slave_state table.
2013-03-21 17:33:29 +01:00
unknown
e590f89114 MDEV-26: Global transaction ID.
Fix MDEV-4278: Slave does not check that master understands GTID.

Now the slave will abort with a suitable error if an attempt is made to connect
with GTID to a master that does not support GTID.
2013-03-21 12:16:04 +01:00
unknown
9bb989a9d1 MDEV-26: Global transaction ID.
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.
2013-03-21 11:03:31 +01:00
unknown
9d9ddad759 MDEV-26: Global transaction ID.
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.
2013-03-18 15:09:36 +01:00
unknown
379819d8c0 MDEV-26: Global transaction ID.
After-rebase fixes. Rebase was done to be able to build on top
of the binlog background thread of MDEV-532.
2013-03-14 10:39:16 +01:00
unknown
008363e87c MDEV-26: Global transaction ID.
Add a missing check for correct table definition.
2013-03-11 16:16:55 +01:00
unknown
5e414f6b06 MDEV-26: Global Transaction ID.
Move a bunch of GTID specific code into new file rpl_gtid.cc. Make libmysqld build.
2013-03-11 16:02:40 +01:00
unknown
320863530f MDEV-26: Global Transaction ID.
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.
2013-03-11 12:07:09 +01:00
unknown
1baa0a57df MDEV-26: Global transaction ID.
Extend table definition checking to also be able to check for correct
definition of the primary key.
2013-03-11 12:02:42 +01:00
unknown
06ffea8c5b MDEV-26: Global Transaction ID
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.
2013-02-27 21:10:40 +01:00
unknown
a7e1860ec0 MDEV-26: Global Transaction ID.
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.
2013-02-27 18:38:42 +01:00
unknown
861830f9c2 MDEV-26: Global transaction ID.
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.
2013-02-26 17:25:07 +01:00
unknown
1f08be94bb MDEV-26: Global transaction 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.
2013-02-25 18:03:30 +01:00
unknown
2cf3d61fc2 MDEV-26: Global Transaction ID
- 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.
2013-02-22 12:31:55 +01:00
unknown
fff47f40f6 MDEV-26: Global Transaction ID
- 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.
2013-02-22 10:23:17 +01:00
unknown
cb46c33386 MDEV-26: Global transaction ID.
Fix crash in binlog_gtid_pos('', 4) (and thus slave connect) when master does not
have binlog enabled.
2013-02-21 14:46:11 +01:00
unknown
c350177a21 MDEV-26: Global transaction ID
- 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.
2013-02-21 08:10:55 +01:00
unknown
7426a466dc MDEV-26: Global transaction ID, intermediate commit.
Fix memory leak.
2013-02-19 14:22:29 +01:00
unknown
bfec9c64b8 MDEV-26: Global transaction ID, intermediate commit.
- 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).
2013-02-19 11:45:29 +01:00
unknown
ff8676e0e1 MDEV-26: Global transaction ID.
Fix initial loading of mysql.rpl_slave_state, the code had several
issues.

Some very basic MTR stuff, more to come.
2013-02-18 15:41:17 +01:00
unknown
bfa3f15416 MDEV-26: Global Transaction ID.
Fix things so that GTID state on slave is updated also for
non-XID event groups (ie. DDL and MyISAM DML).
2013-02-15 17:06:01 +01:00
unknown
1c6271b36a MDEV-26: Global Transaction ID.
Implement CHANGE MASTER TO ... MASTER_GTID_POS = "x-y-z,a-b-c".
2013-02-15 15:55:17 +01:00
unknown
2d723aa9eb MDEV-26: Global Transaction ID.
Display replication slave gtid state in SHOW ALL SLAVES STATUS.
2013-02-15 13:54:48 +01:00
unknown
cb5a53881c MDEV-26: Global transaction ID.
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.
2013-02-14 14:42:05 +01:00
unknown
d98e2ea9fe MDEV-26. Intermediary commit.
Fix binlog_gtid_pos() to handle empty file name, and to not allow user
to open arbitrary file on the system.
2013-02-13 13:36:46 +01:00
unknown
041f26d349 MDEV-26. Intermediate commit.
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.
2013-02-11 16:44:38 +01:00
unknown
132c266044 MDEV-26: Global transaction ID.
Ensure that mysql_install_db can create the rpl_slave_state with InnoDB storage engine.
2013-01-25 19:19:30 +01:00
unknown
1d35777647 MDEV-26: Global transaction ID.
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.
2013-01-25 15:21:49 +01:00
unknown
0b36233acd MDEV-26. Intermediate commit.
Implement CHANGE MASTER TO MASTER_GTID_POS=xxx.
2013-01-22 15:18:36 +01:00
unknown
bdbce30dee MDEV-26: Global transaction id: Intermediate commit.
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.
2012-11-15 13:11:35 +01:00
unknown
3e798b033a MDEV-26: global transaction id. Intermediate commit.
Now master saves and restores the binlog state, across server restart and crash.
2012-11-07 14:18:10 +01:00
unknown
03f28863e8 MDEV-26: Global transaction commit. Intermediate commit.
Now slave records GTID in mysql.rpl_slave_state when applying XID log event.
2012-11-05 15:01:49 +01:00
unknown
ab8e8f4b27 MDEV-500: Session variable for server_id
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.
2012-10-23 12:46:29 +02:00
unknown
be86e44280 MDEV-26: Global transaction id. Partial commit. 2012-10-23 11:19:42 +02:00
Alexander Barkov
f5c3c2855d Performance improvements in "from latin1" and "to utf8" conversion.
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
2013-03-12 18:33:19 +04:00
Sergey Petrunya
62222eb518 Fix buildbot failure:
Backport the code that runs cassandra.test only when Cassandra is 
present and running from 10.0 to 10.0-base.
2013-03-07 22:25:03 +04:00
Michael Widenius
938d47dcdc Automatic merge 2013-02-27 23:01:33 +02:00
unknown
e3ac306157 [NOT] EXISTS to IN transformation. 2013-02-26 01:20:17 +02:00