Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15935

Connection Redirection Mechanism in MariaDB Client/Server Protocol

    XMLWordPrintable

    Details

      Description

      Why

      Redirection mechanism is widely used in proxy-based scenario.
      Currently when multiple servers share one proxy, proxy forwards all the packets between servers and clients. Thus, the proxy adds latency, take many computing resources and impacts the overall performance. Especially for short connections scenarios like WordPress, the latency can be a critical issue.
      Supporting redirection mechanism is helpful for proxy-based scenario. It is more like HTTP redirects [1] or Oracle redirected connections [2]. Clients get the servers’ address from proxies and connect to servers transparently without latency and computing resource wasted.

      What to Do

      Client/Server Protocol change needs both client and server support.
      Ending connection OK_Packet info field might contain redirection information.

      Either connector support redirection mechanism and will close current connection and redirect to indicated value, or if not supporting redirection (or redirection is disable) then driver will continue using current connection.
      There is no recursion, meaning that connector that have been redirect will not take another redirection in account.

      info field format is then:

      Location: mysql:[replication:|loadbalance:|sequential:]//<hostDescription>[,<hostDescription>...]/[database][?<key1>=<value1>[&<key2>=<value2>]]\n
      

      HostDescription:

      <host>[:<portnumber>] or address=(host=<host>)[(port=<portnumber>)][(type=(master|slave))]
      

      specific redirection option:

      option description
      user if set, must superseed connection user.
      ttl validity timeout in second. This permit caching redirection client side. 0 means no caching 'default'

        Attachments

        1. redirection.pcapng
          1.62 MB
        2. redirection.png
          redirection.png
          229 kB
        3. screenshot-1.png
          screenshot-1.png
          11 kB
        4. screenshot-2.png
          screenshot-2.png
          12 kB
        5. screenshot-3.png
          screenshot-3.png
          12 kB
        6. screenshot-4.png
          screenshot-4.png
          5 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              elemount Alex Lee
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration