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

SPIDER plugin initialization fails upon startup

Details

    Description

      If server is started with --plugin-load-add=ha_spider, it throws an error on startup.

      --let restart_parameters= --plugin-load-add=ha_spider
      --source include/restart_mysqld.inc
       
      SELECT COUNT(*) FROM information_schema.SPIDER_ALLOC_MEM;
      

      10.7 dd9da61d

      [ERROR] SPIDER plugin initialization failed at 'drop procedure if exists mysql.spider_fix_one_table' by 'Unknown storage engine 'Aria''
      2022-10-27 22:19:57 0 [ERROR] Plugin 'SPIDER' init function returned error.
      2022-10-27 22:19:57 0 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.
      

      And if instead the plugin is installed into mysql.plugin, the failure upon server restart is different:

      INSTALL SONAME 'ha_spider';
      --source include/restart_mysqld.inc
      SELECT COUNT(*) FROM information_schema.SPIDER_ALLOC_MEM;
      

      [ERROR] SPIDER plugin initialization failed at 'drop procedure mysql.spider_fix_one_table' by 'The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement'
      2022-10-28  0:54:26 0 [ERROR] Plugin 'SPIDER' init function returned error.
      2022-10-28  0:54:26 0 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.
      

      It happens regardless of the build type (debug, release, all the same).
      On a debug build, additionally a query from a spider system table causes a mutex failure.

      10.7 dd9da61d

      safe_mutex: Trying to lock uninitialized mutex at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/spider/spd_i_s.cc, line 110
      221027 22:25:32 [ERROR] mysqld got signal 6 ;
       
      #5  0x00007f1d001aa537 in __GI_abort () at abort.c:79
      #6  0x000055faf75188f5 in safe_mutex_lock (mp=0x7f1cf871fea0 <spider_mem_calc_mutex>, my_flags=0, file=0x7f1cf85c9f40 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/spider/spd_i_s.cc", line=110) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/thr_mutex.c:245
      #7  0x00007f1cf8385cb3 in inline_mysql_mutex_lock (that=0x7f1cf871fea0 <spider_mem_calc_mutex>, src_file=0x7f1cf85c9f40 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/spider/spd_i_s.cc", src_line=110) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/include/mysql/psi/mysql_thread.h:750
      #8  0x00007f1cf83867f7 in spider_i_s_alloc_mem_fill_table (thd=0x62b00008c218, tables=0x6290000e6a18, cond=0x0) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/spider/spd_i_s.cc:110
      #9  0x000055faf5b488ab in get_schema_tables_result (join=0x6290000e7f00, executed_place=PROCESSED_BY_JOIN_EXEC) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_show.cc:8869
      #10 0x000055faf5a1d36b in JOIN::exec_inner (this=0x6290000e7f00) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_select.cc:4739
      #11 0x000055faf5a1b137 in JOIN::exec (this=0x6290000e7f00) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_select.cc:4560
      #12 0x000055faf5a1f558 in mysql_select (thd=0x62b00008c218, tables=0x6290000e6a18, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x6290000e7ed0, unit=0x62b000090628, select_lex=0x6290000e6318) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_select.cc:5040
      #13 0x000055faf59efbe5 in handle_select (thd=0x62b00008c218, lex=0x62b000090550, result=0x6290000e7ed0, setup_tables_done_option=0) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_select.cc:554
      #14 0x000055faf591a889 in execute_sqlcom_select (thd=0x62b00008c218, all_tables=0x6290000e6a18) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:6253
      #15 0x000055faf59094c1 in mysql_execute_command (thd=0x62b00008c218, is_called_from_prepared_stmt=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3944
      #16 0x000055faf592561d in mysql_parse (thd=0x62b00008c218, rawbuf=0x6290000e6238 "SELECT COUNT(*) FROM information_schema.SPIDER_ALLOC_MEM", length=56, parser_state=0x7f1cf64d7990) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:8014
      #17 0x000055faf58fbfb7 in dispatch_command (command=COM_QUERY, thd=0x62b00008c218, packet=0x6290000dc219 "SELECT COUNT(*) FROM information_schema.SPIDER_ALLOC_MEM", packet_length=56, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1894
      #18 0x000055faf58f8d8a in do_command (thd=0x62b00008c218, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1407
      #19 0x000055faf5d8b522 in do_handle_one_connection (connect=0x608000003238, put_in_cache=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1416
      #20 0x000055faf5d8aeb8 in handle_one_connection (arg=0x608000003238) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1318
      #21 0x000055faf69377a2 in pfs_spawn_thread (arg=0x61700000ac18) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:2201
      #22 0x00007f1d00697ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #23 0x00007f1d00284aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failures started happening after this commit in 10.7

      commit c160a115b8b6dcd54bb3daf1a751ee9c68b7ee47 (origin/bb-10.7-MDEV-27233)
      Author: Nayuta Yanagisawa
      Date:   Mon Apr 25 18:29:01 2022 +0900
       
          MDEV-27233 Server hangs when using --init-file which loads Spider and creates a Spider table
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            A weird side-effect (at least for now I assume it's a side-effect):

            --let restart_parameters= --plugin-load-add=ha_spider
            --source include/restart_mysqld.inc
             
            CREATE SEQUENCE s;
            CREATE OR REPLACE SEQUENCE s;
            CREATE OR REPLACE SEQUENCE s;
            RENAME TABLE s TO s1, s2 TO s3;
            

            10.7 dd9da61d

            [ERROR] SPIDER plugin initialization failed at 'drop procedure if exists mysql.spider_fix_one_table' by 'Unknown storage engine 'Aria''
            2022-10-28  0:59:20 0 [ERROR] Plugin 'SPIDER' init function returned error.
            2022-10-28  0:59:20 0 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.
             
            ...
             
            mariadbd: /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2415: bool ddl_log_execute_entry_no_lock(THD*, uint): Assertion `ddl_log_entry.entry_type == DDL_LOG_ENTRY_CODE || ddl_log_entry.entry_type == DDL_LOG_IGNORE_ENTRY_CODE' failed.
            221028  0:59:20 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f855f191662 in __GI___assert_fail (assertion=0x556f1d585780 "ddl_log_entry.entry_type == DDL_LOG_ENTRY_CODE || ddl_log_entry.entry_type == DDL_LOG_IGNORE_ENTRY_CODE", file=0x556f1d5837e0 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc", line=2415, function=0x556f1d585720 "bool ddl_log_execute_entry_no_lock(THD*, uint)") at assert.c:101
            #8  0x0000556f1b864acf in ddl_log_execute_entry_no_lock (thd=0x62b00008c218, first_entry=1) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2415
            #9  0x0000556f1b867ca7 in ddl_log_revert (thd=0x62b00008c218, state=0x7f85554aec40) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2944
            #10 0x0000556f1b5d60e3 in mysql_rename_tables (thd=0x62b00008c218, table_list=0x6290000e6388, silent=false, if_exists=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_rename.cc:203
            #11 0x0000556f1b5204c6 in mysql_execute_command (thd=0x62b00008c218, is_called_from_prepared_stmt=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4326
            #12 0x0000556f1b53a61d in mysql_parse (thd=0x62b00008c218, rawbuf=0x6290000e6238 "RENAME TABLE s TO s1, s2 TO s3", length=30, parser_state=0x7f85554af990) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:8014
            #13 0x0000556f1b510fb7 in dispatch_command (command=COM_QUERY, thd=0x62b00008c218, packet=0x6290000dc219 "RENAME TABLE s TO s1, s2 TO s3", packet_length=30, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1894
            #14 0x0000556f1b50dd8a in do_command (thd=0x62b00008c218, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1407
            #15 0x0000556f1b9a0522 in do_handle_one_connection (connect=0x608000003238, put_in_cache=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1416
            #16 0x0000556f1b99feb8 in handle_one_connection (arg=0x608000003238) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1318
            #17 0x0000556f1c54c7a2 in pfs_spawn_thread (arg=0x61700000ac18) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:2201
            #18 0x00007f855f66fea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #19 0x00007f855f25caef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            elenst Elena Stepanova added a comment - - edited A weird side-effect (at least for now I assume it's a side-effect): --let restart_parameters= --plugin-load-add=ha_spider --source include/restart_mysqld.inc   CREATE SEQUENCE s; CREATE OR REPLACE SEQUENCE s; CREATE OR REPLACE SEQUENCE s; RENAME TABLE s TO s1, s2 TO s3; 10.7 dd9da61d [ERROR] SPIDER plugin initialization failed at 'drop procedure if exists mysql.spider_fix_one_table' by 'Unknown storage engine 'Aria'' 2022-10-28 0:59:20 0 [ERROR] Plugin 'SPIDER' init function returned error. 2022-10-28 0:59:20 0 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.   ...   mariadbd: /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2415: bool ddl_log_execute_entry_no_lock(THD*, uint): Assertion `ddl_log_entry.entry_type == DDL_LOG_ENTRY_CODE || ddl_log_entry.entry_type == DDL_LOG_IGNORE_ENTRY_CODE' failed. 221028 0:59:20 [ERROR] mysqld got signal 6 ;   #7 0x00007f855f191662 in __GI___assert_fail (assertion=0x556f1d585780 "ddl_log_entry.entry_type == DDL_LOG_ENTRY_CODE || ddl_log_entry.entry_type == DDL_LOG_IGNORE_ENTRY_CODE", file=0x556f1d5837e0 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc", line=2415, function=0x556f1d585720 "bool ddl_log_execute_entry_no_lock(THD*, uint)") at assert.c:101 #8 0x0000556f1b864acf in ddl_log_execute_entry_no_lock (thd=0x62b00008c218, first_entry=1) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2415 #9 0x0000556f1b867ca7 in ddl_log_revert (thd=0x62b00008c218, state=0x7f85554aec40) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/ddl_log.cc:2944 #10 0x0000556f1b5d60e3 in mysql_rename_tables (thd=0x62b00008c218, table_list=0x6290000e6388, silent=false, if_exists=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_rename.cc:203 #11 0x0000556f1b5204c6 in mysql_execute_command (thd=0x62b00008c218, is_called_from_prepared_stmt=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4326 #12 0x0000556f1b53a61d in mysql_parse (thd=0x62b00008c218, rawbuf=0x6290000e6238 "RENAME TABLE s TO s1, s2 TO s3", length=30, parser_state=0x7f85554af990) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:8014 #13 0x0000556f1b510fb7 in dispatch_command (command=COM_QUERY, thd=0x62b00008c218, packet=0x6290000dc219 "RENAME TABLE s TO s1, s2 TO s3", packet_length=30, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1894 #14 0x0000556f1b50dd8a in do_command (thd=0x62b00008c218, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1407 #15 0x0000556f1b9a0522 in do_handle_one_connection (connect=0x608000003238, put_in_cache=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1416 #16 0x0000556f1b99feb8 in handle_one_connection (arg=0x608000003238) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1318 #17 0x0000556f1c54c7a2 in pfs_spawn_thread (arg=0x61700000ac18) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:2201 #18 0x00007f855f66fea7 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x00007f855f25caef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

            Fixed by reverting c160a11.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - Fixed by reverting c160a11 .
            ycp Yuchen Pei added a comment -

            We still need to fix MDEV-27233 and MDEV-22979. A testcase should be added for this issue to avoid future regression.

            ycp Yuchen Pei added a comment - We still need to fix MDEV-27233 and MDEV-22979 . A testcase should be added for this issue to avoid future regression.

            People

              ycp Yuchen Pei
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.