Unable to set up mysql semi sync with ripple #23
Comments
|
The MySQL logs that you posted seem to indicate that Ripple doesn't send semi-sync replies, but Ripple logs don't indicate why. So it's hard to say what's the problem. Maybe you can add more logging to the code here https://github.com/google/mysql-ripple/blob/master/mysql_master_session.cc#L253 to understand what's happening and why Ripple doesn't send semi-sync replies? |
|
Thank you for your reply !!! I add logging as you suggested, looks like semi_sync_reply always 0, GetSemiSyncSlaveReplyActive() return 1 => bool reply always 0 in my case So I delete semi_sync_reply like below just for testing : Ripple logs: r_port=3306 -ripple_master_user=repl_user -ripple_master_password=root123 -ripple_server_ports=15000 -ripple_semi_sync_slave_enabled=true I0302 05:46:51.793931 114716 mysql_master_session.cc:255] method: 1 I0302 05:46:51.793952 114716 binlog.cc:616] Skip writing event [ Previous_gtids len = 27 ] I0302 05:46:51.793999 114716 mysql_master_session.cc:269] SendSemiSyncReply is true: send smi sync reply succeed I0302 05:46:51.794016 114716 mysql_master_session.cc:255] method: 1 Seems running ??? But never stop... Does that means ripple are sending semi-sync replies back ? |
|
If semi_sync_reply is always 0, it means that master doesn't request for the semi-sync ack. It sounds a little strange, why would master do that. Are you using vanilla MySQL? |
|
No, I don't even know what is vanilla MySQL, I reran again, with the logging, so looks like semi_sync_reply do change to 1 at some time, code: `` Master Start running a short 60s sys bench test: Master log from beginning: 2020-03-03T03:58:45.134848Z 5 [Note] Start binlog_dump to master_thread_id(5) slave_server(112211), pos(, 4) 2020-03-03T03:59:27.940804Z 5 [ERROR] Semi-sync master failed on net_flush() before waiting for slave reply 2020-03-03T03:59:27.940834Z 5 [Note] Stop semi-sync binlog_dump to slave (server_id: 112211) …... 2020-03-03T03:59:28.107392Z 29 [Note] Start binlog_dump to master_thread_id(29) slave_server(112211), pos(, 4) 2020-03-03T04:01:07.939990Z 10 [Warning] Timeout waiting for reply of binlog (file: mysql-bin.000003, pos: 1000), semi-sync up to file , position 4. 2020-03-03T04:01:07.940046Z 10 [Note] Semi-sync replication switched OFF. Ripple: WARNING: Logging before InitGoogleLogging() is written to STDERR) I0303 03:58:45.229821 58652 mysql_master_session.cc:256] reply from semi sync is: 0 I0303 03:59:27.935078 58652 mysql_master_session.cc:269] SendSemiSyncReply is true: send smi sync reply succeed E0303 03:59:27.935127 58652 mysql_master_session.cc:303] Failed to read packet: Got error reading packet from server: Lost connection to MySQL server during query I0303 03:59:27.941793 58652 binlog.cc:616] Skip writing event [ Previous_gtids len = 67 ] I0303 03:59:27.941815 58652 mysql_master_session.cc:256] reply from semi sync is: 0 I0303 03:59:27.942019 58652 mysql_master_session.cc:256] reply from semi sync is: 1 I0303 03:59:27.942097 58652 mysql_master_session.cc:269] SendSemiSyncReply is true: send smi sync reply succeed E0303 03:59:27.942142 58652 mysql_master_session.cc:303] Failed to read packet: Got error reading packet from server: Lost connection to MySQL server during query |
|
So far
Ripple side,
|
|
One more thing, master & ripple are on 2 VMs under same vnet/region/OS/disk.. etc |
|
Any updates ? |
|
Sorry for the late reply... |
|
Thank you for you reply, i am using mysql Ver 14.14 Distrib 5.7.29, for Linux (x86_64), I installed on ubuntu linux Azure VM and I only ran two commands: sudo apt update, sudo apt install mysql-server mysql> show variables like '%version%'; |
Hi, I am trying to set up semi sync between master and ripple, but semi sync always switched off automatically when I am running sysbench, the errors on both sides are like below:
Master error.log:
2020-02-25T09:40:06.868855Z 0 [ERROR] /usr/sbin/mysqld: Got packets out of order
2020-02-25T09:40:06.868902Z 0 [ERROR] /usr/sbin/mysqld: Got packets out of order
2020-02-25T09:40:06.868932Z 0 [ERROR] /usr/sbin/mysqld: Couldn't uncompress communication packet
2020-02-25T09:40:06.868941Z 0 [ERROR] /usr/sbin/mysqld: Got packets out of order
2020-02-25T09:40:06.868948Z 0 [ERROR] /usr/sbin/mysqld: Got packets out of order
2020-02-25T09:40:06.870024Z 0 [ERROR] /usr/sbin/mysqld: Got timeout reading communication packets
2020-02-25T09:40:06.875397Z 0 [ERROR] /usr/sbin/mysqld: Got an error reading communication packets
2020-02-25T09:40:06.882687Z 29 [Note] While initializing dump thread for slave with server_id <112211>, found a zombie dump thread with the same server_id. Master is killing the zombie dump thread(3).
2020-02-25T09:40:06.882770Z 3 [Note] Stop semi-sync binlog_dump to slave (server_id: 112211)
2020-02-25T09:40:06.882815Z 29 [Note] Start binlog_dump to master_thread_id(29) slave_server(112211), pos(, 4)
2020-02-25T09:40:06.882837Z 29 [Note] Start semi-sync binlog_dump to slave (server_id: 112211), pos(, 4)
2020-02-25T09:40:06.989646Z 30 [Note] While initializing dump thread for slave with server_id <112211>, found a zombie dump thread with the same server_id. Master is killing the zombie dump thread(29).
2020-02-25T09:40:06.989714Z 29 [Note] Stop semi-sync binlog_dump to slave (server_id: 112211)
2020-02-25T09:40:06.989770Z 30 [Note] Start binlog_dump to master_thread_id(30) slave_server(112211), pos(, 4)
2020-02-25T09:40:06.989793Z 30 [Note] Start semi-sync binlog_dump to slave (server_id: 112211), pos(, 4)
2020-02-25T09:41:46.868547Z 23 [Warning] Timeout waiting for reply of binlog (file: mysql-bin.000001, pos: 596), semi-sync up to file , position 4.
2020-02-25T09:41:46.868601Z 23 [Note] Semi-sync replication switched OFF.
Rpl_semi_sync_master_status also turned OFF during the run:
mysql> show status like '%rpl%';
+--------------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------------+-------+
| Rpl_semi_sync_master_clients | 1 |
| Rpl_semi_sync_master_net_avg_wait_time | 0 |
| Rpl_semi_sync_master_net_wait_time | 0 |
| Rpl_semi_sync_master_net_waits | 3 |
| Rpl_semi_sync_master_no_times | 1 |
| Rpl_semi_sync_master_no_tx | 2 |
| Rpl_semi_sync_master_status | OFF |
| Rpl_semi_sync_master_timefunc_failures | 0 |
| Rpl_semi_sync_master_tx_avg_wait_time | 0 |
| Rpl_semi_sync_master_tx_wait_time | 0 |
| Rpl_semi_sync_master_tx_waits | 0 |
| Rpl_semi_sync_master_wait_pos_backtraverse | 0 |
| Rpl_semi_sync_master_wait_sessions | 0 |
| Rpl_semi_sync_master_yes_tx | 0 |
+--------------------------------------------+-------+
Ripple log:
I0225 09:40:06.894847 24855 mysql_protocol.cc:550] Send event, type: Xid, timestamp: 1582623606, length: 31, nextpos: 14648
I0225 09:40:06.894914 24855 mysql_protocol.cc:550] Send event, type: Gtid, timestamp: 1582623606, length: 65, nextpos: 14729
I0225 09:40:06.894984 24855 mysql_protocol.cc:550] Send event, type: Query, timestamp: 1582623606, length: 74, nextpos: 14819
I0225 09:40:06.895058 24855 mysql_protocol.cc:550] Send event, type: Unknown event: 19, timestamp: 1582623606, length: 90, nextpos: 14925
I0225 09:40:06.895129 24855 mysql_protocol.cc:550] Send event, type: Unknown event: 30, timestamp: 1582623606, length: 290, nextpos: 15231
I0225 09:40:06.895203 24855 mysql_protocol.cc:550] Send event, type: Xid, timestamp: 1582623606, length: 31, nextpos: 15278
E0225 09:40:06.986371 24811 mysql_master_session.cc:298] Failed to read packet: Got error reading packet from server: Lost connection to MySQL server during query
I0225 09:40:06.986407 24811 binlog.cc:675] Connection closed last position binlog file: binlog.000000:15278, gtid: 0-0-25
I0225 09:40:06.986430 24811 mysql_master_session.cc:273] Disconnecting from master
I0225 09:40:06.987946 24811 mysql_client_connection.cc:148] connected to host: xxx, port: 3306
I0225 09:40:06.990568 24811 mysql_master_session.cc:137] Connected to host: xxx, port: 3306, server_id: 1, server_name:
I0225 09:40:06.991778 24811 mysql_master_session.cc:202] master has semi sync enabled
I0225 09:40:06.991804 24811 mysql_master_session.cc:207] start replicating from '02b13200-56ca-11ea-945b-000d3aa16eab:0-0-25'
I0225 09:40:06.992206 24811 mysql_master_session.cc:230] Master session entering main loop
I0225 09:40:06.992585 24811 binlog.cc:626] Update binlog position to end_pos: binlog.000000:15341, gtid: 0-0-25
I0225 09:40:06.992621 24811 binlog.cc:616] Skip writing event [ Previous_gtids len = 27 ]
I0225 09:40:06.992635 24811 binlog.cc:626] Update binlog position to end_pos: binlog.000000:15341, gtid: 0-0-25
Background:
Mysql version: 5.7
instances on Azure VM Ubuntu, master and ripple are on different 2 VMs,
Commands I am running:
./bazel-bin/rippled -ripple_datadir=/mnt/mysql-log -ripple_master_address=xxx -ripple_master_port=3306 -ripple_master_user=repl_user -ripple_master_password=root123 -ripple_semi_sync_slave_enabled=true
I also verified that:
Could someone help provide guidance on what I I did wrong or missing ?
Thanks
The text was updated successfully, but these errors were encountered: