Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-5636

Maxctrl reports phantom connections

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 23.08.7
    • N/A
    • N/A
    • None

    Description

      This behavior has been seen multiple times on a customer's production instance, but we do not currently have a way to reproduce. Adding this info to a bug report to save time reinvestigating down the road.

      Customer Setup
      Two maxscales on version 23.08.7. These are in an active/passive configuration, with a virtual IP managed by keepalived
      dbproxy1
      dbproxy2

      Three database servers in async replication. db1 is the primary and db2 and db3 are replicas:
      db1
      db2
      db3

      Behavior
      Before patching, dbproxy1 was the active maxscale. There were no connections through dbproxy2.jpn:

      dbproxy2.jpn
      ┌─────────┬───────────────┬──────┬─────────────┬─────────────────┬──────────────┬─────────────────┐
      │ Server  │ Address       │ Port │ Connections │ State           │ GTID         │ Monitor         │
      ├─────────┼───────────────┼──────┼─────────────┼─────────────────┼──────────────┼─────────────────┤
      │ db1.jpn │ 10.60.120.24133060           │ Master, Running │ 0-1-43412200 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼─────────────────┼──────────────┼─────────────────┤
      │ db2.jpn │ 10.60.120.24933060           │ Slave, Running  │ 0-1-43412200 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼─────────────────┼──────────────┼─────────────────┤
      │ db3.jpn │ 10.60.120.24833060           │ Slave, Running  │ 0-1-43412200 │ MariaDB-Monitor │
      └─────────┴───────────────┴──────┴─────────────┴─────────────────┴──────────────┴─────────────────┘
      Connection to dbproxy2.jpn closed.
      

      After patching and rebooting, dbproxy2.jpn reported 14 connections, including connections to a server in maintenance mode:

      PRD [srv-kyle.turner@dbproxy2-jpn.mfg.aristanetworks.com ~]$ maxctrl list servers
      ┌─────────┬───────────────┬──────┬─────────────┬──────────────────────┬──────────────┬─────────────────┐
      │ Server  │ Address       │ Port │ Connections │ State                │ GTID         │ Monitor         │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db1.jpn │ 10.60.120.241330614          │ Master, Running      │ 0-1-49794523 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db2.jpn │ 10.60.120.249330614          │ Maintenance, Running │ 0-1-49794523 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db3.jpn │ 10.60.120.248330614          │ Slave, Running       │ 0-1-49794523 │ MariaDB-Monitor │
      └─────────┴───────────────┴──────┴─────────────┴──────────────────────┴──────────────┴─────────────────┘
      

      All sessions appeared as soon as maxscale started, and were in an idle state. I couldn’t find any evidence of these connections on the backend server:

      PRD [srv-kyle.turner@dbproxy2-jpn.mfg.aristanetworks.com ~]$ maxctrl list sessions
      ┌─────┬──────────┬───────────────┬───────────────────────┬───────┬────────────────────┬────────┬──────────────┐
      │ Id  │ User     │ Host          │ Connected             │ Idle  │ Service            │ Memory │ I/O-Activity │
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      103 │ arastra2 │ 10.60.121.333/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 691620
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      6   │ arastra2 │ 10.60.121.1023/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      19  │ arastra2 │ 10.60.121.1203/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      4   │ arastra2 │ 10.60.121.353/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      80  │ arastra2 │ 10.60.121.343/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 33780
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      3   │ arastra2 │ 10.60.121.423/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689300
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      102 │ arastra2 │ 10.60.121.683/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 691620
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      11  │ arastra2 │ 10.60.121.583/25/2025, 9:24:26 PM │ 260   │ Read-Write-Service │ 34350
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      10  │ arastra2 │ 10.60.121.803/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      101 │ arastra2 │ 10.60.122.453/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 691620
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      5   │ arastra2 │ 10.60.121.683/25/2025, 9:24:26 PM │ 260   │ Read-Write-Service │ 34350
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      35  │ arastra2 │ 10.60.122.453/25/2025, 9:24:26 PM │ 260   │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      41  │ arastra2 │ 10.60.121.333/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 689870
      ├─────┼──────────┼───────────────┼───────────────────────┼───────┼────────────────────┼────────┼──────────────┤
      97  │ arastra2 │ 10.60.121.353/25/2025, 9:24:26 PM │ 259.9 │ Read-Write-Service │ 691620
      └─────┴──────────┴───────────────┴───────────────────────┴───────┴────────────────────┴────────┴──────────────┘
      

      Over time, the connections started to drop off, but maxscale still overreported the number of sessions. Here’s an example of the processlist when maxscale reported 7 connections.

      Sessions:

      PRD [srv-kyle.turner@dbproxy2-jpn.mfg.aristanetworks.com ~]$ maxctrl list sessions
      ┌────┬──────────┬───────────────┬───────────────────────┬────────┬────────────────────┬────────┬──────────────┐
      │ Id │ User     │ Host          │ Connected             │ Idle   │ Service            │ Memory │ I/O-Activity │
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      6  │ arastra2 │ 10.60.121.1023/25/2025, 9:24:26 PM │ 1215.1 │ Read-Write-Service │ 689870
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      4  │ arastra2 │ 10.60.121.353/25/2025, 9:24:26 PM │ 1215.1 │ Read-Write-Service │ 689870
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      80 │ arastra2 │ 10.60.121.343/25/2025, 9:24:26 PM │ 1215.1 │ Read-Write-Service │ 34350
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      11 │ arastra2 │ 10.60.121.583/25/2025, 9:24:26 PM │ 1215.2 │ Read-Write-Service │ 34350
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      5  │ arastra2 │ 10.60.121.683/25/2025, 9:24:26 PM │ 1215.2 │ Read-Write-Service │ 34350
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      35 │ arastra2 │ 10.60.122.453/25/2025, 9:24:26 PM │ 1215.2 │ Read-Write-Service │ 689870
      ├────┼──────────┼───────────────┼───────────────────────┼────────┼────────────────────┼────────┼──────────────┤
      41 │ arastra2 │ 10.60.121.333/25/2025, 9:24:26 PM │ 1215.1 │ Read-Write-Service │ 689870
      └────┴──────────┴───────────────┴───────────────────────┴────────┴────────────────────┴────────┴──────────────┘
      

      vs Processlist:

      MariaDB [(none)]> show processlist;
      +------------+-------------+---------------------+------+-----------+------+--------------------------------------------------------+------------------+----------+
      | Id         | User        | Host                | db   | Command   | Time | State                                                  | Info             | Progress |
      +------------+-------------+---------------------+------+-----------+------+--------------------------------------------------------+------------------+----------+
      |     147061 | maxscale    | 10.60.120.253:57308 | NULL | Sleep     |    0 |                                                        | NULL             |    0.000 |
      | 1002866361 | monyogmon   | 10.90.194.13:41832  | NULL | Sleep     |    0 |                                                        | NULL             |    0.000 |
      | 1002867462 | monyogmon   | 10.90.194.13:41896  | NULL | Sleep     |   50 |                                                        | NULL             |    0.000 |
      | 1022986714 | system user |                     | NULL | Slave_IO  | 2473 | Waiting for master to send event                       | NULL             |    0.000 |
      | 1022986715 | system user |                     | NULL | Slave_SQL |    0 | Slave has read all relay log; waiting for more updates | NULL             |    0.000 |
      | 1023595799 | maxscale    | 10.60.120.245:49310 | NULL | Sleep     |    0 |                                                        | NULL             |    0.000 |
      | 1023745598 | root        | localhost           | NULL | Query     |    0 | starting                                               | show processlist |    0.000 |
      +------------+-------------+---------------------+------+-----------+------+--------------------------------------------------------+------------------+----------+
      

      maxctrl output:

      PRD [srv-kyle.turner@dbproxy2-jpn.mfg.aristanetworks.com ~]$ maxctrl list servers
      ┌─────────┬───────────────┬──────┬─────────────┬──────────────────────┬──────────────┬─────────────────┐
      │ Server  │ Address       │ Port │ Connections │ State                │ GTID         │ Monitor         │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db1.jpn │ 10.60.120.24133067           │ Master, Running      │ 0-1-49797185 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db2.jpn │ 10.60.120.24933067           │ Maintenance, Running │ 0-1-49797185 │ MariaDB-Monitor │
      ├─────────┼───────────────┼──────┼─────────────┼──────────────────────┼──────────────┼─────────────────┤
      │ db3.jpn │ 10.60.120.24833067           │ Slave, Running       │ 0-1-49797185 │ MariaDB-Monitor │
      └─────────┴───────────────┴──────┴─────────────┴──────────────────────┴──────────────┴─────────────────┘
      

      Finally, I've attached two additional snippets. The first shows maxctrl show sessions output on the nonexistent connections. The second shows startup logs just before maxscale started reporting phantom connections.

      Attachments

        Activity

          People

            markus makela markus makela
            j_kyle J Kyle Turner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.