is00hcw / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 1 forks source link

user management commands in MariaDB are not replicated until the next event #1082

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. install TR with MariaDB 10.0.x
2. create an user in the master
3. check the slaves

What is the expected output?

The user is replicated immediately.

What do you see instead?

The event is not extracted to the THL, and therefore is not replicated

What is the possible cause?

The replicator does not seem to recognize the end of the event in the binary 
log. The CREATE USER event is replicated only after another event is added .

node1 [localhost] {msandbox} (test) > create user testuser identified by 
'password';
Query OK, 0 rows affected (0.01 sec)

node1 [localhost] {msandbox} (test) > exit
Bye

$ multi_trepctl
| host  | rmiport | service  | role   | state  | seqno | latency |
| gmini |   10110 | tsandbox | master | ONLINE |     0 |   0.922 |
| gmini |   10120 | tsandbox | slave  | ONLINE |     0 |  12.329 |

$ mysql  -e 'drop table if exists t1'

$ thl list
SEQ# = 0 / FRAG# = 0 (last frag)
- TIME = 2015-01-06 02:33:11.0
- EPOCH# = 0
- EVENTID = mysql-bin.000002:0000000000000634;45
- SOURCEID = gmini
- METADATA = 
[mysql_server_id=101;gtid_domain_id=0;gtid_seqno=15;tz_aware=true;dbms_type=mysq
l;is_metadata=true;service=tsandbox;shard=tungsten_tsandbox;heartbeat=MASTER_ONL
INE]
- TYPE = com.continuent.tungsten.replicator.event.ReplDBMSEvent
- OPTIONS = [##charset = UTF-8, autocommit = 1, sql_auto_is_null = 0, 
foreign_key_checks = 1, unique_checks = 1, time_zone = '+00:00', sql_mode = 
'IGNORE_SPACE', character_set_client = 33, collation_connection = 33, 
collation_server = 8]
- SCHEMA = tungsten_tsandbox
- SQL(0) = UPDATE tungsten_tsandbox.heartbeat SET source_tstamp= '2015-01-06 
02:33:11', salt= 1, name= 'MASTER_ONLINE'  WHERE id= 1
SEQ# = 1 / FRAG# = 0 (last frag)
- TIME = 2015-01-06 02:35:40.0
- EPOCH# = 0
- EVENTID = mysql-bin.000002:0000000000000932;48
- SOURCEID = gmini
- METADATA = 
[mysql_server_id=101;gtid_domain_id=0;gtid_seqno=17;unsafe_for_block_commit;tz_a
ware=true;dbms_type=mysql;bidi_unsafe=true;service=tsandbox;shard=#UNKNOWN]
- TYPE = com.continuent.tungsten.replicator.event.ReplDBMSEvent
- OPTIONS = [##charset = UTF-8, autocommit = 1, sql_auto_is_null = 0, 
foreign_key_checks = 1, unique_checks = 1, sql_mode = '', character_set_client 
= 33, collation_connection = 33, collation_server = 8]
- SCHEMA = test
- SQL(0) = create user testuser identified by 'password'
- OPTIONS = [##charset = UTF-8, autocommit = 1, sql_auto_is_null = 0, 
foreign_key_checks = 1, unique_checks = 1, sql_mode = '', character_set_client 
= 33, collation_connection = 33, collation_server = 8]
- SQL(1) = DROP TABLE IF EXISTS `t1` /* generated by server */

What is the proposed solution?

make sure the replicator finds the event boundaries.

Original issue reported on code.google.com by g.maxia on 6 Jan 2015 at 2:51

GoogleCodeExporter commented 9 years ago
The same behavior happens for DROP USER and GRANT commands

Original comment by g.maxia on 6 Jan 2015 at 3:22

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2741.

Now handling MariaDB standalone statements correctly

Original comment by stephane...@continuent.com on 6 Jan 2015 at 1:11

GoogleCodeExporter commented 9 years ago
This should now be fixed by handling MariaDB standalone flag better when 
extracting MariaDB GTID. 

Original comment by stephane...@continuent.com on 6 Jan 2015 at 1:17

GoogleCodeExporter commented 9 years ago

Original comment by stephane...@continuent.com on 6 Jan 2015 at 1:17

GoogleCodeExporter commented 9 years ago
Tested with TR 3.1.0-15.
A test was added to the regression suite

Original comment by g.maxia on 6 Jan 2015 at 2:50

GoogleCodeExporter commented 9 years ago
There won't be a 3.1.0 version number.

Original comment by linas.vi...@continuent.com on 19 Jan 2015 at 2:17