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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.3.5
    • 2.3.7
    • readwritesplit
    • None
    • 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

            esa.korhonen Esa Korhonen
            ccalender Chris Calender (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.