Open FelixChong opened 6 years ago
Hi @FelixChong , the new configuration for default hostgroup will only affect newly connected sessions, changing default hostgroup is not supposed to disconnect existing sessions from any host. Create some new connections with new mysql_users configuration and see if you're routed to hostgroup 1.
I hope I understood the use case correctly.
Hi @tapuhi , you are right, the new connections will route to hg 1 correctly.
But my use case want to affect those old connections immediately, may I know if any I can do to achieve this?
Thanks.
@FelixChong : you can create new a new rule in mysql_query_rules
, matching the specific user an setting the correct destination_hostgroup
I was thinking of that but then he will have to maintain those query rules for each user default group change. Would be nice if it was possible to move to new default historiography by draining the connections of a specific user and reconnect to the new host group , by waiting for those connections to be idle for example.
@tapuhi , as you pointed already the new setting applies only to new connections. This because the Authentication module is queries only during the creation of new connections.
Constantly checking if default_hostgroup
has changed will have a performance impact. But perhaps is possible to trigger a further check only if LOAD MYSQL USERS TO RUNTIME
was executed: therefore I will leave this issue open.
One further note: it is possible to terminate client connections running KILL CONNECTION
in Admin.
@tapuhi @renecannao Thanks for your guys answer
Hi,
I found that after changing MYSQL USERS default_hostgroup, it's not effected immediately. I am not sure if it's a bug or incorrectly config. Below are the snapshots of my case.
1, By default, I have two server and one user (here the user default hostgroup is pointing to 0)
2, I run some tests and found the queries routed to hostgroup 0 as default correctly.
3, I updated user's default hostgroup to 1 and load to runtime
4, I found the queries are still routed to hostgroup 0 with those used connections.
Sincerely hope someone can help to answer this. Thanks!