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

Galera server should stop crashing on setting binlog_format STATEMENT

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.28a-galera
    • Fix Version/s: 5.5.34-galera
    • Component/s: None
    • Labels:

      Description

      It has been discussed before, but I don't see any progress in this regard, so I'll file it as a bug now.

      A galera node used to refuse to start if binlog_format was different from ROW, instead producing a very clear error message. This was fine, because it really cannot work with STATEMENT.

      Now it starts anyway, which is error-prone. Besides, it was and still is possible to set binlog_format to STATEMENT at runtime, and it makes server crash on further SQL.

      I know that there is wsrep_forced_binlog_format nowadays, but it's still not a good enough reason to allow a stable server crash after executing a valid query. If STATEMENT mode is not supported, an attempt to set it at runtime should cause an error similar to the one that happens on server startup, and binlog_format should not change.

      Test case:

      SET binlog_format=STATEMENT;
      CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;

      MTR command line:

      perl ./mtr main.t1 --mysqld=--innodb_autoinc_lock_mode=2 --mysqld=--innodb_locks_unsafe_for_binlog=1 --mysqld=--wsrep-provider=/home/elenst/galera/libgalera_smm.so  --mysqld=--wsrep-cluster-address=gcomm://

      Same can be achieved without MTR, in this case my server command line is

      $HOME/maria-5.5-galera/sql/mysqld --no-defaults --basedir=$HOME/maria-5.5-galera --lc-messages-dir=$HOME/maria-5.5-galera/sql/share/ --core --datadir=$HOME/maria-5.5-galera/data1 --tmpdir=$HOME/maria-5.5-galera/data1/tmp --port=8306 --socket=$HOME/maria-5.5-galera/data1/tmp/node1.sock --wsrep-provider=$HOME/galera/libgalera_smm.so --wsrep-cluster-address=gcomm:// --binlog-format=statement --wsrep-sst-method=rsync --log-error=$HOME/maria-5.5-galera/data1/log.err --innodb_autoinc_lock_mode=2 --innodb_locks_unsafe_for_binlog=1 --general-log=1

      #2  0x00000000007e54c0 in handle_fatal_signal (sig=11) at maria-5.5-galera/sql/signal_handler.cc:262
      #3  <signal handler called>
      #4  0x00000000008b2569 in MYSQL_BIN_LOG::write (this=0x155a7e0, event_info=0x7ffab8d562b0, with_annotate=0x0) at maria-5.5-galera/sql/log.cc:5294
      #5  0x00000000005e8878 in THD::binlog_query (this=0x3854e60, qtype=THD::ROW_QUERY_TYPE, query_arg=0x38f7828 "CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0", query_len=91, is_trans=true, direct=false, suppress_use=false, errcode=0) at maria-5.5-galera/sql/sql_class.cc:5849
      #6  0x0000000000602c51 in select_insert::send_eof (this=0x3926b28) at maria-5.5-galera/sql/sql_insert.cc:3710
      #7  0x000000000060460c in select_create::send_eof (this=0x3926b28) at maria-5.5-galera/sql/sql_insert.cc:4238
      #8  0x0000000000668d14 in return_zero_rows (join=0x3926c00, result=0x3926b28, tables=..., fields=..., send_row=false, select_options=2953054976, info=0xd6ff67 "Impossible WHERE", having=0x0, all_fields=...) at maria-5.5-galera/sql/sql_select.cc:11055
      #9  0x0000000000652990 in JOIN::exec (this=0x3926c00) at maria-5.5-galera/sql/sql_select.cc:2289
      #10 0x00000000006554e7 in mysql_select (thd=0x3854e60, rref_pointer_array=0x3857dd0, tables=0x38f80d0, wild_num=1, fields=..., conds=0x38f87d8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2953054976, result=0x3926b28, unit=0x38574a0, select_lex=0x3857b78) at maria-5.5-galera/sql/sql_select.cc:3056
      #11 0x000000000064c06e in handle_select (thd=0x3854e60, lex=0x38573f0, result=0x3926b28, setup_tables_done_option=0) at maria-5.5-galera/sql/sql_select.cc:316
      #12 0x000000000061a4fb in mysql_execute_command (thd=0x3854e60) at maria-5.5-galera/sql/sql_parse.cc:2876
      #13 0x0000000000625224 in mysql_parse (thd=0x3854e60, rawbuf=0x38f7828 "CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0", length=91, parser_state=0x7ffab8d57550) at maria-5.5-galera/sql/sql_parse.cc:6305
      #14 0x00000000006242ea in wsrep_mysql_parse (thd=0x3854e60, rawbuf=0x38f7828 "CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0", length=91, parser_state=0x7ffab8d57550) at maria-5.5-galera/sql/sql_parse.cc:6070
      #15 0x00000000006167b9 in dispatch_command (command=COM_QUERY, thd=0x3854e60, packet=0x38fcff1 "CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0", packet_length=91) at maria-5.5-galera/sql/sql_parse.cc:1245
      #16 0x0000000000615598 in do_command (thd=0x3854e60) at maria-5.5-galera/sql/sql_parse.cc:891
      #17 0x000000000071e143 in do_handle_one_connection (thd_arg=0x3854e60) at maria-5.5-galera/sql/sql_connect.cc:1291
      #18 0x000000000071db1b in handle_one_connection (arg=0x3854e60) at maria-5.5-galera/sql/sql_connect.cc:1199
      #19 0x00007ffab8034efc in start_thread (arg=0x7ffab8d58700) at pthread_create.c:304
      #20 0x00007ffab77e3f4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: daniel@gandalf-20130301022556-h2fqksol83zg35b2
      revno: 3386
      branch-nick: maria-5.5-galera

      Also reproducible on codership-mysql tag wsrep_23.7.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jplindst Jan Lindström
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: