-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxysql runtime_mysql_replication_hostgroups #1850
Comments
I can't reproduce this:
Hypothesis: did you run any DDL, for example dropping and recreating |
never run any ddl on runtime table. |
Admin> select * from runtime_mysql_replication_hostgroups; Admin> select * from mysql_replication_hostgroups; Admin> load mysql servers to runtime; Admin> select * from mysql_replication_hostgroups; Admin> select * from runtime_mysql_replication_hostgroups; Admin> |
Are you able to reproduce this on a fresh installation? |
can't reproduce on a fresh installation. |
Again, I suspect you ran some DDL, probably importing some backup. |
yeah. i build a proxysql,and made some change.such as mysql variables.save to disk.and copy proxysql.db to build other proxysql. |
hi may be i found the reason. in fresh proxysql, insert rec into mysql_replication_hostgroups,and load to runtime,that work. but when i also insert rec in mysql_group_replication_hostgroups, and load mysql server to runtime. then loss rec in runtime_mysql_replication_hostgroups.
|
when i delete rec in mysql_group_replication_hostgroups, and load servers to runtime, mysql_replication_hostgroups rec can load to runtime.
|
I really can't reproduce it. |
thk, |
hi i have new found。 PS:mysql in mysql server is mysql 8 in mgr ,single primary mod.and read to connect. Admin> select * from mysql_replication_hostgroups; Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; Admin> insert into mysql_replication_hostgroups(writer_hostgroup,reader_hostgroup) values(899,999); Admin> insert into mysql_group_replication_hostgroups(writer_hostgroup,backup_writer_hostgroup,reader_hostgroup,offline_hostgroup,active,writer_is_also_reader) values(10,20,30,40,1,0); Admin> Admin> load mysql servers to runtime; Admin> Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; Admin> Admin> save mysql servers to disk; Admin> load mysql server to runtime; Admin> Admin> Admin> Admin> save admin variables to disk; Query OK, 31 rows affected (0.02 sec) Admin> Admin> load admin variables to runtime; Admin> Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; PS:modify monitor password to incorrent password,then don not make runtime_mysql_replication_hostgroups lose data. Admin> Admin> save mysql variables to disk; Query OK, 97 rows affected (0.01 sec) Admin> save admin variables to disk; Admin> Admin> load admin variables to runtime; Admin> select * from mysql_replication_hostgroups; Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; Admin> Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; PS:modify monitor password to actual password,then runtime_mysql_replication_hostgroups lost data。 Admin> Query OK, 97 rows affected (0.01 sec) Admin> save admin variables to disk; Admin> Admin> load admin variables to runtime; Admin> Admin> select * from mysql_group_replication_hostgroups; Admin> Admin> select * from runtime_mysql_group_replication_hostgroups; |
proxysql version: |1.4.15-1-g61bc777 reproduct step: 2, insert into mysql_servers(hostgroup_id,hostname,port) values(10,'10.21.16.6',4888); 3, 4, check runtime_mysql_replication_hostgroups & runtime_mysql_group_replication_hostgroups data ok. 5, update monitor variables, then monitor mod can connect to mysql do monitor check. UPDATE global_variables SET variable_value='proxy_mon' WHERE variable_name='mysql-monitor_username'; save mysql variables to disk; load mysql variables to runtime; 6, check runtime_mysql_replication_hostgroups & runtime_mysql_group_replication_hostgroups data . |
if you use mgr, you only config the mysql_group_replication_hostgroups table,don't config mysql_replication_hostgroups. i not config two table at the same time. |
in Production Environment,have master-salve application and MGR application。 this can reproduce fllow the step i post.can fixed this problem? |
I cannot repeat this either. Could you please send us your MySQL topology? For example, I start master and slave using MySQL Test Framework:
This creates a simple master-slave setup. Please let us know what you do in your case. If you are using group replication, please, describe how many nodes and how do you start them. |
Not repeatable also with 3-nodes group replication cluster which is master of single-node asynchronous slave. |
I've tested this and was able to reproduce missing runtime_mysql_group_replication_hostgroups data even after LOAD MYSQL SERVERS TO RUNTIME and SAVE MYSQL SERVERS TO RUNTIME was executed. Setup:
runtime_mysql_group_replication_hostgroups is configured like this:
The idea was to configure ProxySQL in such a way that if all group replication members are lost the remaining asynchronous slave would have to be the next writer node. This type of topology may not have been tested or may not even be supported but then I found out that inserting data in So with the setup above, insert data into mysql_replication_hostgroups and then execute LOAD/SAVE then check table content. Here's an example script to simulate the issue.
Result of above run:
See in Step 5 runtime_mysql_replication_hostgroups is empty even though in Step 3 we can see it was not. |
@riveraja : please attach the full error log. |
proxysql.log
The proxysql server was inadvertently restarted but tests were done before this time. Fwiw, now that the GR nodes and async node are offline and inaccessible, the proxysql configuration looks correct with data in runtime_mysql_group_replication_hostgroups available. So I am not sure what I'm missing here.
|
Rene, it seems like the issue is reproducible with a clustered ProxySQL at least 2-nodes, then setup a 3-node MySQL GR cluster + 1 async slave. setup should be simple. Based on my tests this only happens if a secondary GR member will be set to OFFLINE_HARD by ProxySQL if slave starts lagging for this you'll need to run sysbench to put at least one secondary in lagging state. |
Hi René, we have tested with 2.0.7 and we are still seeing the problem. |
ProxySQL version 1.4.12
when config mysql_replication_hostgroups and load to runtime,table runtime_mysql_replication_hostgroups is null,but monitor table has read_only check record. is something wrong?
example:
insert into mysql_servers(hostgroup_id,hostname,port) values(678,'xxx.18',4591);
insert into mysql_servers(hostgroup_id,hostname,port) values(678,'xxx.37',4591);
insert into mysql_replication_hostgroups(writer_hostgroup,reader_hostgroup,comment) values(676,678,'datacenter cluster');
save mysql servers to disk;
load mysql servers to runtime;
Admin> SELECT * FROM monitor.mysql_server_read_only_log ORDER BY time_start_us DESC LIMIT 10;
+-------------+------+------------------+-----------------+-----------+-------+
| hostname | port | time_start_us | success_time_us | read_only | error |
+-------------+------+------------------+-----------------+-----------+-------+
| xxxx.37 | 4591 | 1547020972908350 | 320 | 1 | NULL |
| xxxx.18 | 4591 | 1547020972876992 | 438 | 1 | NULL |
+-------------+------+------------------+-----------------+-----------+-------+
2 rows in set (0.00 sec)
but runtime_mysql_replication_hostgroups is null
Admin> select * from runtime_mysql_replication_hostgroups;
Empty set (0.00 sec)
Admin> select * from mysql_replication_hostgroups ;
+------------------+------------------+--------------------+
| writer_hostgroup | reader_hostgroup | comment |
+------------------+------------------+--------------------+
| 998 | 999 | datacenter cluster |
+------------------+------------------+--------------------+
1 row in set (0.00 sec)
The text was updated successfully, but these errors were encountered: