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

galera.wsrep_strict_ddl hangs in 10.5 after merge

Details

    Description

      after

      commit e9dbbf11204
      Author: Igor Babaev <igor@mariadb.com>
      Date:   Sat Jun 6 11:38:38 2020 -0700
       
          MDEV-22748 MariaDB crash on WITH RECURSIVE large query
      

      was merged into 10.5, galera.wsrep_strict_ddl started to fail, it times out because the test hangs on the line

      CREATE VIEW x1 AS SELECT * FROM before_t1;
      

      The first server gets stuck in this loop:

      bool st_select_lex::cleanup()
      {
        ...
        for (TABLE_LIST *tbl= get_table_list(); tbl; tbl= tbl->next_local)
        {
      

      and tbl == tbl->next_local, so it loops there forever.

      Nothing fails in 10.4, so presumably the fix was incorrectly merged into 10.5

      Attachments

        Issue Links

          Activity

            The parameter wsrep_strict_ddl was introduced in MDEV-20051 (10.5.1).

            marko Marko Mäkelä added a comment - The parameter wsrep_strict_ddl was introduced in MDEV-20051 (10.5.1).

            Essential part of the test case:

            --source include/galera_cluster.inc
             
            create table t1(a int) engine=MyISAM;
             
            set @@global.wsrep_strict_ddl=ON;
             
            --error ER_GALERA_REPLICATION_NOT_SUPPORTED
            CREATE VIEW x1 AS SELECT * FROM t1;
            

            Also reproducible with Aria.

            The test case needs to be put into suite/galera/t/ folder and run as

            WSREP_PROVIDER=<path to Galera-4 library> perl ./mtr galera.<testcase name>
            

            Galera library can be found here: http://yum.mariadb.org/galera4/repo4/

            elenst Elena Stepanova added a comment - Essential part of the test case: --source include/galera_cluster.inc   create table t1(a int ) engine=MyISAM;   set @@ global .wsrep_strict_ddl= ON ;   --error ER_GALERA_REPLICATION_NOT_SUPPORTED CREATE VIEW x1 AS SELECT * FROM t1; Also reproducible with Aria. The test case needs to be put into suite/galera/t/ folder and run as WSREP_PROVIDER=<path to Galera-4 library> perl ./mtr galera.<testcase name> Galera library can be found here: http://yum.mariadb.org/galera4/repo4/

            I suspect that IF this is an operator execution problem (but not Galera problem), then the fact is that the bool st_select_lex_unit::cleanup() function calls "free_tmp_table(thd, table)":

                if (union_result)
                {
                  delete union_result;
                  union_result=0; // Safety
                  if (table)
                    free_tmp_table(thd, table);
                  table= 0; // Safety
                }
            

            and this destroys tmp->next_local which is used in the loop.

            sysprg Julius Goryavsky added a comment - I suspect that IF this is an operator execution problem (but not Galera problem), then the fact is that the bool st_select_lex_unit::cleanup() function calls "free_tmp_table(thd, table)": if (union_result) { delete union_result; union_result=0; // Safety if (table) free_tmp_table(thd, table); table= 0; // Safety } and this destroys tmp->next_local which is used in the loop.
            seppo Seppo Jaakola added a comment - - edited

            stack trace of hanging CREATE VIEW execution:

            (gdb) bt
            #0 0x000055e82deb112f in TABLE_LIST::is_recursive_with_table (this=0x7f0cc4012b50)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_cte.cc:1186
            #1 0x000055e82dd61138 in st_select_lex::cleanup (this=0x7f0cc4013228)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_union.cc:2717
            #2 0x000055e82dd609c2 in st_select_lex_unit::cleanup (this=0x7f0cc4004d90)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_union.cc:2559
            #3 0x000055e82dd6f51f in mysql_create_view (thd=0x7f0cc4000d78, views=0x7f0cc4012b50, mode=VIEW_CREATE_NEW)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_view.cc:730
            #4 0x000055e82dc49659 in mysql_execute_command (thd=0x7f0cc4000d78)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:5758
            #5 0x000055e82dc50473 in mysql_parse (thd=0x7f0cc4000d78,
            rawbuf=0x7f0cc4012a30 "CREATE VIEW x1 AS SELECT * FROM before_t1", length=41, parser_state=0x7f0cf7fb3510,
            is_com_multi=false, is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:7992
            #6 0x000055e82dc4fb82 in wsrep_mysql_parse (thd=0x7f0cc4000d78,
            rawbuf=0x7f0cc4012a30 "CREATE VIEW x1 AS SELECT * FROM before_t1", length=41, parser_state=0x7f0cf7fb3510,
            is_com_multi=false, is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:7795
            #7 0x000055e82dc3c704 in dispatch_command (command=COM_QUERY, thd=0x7f0cc4000d78,
            packet=0x7f0cc4008f59 "CREATE VIEW x1 AS SELECT * FROM before_t1", packet_length=41, is_com_multi=false,
            is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:1860
            #8 0x000055e82dc3af37 in do_command (thd=0x7f0cc4000d78) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:1355
            #9 0x000055e82dddf513 in do_handle_one_connection (connect=0x55e831d5b3f8, put_in_cache=true)
            at /home/seppo/work/wsrep/mariadb-server/sql/sql_connect.cc:1411

            ... and there table_list has cycle:

            (gdb) p tbl
            $4 = (TABLE_LIST *) 0x7f1d1c00ce20
            (gdb) p tbl->next_local
            $5 = (TABLE_LIST *) 0x7f1d1c00ce20

            seppo Seppo Jaakola added a comment - - edited stack trace of hanging CREATE VIEW execution: (gdb) bt #0 0x000055e82deb112f in TABLE_LIST::is_recursive_with_table (this=0x7f0cc4012b50) at /home/seppo/work/wsrep/mariadb-server/sql/sql_cte.cc:1186 #1 0x000055e82dd61138 in st_select_lex::cleanup (this=0x7f0cc4013228) at /home/seppo/work/wsrep/mariadb-server/sql/sql_union.cc:2717 #2 0x000055e82dd609c2 in st_select_lex_unit::cleanup (this=0x7f0cc4004d90) at /home/seppo/work/wsrep/mariadb-server/sql/sql_union.cc:2559 #3 0x000055e82dd6f51f in mysql_create_view (thd=0x7f0cc4000d78, views=0x7f0cc4012b50, mode=VIEW_CREATE_NEW) at /home/seppo/work/wsrep/mariadb-server/sql/sql_view.cc:730 #4 0x000055e82dc49659 in mysql_execute_command (thd=0x7f0cc4000d78) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:5758 #5 0x000055e82dc50473 in mysql_parse (thd=0x7f0cc4000d78, rawbuf=0x7f0cc4012a30 "CREATE VIEW x1 AS SELECT * FROM before_t1", length=41, parser_state=0x7f0cf7fb3510, is_com_multi=false, is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:7992 #6 0x000055e82dc4fb82 in wsrep_mysql_parse (thd=0x7f0cc4000d78, rawbuf=0x7f0cc4012a30 "CREATE VIEW x1 AS SELECT * FROM before_t1", length=41, parser_state=0x7f0cf7fb3510, is_com_multi=false, is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:7795 #7 0x000055e82dc3c704 in dispatch_command (command=COM_QUERY, thd=0x7f0cc4000d78, packet=0x7f0cc4008f59 "CREATE VIEW x1 AS SELECT * FROM before_t1", packet_length=41, is_com_multi=false, is_next_command=false) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:1860 #8 0x000055e82dc3af37 in do_command (thd=0x7f0cc4000d78) at /home/seppo/work/wsrep/mariadb-server/sql/sql_parse.cc:1355 #9 0x000055e82dddf513 in do_handle_one_connection (connect=0x55e831d5b3f8, put_in_cache=true) at /home/seppo/work/wsrep/mariadb-server/sql/sql_connect.cc:1411 ... and there table_list has cycle: (gdb) p tbl $4 = (TABLE_LIST *) 0x7f1d1c00ce20 (gdb) p tbl->next_local $5 = (TABLE_LIST *) 0x7f1d1c00ce20

            People

              serg Sergei Golubchik
              serg Sergei Golubchik
              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.