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

Spider: [ERROR] Got error 12701 when reading table './test/t' on SELECT

Details

    Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c INT KEY,c2 INT,KEY(c2)) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
      ALTER TABLE t ADD c2 BINARY FIRST;
      SELECT * FROM t WHERE c2='' AND c2='' AND c='' ORDER BY c2 DESC;
      

      Leads to an ERROR visible in the error log only:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      2021-09-06 11:19:39 4 [ERROR] Got error 12701 when reading table './test/t'
      

      Furthermore, error 12701 is undefined:

      $ ./bin/perror 12701
      Illegal error code: 12701
      

      Bug confirmed present in:
      MariaDB: 10.4.22 (dbg), 10.4.22 (opt), 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar created issue -
            Roel Roel Van de Paar made changes -
            Field Original Value New Value

            Secondary testcase

            INSTALL PLUGIN spider SONAME 'ha_spider.so';
            CREATE SERVER d FOREIGN DATA WRAPPER mysql OPTIONS (HOST'',DATABASE'',USER'',PORT 10000,PASSWORD'');
            CREATE TABLE t1 (c1 INT KEY,c2 INT) ENGINE=SPIDER PARTITION BY LIST COLUMNS(c1)(PARTITION p1 DEFAULT ENGINE=SPIDER);
            SELECT c1,sum(c3) FROM t1;
            SELECT * FROM t1 WHERE c1='838:59:59';
            

            Roel Roel Van de Paar added a comment - Secondary testcase INSTALL PLUGIN spider SONAME 'ha_spider.so' ; CREATE SERVER d FOREIGN DATA WRAPPER mysql OPTIONS (HOST '' , DATABASE '' , USER '' ,PORT 10000, PASSWORD '' ); CREATE TABLE t1 (c1 INT KEY ,c2 INT ) ENGINE=SPIDER PARTITION BY LIST COLUMNS(c1)(PARTITION p1 DEFAULT ENGINE=SPIDER); SELECT c1, sum (c3) FROM t1; SELECT * FROM t1 WHERE c1= '838:59:59' ;

            12701 seems to be a Spider-specific error code, ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - 12701 seems to be a Spider-specific error code, ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM .
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            Roel Roel Van de Paar made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]

            The error message is printed by in sql_print_error(). The error itself is raised by spider_db_set_names_internal().

            spider_db_set_names_internal (trx=0x7f8f240f38e0, share=0x7f8f24124be0, conn=0x7f8f24134d80, all_link_idx=0, need_mon=0x7f8f24130af0)
                at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:910
            910             spider_db_before_query(conn, need_mon) ||
            (rr) n
            909           if (
            (rr) n
            913             DBUG_RETURN(spider_db_errorno(conn));
            (rr) p spider_db_errorno(conn)
            $14 = 12701
            

            (rr) bt
            #0  spider_db_set_names_internal (trx=0x7f8f240f38e0, share=0x7f8f24124be0, conn=0x7f8f24134d80, all_link_idx=0, need_mon=0x7f8f24130af0)
                at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:913
            #1  0x00007f8efe768c70 in spider_db_set_names (spider=0x7f8f241219e8, conn=0x7f8f24134d80, link_idx=0) at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:955
            #2  0x00007f8efe80ae19 in ha_spider::index_read_map_internal (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/storage/spider/ha_spider.cc:2374
            #3  0x00007f8efe80bcc1 in ha_spider::index_read_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/storage/spider/ha_spider.cc:2633
            #4  0x000055e3ceee4557 in handler::index_read_idx_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/sql/handler.cc:6114
            #5  0x000055e3ceedb5a7 in handler::ha_index_read_idx_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/sql/handler.cc:2965
            #6  0x000055e3cf74484a in ha_partition::index_read_idx_map (this=0x7f8f240f0948, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/sql/ha_partition.cc:5849
            #7  0x000055e3ceedb5a7 in handler::ha_index_read_idx_map (this=0x7f8f240f0948, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT)
                at /home/nayuta/repo/mariadb-server/sql/handler.cc:2965
            #8  0x000055e3cebe4329 in join_read_const (tab=0x7f8f24022728) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:21162
            #9  0x000055e3cebe3de3 in join_read_const_table (thd=0x7f8f2400cb30, tab=0x7f8f24022728, pos=0x7f8f24022cd8) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:21040
            #10 0x000055e3cebb9191 in make_join_statistics (join=0x7f8f24021888, tables_list=..., keyuse_array=0x7f8f24021b78) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:5336
            #11 0x000055e3cebae418 in JOIN::optimize_inner (this=0x7f8f24021888) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:2316
            #12 0x000055e3cebabd1f in JOIN::optimize (this=0x7f8f24021888) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:1659
            #13 0x000055e3cebb72a4 in mysql_select (thd=0x7f8f2400cb30, tables=0x7f8f2401f948, wild_num=1, fields=..., conds=0x7f8f24020800, og_num=1, order=0x7f8f24021678, group=0x0, having=0x0,
                proc_param=0x0, select_options=2147486464, result=0x7f8f24021860, unit=0x7f8f24010a60, select_lex=0x7f8f2401f368) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:4740
            #14 0x000055e3ceba6b76 in handle_select (thd=0x7f8f2400cb30, lex=0x7f8f240109a0, result=0x7f8f24021860, setup_tables_done_option=0)
                at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:436
            #15 0x000055e3ceb6b84c in execute_sqlcom_select (thd=0x7f8f2400cb30, all_tables=0x7f8f2401f948) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:6449
            #16 0x000055e3ceb62010 in mysql_execute_command (thd=0x7f8f2400cb30) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:3963
            #17 0x000055e3ceb6f86c in mysql_parse (thd=0x7f8f2400cb30, rawbuf=0x7f8f2401f278 "SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC", length=70,
                parser_state=0x7f8f1805e480, is_com_multi=false, is_next_command=false) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:7995
            #18 0x000055e3ceb5bb77 in dispatch_command (command=COM_QUERY, thd=0x7f8f2400cb30, packet=0x7f8f24016a91 "SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC",
                packet_length=70, is_com_multi=false, is_next_command=false) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:1857
            #19 0x000055e3ceb5a3e3 in do_command (thd=0x7f8f2400cb30) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:1373
            #20 0x000055e3cecec82b in do_handle_one_connection (connect=0x55e3d2149b40) at /home/nayuta/repo/mariadb-server/sql/sql_connect.cc:1420
            #21 0x000055e3cecec4c7 in handle_one_connection (arg=0x55e3d2149b40) at /home/nayuta/repo/mariadb-server/sql/sql_connect.cc:1316
            #22 0x00007f8f31afc450 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
            #23 0x00007f8f31695d53 in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - The error message is printed by in sql_print_error() . The error itself is raised by spider_db_set_names_internal() . spider_db_set_names_internal (trx=0x7f8f240f38e0, share=0x7f8f24124be0, conn=0x7f8f24134d80, all_link_idx=0, need_mon=0x7f8f24130af0) at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:910 910 spider_db_before_query(conn, need_mon) || (rr) n 909 if ( (rr) n 913 DBUG_RETURN(spider_db_errorno(conn)); (rr) p spider_db_errorno(conn) $14 = 12701 (rr) bt #0 spider_db_set_names_internal (trx=0x7f8f240f38e0, share=0x7f8f24124be0, conn=0x7f8f24134d80, all_link_idx=0, need_mon=0x7f8f24130af0) at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:913 #1 0x00007f8efe768c70 in spider_db_set_names (spider=0x7f8f241219e8, conn=0x7f8f24134d80, link_idx=0) at /home/nayuta/repo/mariadb-server/storage/spider/spd_db_conn.cc:955 #2 0x00007f8efe80ae19 in ha_spider::index_read_map_internal (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/storage/spider/ha_spider.cc:2374 #3 0x00007f8efe80bcc1 in ha_spider::index_read_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/storage/spider/ha_spider.cc:2633 #4 0x000055e3ceee4557 in handler::index_read_idx_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/sql/handler.cc:6114 #5 0x000055e3ceedb5a7 in handler::ha_index_read_idx_map (this=0x7f8f241219e8, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/sql/handler.cc:2965 #6 0x000055e3cf74484a in ha_partition::index_read_idx_map (this=0x7f8f240f0948, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/sql/ha_partition.cc:5849 #7 0x000055e3ceedb5a7 in handler::ha_index_read_idx_map (this=0x7f8f240f0948, buf=0x7f8f24102270 "\377", index=0, key=0x7f8f24023a00 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /home/nayuta/repo/mariadb-server/sql/handler.cc:2965 #8 0x000055e3cebe4329 in join_read_const (tab=0x7f8f24022728) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:21162 #9 0x000055e3cebe3de3 in join_read_const_table (thd=0x7f8f2400cb30, tab=0x7f8f24022728, pos=0x7f8f24022cd8) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:21040 #10 0x000055e3cebb9191 in make_join_statistics (join=0x7f8f24021888, tables_list=..., keyuse_array=0x7f8f24021b78) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:5336 #11 0x000055e3cebae418 in JOIN::optimize_inner (this=0x7f8f24021888) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:2316 #12 0x000055e3cebabd1f in JOIN::optimize (this=0x7f8f24021888) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:1659 #13 0x000055e3cebb72a4 in mysql_select (thd=0x7f8f2400cb30, tables=0x7f8f2401f948, wild_num=1, fields=..., conds=0x7f8f24020800, og_num=1, order=0x7f8f24021678, group=0x0, having=0x0, proc_param=0x0, select_options=2147486464, result=0x7f8f24021860, unit=0x7f8f24010a60, select_lex=0x7f8f2401f368) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:4740 #14 0x000055e3ceba6b76 in handle_select (thd=0x7f8f2400cb30, lex=0x7f8f240109a0, result=0x7f8f24021860, setup_tables_done_option=0) at /home/nayuta/repo/mariadb-server/sql/sql_select.cc:436 #15 0x000055e3ceb6b84c in execute_sqlcom_select (thd=0x7f8f2400cb30, all_tables=0x7f8f2401f948) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:6449 #16 0x000055e3ceb62010 in mysql_execute_command (thd=0x7f8f2400cb30) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:3963 #17 0x000055e3ceb6f86c in mysql_parse (thd=0x7f8f2400cb30, rawbuf=0x7f8f2401f278 "SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC", length=70, parser_state=0x7f8f1805e480, is_com_multi=false, is_next_command=false) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:7995 #18 0x000055e3ceb5bb77 in dispatch_command (command=COM_QUERY, thd=0x7f8f2400cb30, packet=0x7f8f24016a91 "SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC", packet_length=70, is_com_multi=false, is_next_command=false) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:1857 #19 0x000055e3ceb5a3e3 in do_command (thd=0x7f8f2400cb30) at /home/nayuta/repo/mariadb-server/sql/sql_parse.cc:1373 #20 0x000055e3cecec82b in do_handle_one_connection (connect=0x55e3d2149b40) at /home/nayuta/repo/mariadb-server/sql/sql_connect.cc:1420 #21 0x000055e3cecec4c7 in handle_one_connection (arg=0x55e3d2149b40) at /home/nayuta/repo/mariadb-server/sql/sql_connect.cc:1316 #22 0x00007f8f31afc450 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #23 0x00007f8f31695d53 in clone () from /lib/x86_64-linux-gnu/libc.so.6

            ER_CONNECT_TO_FOREIGN_DATA_SOURCE (1429) is shown by my_message(). The error is then converted to ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM by spider_db_errorno() and printed by sql_print_error()

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - ER_CONNECT_TO_FOREIGN_DATA_SOURCE (1429) is shown by my_message() . The error is then converted to ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM by spider_db_errorno() and printed by sql_print_error()

            MTR test case:

            --disable_query_log
            --disable_result_log
            --source ../../t/test_init.inc
            --enable_result_log
            --enable_query_log
             
            --connection master_1
            CREATE DATABASE auto_test_local;
            USE auto_test_local;
             
            eval CREATE TABLE tbl_a (
                a INT KEY,
                b INT,
                KEY(b)
            ) $MASTER_1_ENGINE $MASTER_1_CHARSET
            PARTITION BY LIST COLUMNS (a) (
                PARTITION p DEFAULT ENGINE=SPIDER
            );
            --error ER_DUP_FIELDNAME
            ALTER TABLE tbl_a ADD b BINARY FIRST;
            --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
            SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC;
             
            DROP DATABASE auto_test_local;
             
            --disable_query_log
            --disable_result_log
            --source ../../t/test_deinit.inc
            --enable_result_log
            --enable_query_log
            

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - MTR test case: --disable_query_log --disable_result_log --source ../../t/test_init.inc --enable_result_log --enable_query_log   --connection master_1 CREATE DATABASE auto_test_local; USE auto_test_local;   eval CREATE TABLE tbl_a ( a INT KEY , b INT , KEY (b) ) $MASTER_1_ENGINE $MASTER_1_CHARSET PARTITION BY LIST COLUMNS (a) ( PARTITION p DEFAULT ENGINE=SPIDER ); --error ER_DUP_FIELDNAME ALTER TABLE tbl_a ADD b BINARY FIRST ; --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE SELECT * FROM tbl_a WHERE b = '' AND b = '' AND a = '' ORDER BY b DESC ;   DROP DATABASE auto_test_local;   --disable_query_log --disable_result_log --source ../../t/test_deinit.inc --enable_result_log --enable_query_log

            Roel I wrote out my analysis. What do you think is the expected behavior of the server? The server should not print the error to the error log at all? Or, it should print the same error ER_CONNECT_TO_FOREIGN_DATA_SOURCE, which is also show by my_message().

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - Roel I wrote out my analysis. What do you think is the expected behavior of the server? The server should not print the error to the error log at all? Or, it should print the same error ER_CONNECT_TO_FOREIGN_DATA_SOURCE , which is also show by my_message() .

            I confirm that the bug reproduces on 10.2 HEAD (1ce35c3) and 10.3 HEAD (00affc3) contrary to the issue description.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - I confirm that the bug reproduces on 10.2 HEAD (1ce35c3) and 10.3 HEAD (00affc3) contrary to the issue description.
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            Roel Roel Van de Paar added a comment - - edited

            nayuta-yanagisawa Interestingly, when I run this testcase against 10.2 and 10.3 I get:

            10.3.32 b112c9dfaacbcb7c3548414c6f402114663223dc (Debug)

            10.3.32-dbg>INSTALL PLUGIN spider SONAME 'ha_spider.so';
            Query OK, 0 rows affected (0.029 sec)
             
            10.3.32-dbg>CREATE TABLE t (c INT KEY,c2 INT,KEY(c2)) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
            ERROR 1146 (42S02): Table 'mysql.spider_tables' doesn't exist
            

            And thus the remainder of the testcase fails. What is missing here? Perhaps some init SQL required or is this a bug? 10.4+ Does not produce such issue.

            Roel Roel Van de Paar added a comment - - edited nayuta-yanagisawa Interestingly, when I run this testcase against 10.2 and 10.3 I get: 10.3.32 b112c9dfaacbcb7c3548414c6f402114663223dc (Debug) 10.3.32-dbg>INSTALL PLUGIN spider SONAME 'ha_spider.so'; Query OK, 0 rows affected (0.029 sec)   10.3.32-dbg>CREATE TABLE t (c INT KEY,c2 INT,KEY(c2)) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); ERROR 1146 (42S02): Table 'mysql.spider_tables' doesn't exist And thus the remainder of the testcase fails. What is missing here? Perhaps some init SQL required or is this a bug? 10.4+ Does not produce such issue.

            Roel In 10.2 and 10.3, you need to install the Spider via install_spider.sql. Please see https://mariadb.com/kb/en/spider-installation/.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - Roel In 10.2 and 10.3, you need to install the Spider via install_spider.sql . Please see https://mariadb.com/kb/en/spider-installation/ .
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 124829 ] MariaDB v4 [ 143706 ]
            Roel Roel Van de Paar made changes -
            Comment [ I think [~marko] would be more qualified to answer the question in the second last comment. [~marko] - thank you. ]
            Roel Roel Van de Paar added a comment - - edited

            nayuta-yanagisawa No direct idea on best way forward for this.

            Roel Roel Van de Paar added a comment - - edited nayuta-yanagisawa No direct idea on best way forward for this.

            I thought about the issue again and I now think that we should not print the error to the error log from the viewpoint of consistency.

            Spider raises ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM in some places but, as far as I know, they are not printed in the error log. Further, the error is not what should be necessarily notified to an administrator. That is because the error is mostly due to a wrong CREATE TABLE statement or the down of a data node. The first case is the user's fault, not the administrator's. The second case should be informed to the administrator by external health check or something.

            I also think that Spider should check whether CREATE TABLE is valid. This will be done once COMMENT style remote node specification is deprecated (then, one should use engine-defined attributes style).

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - - edited I thought about the issue again and I now think that we should not print the error to the error log from the viewpoint of consistency. Spider raises ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM in some places but, as far as I know, they are not printed in the error log. Further, the error is not what should be necessarily notified to an administrator. That is because the error is mostly due to a wrong CREATE TABLE statement or the down of a data node. The first case is the user's fault, not the administrator's. The second case should be informed to the administrator by external health check or something. I also think that Spider should check whether CREATE TABLE is valid. This will be done once COMMENT style remote node specification is deprecated (then, one should use engine-defined attributes style).

            Thinking some more about this too, here are some random questions which may help further the discussion:
            1) In many bug situations it seems we had the situation where the remote server is not available causing some crash. Once the crash is resolved, the message (on connect attempt, for example due to a SELECT) usually becomes

            ERROR 1429 (HY000): Unable to connect to foreign data source: localhost
            

            Would that not be the correct message to show here also?
            2) If so, would it be hard to change the code towards error 1429?
            3) A wrong table definition should be notified to the user imho (CLI/client level), though indeed not to the error log.
            4) The _NUM in the ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM name seems confusing to me. Can it be increased and decreased?

            Roel Roel Van de Paar added a comment - Thinking some more about this too, here are some random questions which may help further the discussion: 1) In many bug situations it seems we had the situation where the remote server is not available causing some crash. Once the crash is resolved, the message (on connect attempt, for example due to a SELECT) usually becomes ERROR 1429 (HY000): Unable to connect to foreign data source: localhost Would that not be the correct message to show here also? 2) If so, would it be hard to change the code towards error 1429? 3) A wrong table definition should be notified to the user imho (CLI/client level), though indeed not to the error log. 4) The _NUM in the ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM name seems confusing to me. Can it be increased and decreased?

            1), 2) I think the error message ERROR 1429 ... is appropriate here. In fact, the very message is shown on CLI (at least on 10.7 HEAD).
            3) I totally agree.
            4) NUM in ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM just mean the number/code of the error ER_SPIDER_REMOTE_SERVER_GONE_AWAY.

            #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM 12701
            #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_STR "Remote MySQL server has gone away"
            

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - 1), 2) I think the error message ERROR 1429 ... is appropriate here. In fact, the very message is shown on CLI (at least on 10.7 HEAD). 3) I totally agree. 4) NUM in ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM just mean the number/code of the error ER_SPIDER_REMOTE_SERVER_GONE_AWAY . #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM 12701 #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_STR "Remote MySQL server has gone away"
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Fix Version/s 10.7 [ 24805 ]

            Got it. All clear & agreed. Thanks

            Roel Roel Van de Paar added a comment - Got it. All clear & agreed. Thanks
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.2 [ 14601 ]
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Labels regression affects-tests regression
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.7 [ 24805 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.3 [ 22126 ]
            ycp Yuchen Pei made changes -
            ycp Yuchen Pei made changes -
            Assignee Nayuta Yanagisawa [ JIRAUSER47117 ] Yuchen Pei [ JIRAUSER52627 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.4 [ 22408 ]

            People

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