Uploaded image for project: 'ProxySQL and Admin Scripts'
  1. ProxySQL and Admin Scripts
  2. PSQLADM-13

Server losses it's weight once it becomes offline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I have a requirement that server .73 should only receive writes if .72 is down. I do that by setting a high weight on .72 and a lower weight on .73 . If I take .73 server down to maintenance or do a cold backup (for example) it will lose it's defined weight.

      mysql> SELECT * FROM mysql_servers;
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | 11 | 192.168.19.72 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READ |
      | 10 | 192.168.19.71 | 3306 | ONLINE | 1000000 | 0 | 1000 | 0 | 0 | 0 | WRITE |
      | 11 | 192.168.19.73 | 3306 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | READ |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      3 rows in set (0.00 sec)
      
      mysql> SELECT * FROM mysql_servers;
      +--------------+---------------+------+--------------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
      +--------------+---------------+------+--------------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | 11 | 192.168.19.72 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READ |
      | 10 | 192.168.19.71 | 3306 | ONLINE | 1000000 | 0 | 1000 | 0 | 0 | 0 | WRITE |
      | 11 | 192.168.19.73 | 3306 | OFFLINE_SOFT | 1 | 0 | 1000 | 0 | 0 | 0 | READ |
      +--------------+---------------+------+--------------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      3 rows in set (0.00 sec)
      
      mysql> SELECT * FROM mysql_servers;
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | 11 | 192.168.19.72 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READ |
      | 10 | 192.168.19.71 | 3306 | ONLINE | 1000000 | 0 | 1000 | 0 | 0 | 0 | WRITE |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      2 rows in set (0.00 sec)
      
      mysql> SELECT * FROM mysql_servers;
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      | 11 | 192.168.19.72 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READ |
      | 10 | 192.168.19.71 | 3306 | ONLINE | 1000000 | 0 | 1000 | 0 | 0 | 0 | WRITE |
      | 11 | 192.168.19.73 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READ |
      +--------------+---------------+------+--------+---------+-------------+-----------------+---------------------+---------+----------------+---------+
      3 rows in set (0.00 sec)

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ramesh.sivaraman Ramesh Sivaraman
                Reporter:
                marcelo.altmann Marcelo Altmann
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: