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

Spider: variable spider_same_server_link not functioning correctly

Details

    Description

      With thanks to elenst and nayuta-yanagisawa.

      In principle, it should not be possible to make a connection to the same local instance without setting spider_same_server_link to 1.

      However, as seen in several recent bugs, it is possible to create a socket (and possibly a tcp) connection to the same local instance with this variable still set to 0/off (the default).

      As a sidethought, when this is fixed, any testcase which does not have spider_same_server_link=1 set, may need to be updated.

      Relevant code:

          if (!spider_param_same_server_link(thd))
          {
            if (!strcmp(tgt_host, my_localhost))
            {
              if (!strcmp(tgt_socket, *spd_mysqld_unix_port))
              {
                my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM,
                  ER_SPIDER_SAME_SERVER_LINK_STR1, MYF(0),
                  tgt_host, tgt_socket);
                DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM);
              }
            } else if (!strcmp(tgt_host, "127.0.0.1") ||
              !strcmp(tgt_host, glob_hostname))
            {
              if (tgt_port == (long) *spd_mysqld_port)
              {
                my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM,
                  ER_SPIDER_SAME_SERVER_LINK_STR2, MYF(0),
                  tgt_host, tgt_port);
                DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM);
              }
            }
          }
      

      Attachments

        Activity

          Another item to consider here, again with thanks to elenst:

          For the final test cases in the regression suite it may be best to switch them to host/port to allow running Spider tests on Windows, assuming socket does not work there. It is possible that some (Spider/MTR) mechanism exists to make the socket based tests work on Windows, but it is unlikely and needs to be checked.

          Roel Roel Van de Paar added a comment - Another item to consider here, again with thanks to elenst : For the final test cases in the regression suite it may be best to switch them to host/port to allow running Spider tests on Windows, assuming socket does not work there. It is possible that some (Spider/MTR) mechanism exists to make the socket based tests work on Windows, but it is unlikely and needs to be checked.
          ycp Yuchen Pei added a comment -

          Hi holyfoot, ptal thanks

          upstream/bb-10.4-mdev-29718 5f02c65d468fa28be4cdc71ba5a415c76f3a0814
          MDEV-29718 Fix spider detection of same data node server
           
          When the host is not specified, it defaults to localhost.
          

          11.0 patch:

          c9bc42416af upstream/bb-11.0-mdev-29718 MDEV-29718 Fix spider detection of same data node server
          

          ycp Yuchen Pei added a comment - Hi holyfoot , ptal thanks upstream/bb-10.4-mdev-29718 5f02c65d468fa28be4cdc71ba5a415c76f3a0814 MDEV-29718 Fix spider detection of same data node server   When the host is not specified, it defaults to localhost. 11.0 patch: c9bc42416af upstream/bb-11.0-mdev-29718 MDEV-29718 Fix spider detection of same data node server

          ok to push.

          holyfoot Alexey Botchkov added a comment - ok to push.
          ycp Yuchen Pei added a comment -

          thanks for the review - pushed bc3d416a17c9d35382f2db6387e51619e80c59da to 10.4

          ycp Yuchen Pei added a comment - thanks for the review - pushed bc3d416a17c9d35382f2db6387e51619e80c59da to 10.4

          People

            ycp Yuchen Pei
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.