Skip to content
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

Server wrongly used as reader for Galera cluster with 'writer_is_also_reader=2' #3219

Closed
5 tasks done
JavierJF opened this issue Dec 23, 2020 · 0 comments · Fixed by #3220
Closed
5 tasks done

Server wrongly used as reader for Galera cluster with 'writer_is_also_reader=2' #3219

JavierJF opened this issue Dec 23, 2020 · 0 comments · Fixed by #3220

Comments

@JavierJF
Copy link
Collaborator

  • A clear description of the issue

A server is wrongly placed in the reader_hostgroup for writer_is_also_reader=2 when there are no backup servers available.

  • ProxySQL version

  • v2.0.16

  • v2.1.0

  • OS version

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
  • The steps to reproduce the issue
  1. Configure ProxySQL with the following mysql_galera_hostgroups and mysql_servers configuration:

    mysql> select * from runtime_mysql_galera_hostgroups;
    +------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
    | writer_hostgroup | backup_writer_hostgroup | reader_hostgroup | offline_hostgroup | active | max_writers | writer_is_also_reader | max_transactions_behind | comment |
    +------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
    | 20               | 30                      | 10               | 40                | 1      | 1           | 2                     | 100                     | NULL    |
    +------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
    1 row in set (0.00 sec)
    
    mysql> select * from mysql_servers;
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    | hostgroup_id | hostname    | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    | 10           | 172.18.1.11 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
    | 10           | 172.18.1.12 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    2 rows in set (0.00 sec)
    
  2. Configure server 172.18.1.11 read only with: SET GLOBAL read_only=ON;

  3. Start ProxySQL.

  4. Check that the current writer is in the reader hostgroup, when only one server should be present.

    mysql> select * from runtime_mysql_servers;
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    | hostgroup_id | hostname    | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    | 10           | 172.18.1.11 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
    | 20           | 172.18.1.12 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
    | 10           | 172.18.1.12 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
    +--------------+-------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
    3 rows in set (0.00 sec)
    
  • The full ProxySQL error log (default location: /var/lib/proxysql/proxysql.log)

Attached can be found:

  • Full ProxySQL error log during the issue reproduction.
  • mysql_servers table configuration.
  • galera_hostgroups table configuration.
  • Final runtime_mysql_servers state.

extra_reader_wiar_two.tar.gz

renecannao added a commit that referenced this issue Dec 27, 2020
Closes #3219: Server wrongly used as reader for Galera cluster with 'writer_is_also_reader=2'
renecannao added a commit that referenced this issue Dec 27, 2020
Closes #3219: Server wrongly used as reader for Galera cluster with 'writer_is_also_reader=2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant