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

spider cannot connect to remote server after restart

    XMLWordPrintable

Details

    Description

      Not sure whether it is a spider bug, a sql service bug, or an mtr issue

      Testcase (put under storage/spider/mysql-test/spider/bugfix/t/):

      10.11 26898dca74722955538c8eddc477f7d1367836d6

      --disable_query_log
      --disable_result_log
      --source ../../t/test_init.inc
      --enable_result_log
      --enable_query_log
      evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
      OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
      create table t2 (c int);
      create table t1 (c int) ENGINE=Spider
      COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
      --source include/restart_mysqld.inc
      select * from t1;
       
      drop table t1, t2;
      drop server srv;
      --disable_query_log
      --disable_result_log
      --source ../../t/test_deinit.inc
      --enable_result_log
      --enable_query_log
      

      Fails with

      mysqltest: At line 14: query 'select * from t1' failed: ER_CONNECT_TO_FOREIGN_DATA_SOURCE (1429): Unable to connect to foreign data source: srv
      

      Getting errno == 2 below, but no idea how to trace its change

      my_bool
      vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len, int timeout)
      {
      /*  [... 18 lines elided]
      #else
        wait= (ret == -1) && (errno == EINPROGRESS || errno == EALREADY);
      #endif
      /*  [... 50 lines elided]
      }
      

      Trace:
      vio_socket_connect > connect_sync > server_mysql_real_connect > spider_db_connect > spider_db_before_query > spider_db_set_names > spider_db_show_table_status > spider_get_share > ha_spider::open > open_table_from_share > open_table > open_tables > open_and_lock_tables > execute_sqlcom_select > mysql_execute_command > dispatch_command > do_command > do_handle_one_connection > pfs_spawn_thread

      Attachments

        Activity

          People

            ycp Yuchen Pei
            ycp Yuchen Pei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.