Skip to content

PROXYSQL40: runtime_only discovered servers are wiped by LOAD MYSQL SERVERS TO RUNTIME and persisted by Cluster runtime pulls #6523

Open

Description

@nethalo

Summary

Desired sets posted with ProxySQL_ServerPersistence::runtime_only live only in the Hostgroups Manager.

  • Any LOAD MYSQL SERVERS TO RUNTIME rebuilds runtime from main.mysql_servers and drops them. The delegated hostgroups stay empty until the discovery controller posts again.
  • Under the default Cluster sync algorithm, the opposite also happens: a peer adopts another node's discovered rows and, with cluster_mysql_servers_save_to_disk, persists them as operator rows.

Code

At 73eb079 (identical on v3.0 8b23f48 and on #6514 head 4a25dd6):

  • lib/ProxySQL_Admin.cpp:8489: runtime_only makes materialization return early, so nothing reaches main.mysql_servers.
  • lib/ProxySQL_Admin.cpp:9170: LOAD rebuilds runtime from main.mysql_servers only, and publishes after commit (:9367).
  • lib/ProxySQL_Cluster.cpp:2057-2106: the runtime pull (sync algorithm 1, the default) adopts the peer's runtime_mysql_servers, including the peer's discovered rows. With save_to_disk, save_mysql_servers_runtime_to_database(false) writes them into main.mysql_servers and to disk.

Reproduction

  1. A server-discovery plugin posts a runtime_only set for hostgroups 10/11.
  2. Run LOAD MYSQL SERVERS TO RUNTIME.
  3. Hostgroups 10/11 are empty until the controller's next successful post. If its external source is failing (for example the AWS API is throttling or credentials expired), they stay empty until it recovers.

Impact

  • Every LOAD opens a window with no backends for the delegated hostgroups. The window is unbounded while the source is down.
  • In a Cluster with the default algorithm, one node's discovered rows become persisted rows on its peers. Later LOADs re-insert them, including instances that no longer exist.

Suggested direction

  • Keep the last applied runtime_only desired set of currently delegated hostgroups across LOAD and Cluster pulls (merge it into the rebuilt runtime).
  • Exclude delegated hostgroups from runtime-pull persistence, or document that save_to_disk persists them.

Found while testing the ProxySQL AWS plugin (managed discovery, runtime_only persistence).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions