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

namedserverfilter fails to direct query if first server listed in targetXY is in maintenance mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.5
    • Fix Version/s: 2.3.7
    • Component/s: readwritesplit
    • Labels:
      None
    • Sprint:
      MXS-SPRINT-80, MXS-SPRINT-81

      Description

      The namedserverfilter fails to direct query if 1st server listed in targetXY is in maintenance mode (or probably otherwise unreachable).

      $ maxscale --version
      MaxScale 2.3.5
       
      [NamedServerFilter]
      type=filter
      module=namedserverfilter
      user=root
      match03=^.*$
      target03=server2,server3
      

      server2 and server3 are both slaves.

      If both server2 and server3 are running, then queries to port 4006 (listening port of RWSplitter) work fine.

      If I place server3 (the second listed in targetXY), then it also works fine, and the query is directed to server2.

      However, if I place server2 (the first listed in targetXY) into maintenance mode:

      set server server2 maintenance
      

      Then the query fails:

      $ mysql -uroot -pxxx -h127.0.0.1 -P4006 -e"select @@port"
      ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query
      

      And I see this in the error log:

      2019-04-06 01:03:14   info   : (13) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 18, type: QUERY_TYPE_READ|QUERY_TYPE_SYSVAR_READ, stmt: select @@port, Hint: HINT_ROUTE_TO_NAMED_SERVER
      2019-04-06 01:03:14   info   : (13) Hint: route to server 'server3'
      2019-04-06 01:03:14   info   : (13) Hint: route to server 'server2'
      2019-04-06 01:03:14   info   : (13) Was supposed to route to named server server2 but couldn't find the server in a suitable state. Server state: Maintenance, Running
      2019-04-06 01:03:14   error  : (13) Could not find valid server for target type TARGET_SLAVE, closing connection.
      2019-04-06 01:03:14   error  : (13) Routing the query failed. Session will be closed.
      2019-04-06 01:03:14   info   : Stopped Read-Write-Service client session [13]
      

      It seems like it should attempt other servers listed instead of failing after only checking the first server listed.

        Attachments

          Activity

            People

            Assignee:
            esa.korhonen Esa Korhonen
            Reporter:
            ccalender Chris Calender
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration