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

Assertion `!(entry->using_trx_cache && !mngr->trx_cache.empty() && mngr->get_binlog_cache_log((1))->error)' failed in MYSQL_BIN_LOG::write_transaction_or_stmt on CREATE TABLE

    XMLWordPrintable

Details

    Description

      Somewhat similar to MDEV-25488, but max_binlog_stmt_cache_size is not modified and instead we have max_allowed_packet and max_tmp_session_space_usage play a role, and versions differ (looks to be a 11.6 regression).

      # mysqld options required for replay: --log-bin
      SET max_tmp_session_space_usage=64*1024;
      SET default_storage_engine=MyISAM;
      SET autocommit=0;
      CREATE TABLE t SELECT 2 AS a,CONCAT (REPEAT (1,@@max_allowed_packet/10),1) AS b;
      

      Leads to:

      CS 11.7.0 4016c905cbabea7f29ed282dc2125254c7c0d419 (Debug)

      mariadbd: /test/11.7_dbg/sql/log.cc:9221: int MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry*, uint64): Assertion `!(entry->using_trx_cache && !mngr->trx_cache.empty() && mngr->get_binlog_cache_log((1))->error)' failed.
      

      CS 11.7.0 4016c905cbabea7f29ed282dc2125254c7c0d419 (Debug)

      Core was generated by `/test/MD141024-mariadb-11.7.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 4028841)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000014982d24526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000014982d2288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000014982d22881b in __assert_fail_base (fmt=0x14982d3d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55af13dced80 "!(entry->using_trx_cache && !mngr->trx_cache.empty() && mngr->get_binlog_cache_log((1))->error)", file=file@entry=0x55af13f2b444 "/test/11.7_dbg/sql/log.cc", line=line@entry=9221, function=function@entry=0x55af13dced30 "int MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry*, uint64)") at ./assert/assert.c:94
      #6  0x000014982d23b507 in __assert_fail (assertion=0x55af13dced80 "!(entry->using_trx_cache && !mngr->trx_cache.empty() && mngr->get_binlog_cache_log((1))->error)", file=0x55af13f2b444 "/test/11.7_dbg/sql/log.cc", line=9221, function=0x55af13dced30 "int MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry*, uint64)") at ./assert/assert.c:103
      #7  0x000055af1347b7ef in MYSQL_BIN_LOG::write_transaction_or_stmt (this=this@entry=0x55af1489afa0 <mysql_bin_log>, entry=entry@entry=0x14982c0d2970, commit_id=commit_id@entry=0)at /test/11.7_dbg/sql/log.cc:9221
      #8  0x000055af13488081 in MYSQL_BIN_LOG::trx_group_commit_leader (this=this@entry=0x55af1489afa0 <mysql_bin_log>, leader=leader@entry=0x14982c0d2970) at /test/11.7_dbg/sql/log.cc:8953
      #9  0x000055af1348b918 in MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=this@entry=0x55af1489afa0 <mysql_bin_log>, entry=entry@entry=0x14982c0d2970) at /test/11.7_dbg/sql/log.cc:8745
      #10 0x000055af1348bf53 in MYSQL_BIN_LOG::write_transaction_to_binlog (this=this@entry=0x55af1489afa0 <mysql_bin_log>, thd=thd@entry=0x1497dc000d58, cache_mngr=cache_mngr@entry=0x1497dc01a0c8, end_ev=end_ev@entry=0x14982c0d2af0, all=all@entry=true, using_stmt_cache=using_stmt_cache@entry=false, using_trx_cache=true, is_ro_1pc=true) at /test/11.7_dbg/sql/log.cc:8337
      #11 0x000055af1348c11a in binlog_flush_cache (thd=thd@entry=0x1497dc000d58, cache_mngr=cache_mngr@entry=0x1497dc01a0c8, end_ev=end_ev@entry=0x14982c0d2af0, all=all@entry=true, using_stmt=using_stmt@entry=false, using_trx=using_trx@entry=true, is_ro_1pc=true) at /test/11.7_dbg/sql/log.cc:1755
      #12 0x000055af1348da13 in binlog_commit_flush_trx_cache (thd=thd@entry=0x1497dc000d58, all=all@entry=true, cache_mngr=cache_mngr@entry=0x1497dc01a0c8, ro_1pc=ro_1pc@entry=true)at /test/11.7_dbg/sql/log.cc:1854
      #13 0x000055af1348dcdd in binlog_commit (thd=thd@entry=0x1497dc000d58, all=all@entry=true, ro_1pc=true) at /test/11.7_dbg/sql/log.cc:2220
      #14 0x000055af13323eb7 in commit_one_phase_2 (thd=thd@entry=0x1497dc000d58, all=all@entry=true, trans=trans@entry=0x1497dc004898, is_real_trans=true)at /test/11.7_dbg/sql/handler.cc:2189
      #15 0x000055af133242cd in ha_commit_one_phase (thd=thd@entry=0x1497dc000d58, all=all@entry=true) at /test/11.7_dbg/sql/handler.cc:2150
      #16 0x000055af13325fa3 in ha_commit_trans (thd=thd@entry=0x1497dc000d58, all=all@entry=true) at /test/11.7_dbg/sql/handler.cc:1944
      #17 0x000055af1319a1b1 in trans_commit_implicit (thd=0x1497dc000d58)at /test/11.7_dbg/sql/transaction.cc:338
      #18 0x000055af12fbefc9 in select_create::send_eof (this=0x1497dc01ca40)at /test/11.7_dbg/sql/sql_insert.cc:5269
      #19 0x000055af130961f1 in JOIN::exec_inner (this=this@entry=0x1497dc01cb80)at /test/11.7_dbg/sql/sql_select.cc:4925
      #20 0x000055af13097056 in JOIN::exec (this=this@entry=0x1497dc01cb80)at /test/11.7_dbg/sql/sql_select.cc:4826
      #21 0x000055af13094e3b in mysql_select (thd=thd@entry=0x1497dc000d58, tables=0x0, fields=@0x1497dc01b748: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1497dc01b9e8, last = 0x1497dc01bfe8, elements = 2}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2201188305408, result=0x1497dc01ca40, unit=0x1497dc005258, select_lex=0x1497dc01b490) at /test/11.7_dbg/sql/sql_select.cc:5359
      #22 0x000055af13095664 in handle_select (thd=thd@entry=0x1497dc000d58, lex=lex@entry=0x1497dc005178, result=result@entry=0x1497dc01ca40, setup_tables_done_option=setup_tables_done_option@entry=0)at /test/11.7_dbg/sql/sql_select.cc:642
      #23 0x000055af130fd731 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x1497dc000d58)at /test/11.7_dbg/sql/sql_table.cc:13198
      #24 0x000055af13004b5b in mysql_execute_command (thd=thd@entry=0x1497dc000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.7_dbg/sql/sql_parse.cc:5858
      #25 0x000055af13005d36 in mysql_parse (thd=thd@entry=0x1497dc000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14982c0d6260)at /test/11.7_dbg/sql/sql_parse.cc:7885
      #26 0x000055af130081ee in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1497dc000d58, packet=packet@entry=0x1497dc00b3d9 "CREATE TABLE t SELECT 2 AS a,CONCAT (REPEAT (1,@@max_allowed_packet/10),1) AS b", packet_length=packet_length@entry=79, blocking=blocking@entry=true)at /test/11.7_dbg/sql/sql_class.h:257
      #27 0x000055af1300a552 in do_command (thd=0x1497dc000d58, blocking=blocking@entry=true) at /test/11.7_dbg/sql/sql_parse.cc:1405
      #28 0x000055af13183e5f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55af16813938, put_in_cache=put_in_cache@entry=true)at /test/11.7_dbg/sql/sql_connect.cc:1448
      #29 0x000055af13184173 in handle_one_connection (arg=arg@entry=0x55af16813938)at /test/11.7_dbg/sql/sql_connect.cc:1350
      #30 0x000055af135d9bcf in pfs_spawn_thread (arg=0x55af167e29f8)at /test/11.7_dbg/storage/perfschema/pfs.cc:2198
      #31 0x000014982d29ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #32 0x000014982d329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug confirmed present in:
      MariaDB: 11.6.2 (dbg), 11.7.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.27 (dbg), 10.5.27 (opt), 10.6.20 (dbg), 10.6.20 (opt), 10.11.10 (dbg), 10.11.10 (opt), 11.2.6 (dbg), 11.2.6 (opt), 11.4.4 (dbg), 11.4.4 (opt), 11.6.2 (opt), 11.7.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt)

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.