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

Cancel drain causes connection problems

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.8
    • Fix Version/s: N/A
    • Component/s: maxctrl
    • Labels:
      None
    • Environment:
      Debian 10, Maria 10.5, Maxscale 2.5.8~buster-1
    • Sprint:
      MXS-SPRINT-127

      Description

      If you run drain and then cancel (ctrl-C) before it ends, maxscale create temporary cnf file - /var/lib/maxscale/maxscale.cnf.d/Splitter-Service.cnf

      In targets will be only 2 of 3 server (excluding drained server). If drained server is master, you will get unwanted state, when in "list servers" you have all 3 servers running, but connection doesnt work.
      In log is:

      error  : (1) [readwritesplit] (Splitter-Service) Couldn't find suitable Master from 2 candidates.
      

      Restart doesnt fix this issue, you have to remove cnf file and restart maxscale or drain server again to complete the process.

      Step by step:

      maxctrl list servers - WORKING
      │ Server │ Address    │ Port │ Connections │ State                   │ GTID          │
      │ db1    │ 10.0.0.31 │ 3306 │ 0           │ Slave, Synced, Running  │ 0-1-690759442 │
      │ db2    │ 10.0.0.32 │ 3306 │ 0           │ Slave, Synced, Running  │ 0-2-690033556 │
      │ db3    │ 10.0.0.33 │ 3306 │ 0           │ Master, Synced, Running │ 0-3-690166487 │
       
      maxctrl drain server db3
      ^C
      maxctrl
       maxctrl list servers
      │ Server │ Address    │ Port │ Connections │ State                   │ GTID          │
      │ db1    │ 10.0.0.31 │ 3306 │ 0           │ Slave, Synced, Running  │ 0-1-690759442 │
      │ db2    │ 10.0.0.32 │ 3306 │ 0           │ Slave, Synced, Running  │ 0-2-690033556 │
      │ db3    │ 10.0.0.33 │ 3306 │ 0           │ Master, Synced, Running │ 0-3-690166511 │
       
      # cat /var/lib/maxscale/maxscale.cnf.d/Splitter-Service.cnf | grep targets
      targets=db1,db2
       
      # mysql -u user -h 10.0.0.10 -p
      Enter password: 
      ERROR 1815 (HY000): Internal error: Session creation failed
      

      I think it is necessary to make some trap or lock...

        Attachments

          Activity

            People

            Assignee:
            markus makela markus makela
            Reporter:
            danielfarkas Daniel Farkas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration