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

Assertion `!srv_read_only_mode || m_ignore_read_only' failed in SysTablespace::create_file when using innodb-force-recovery

    XMLWordPrintable

Details

    Description

      $ cd /test/MD140720-mariadb-10.5.5-linux-x86_64-opt
      $ rm -Rf data*
      $ ./scripts/mariadb-install-db --no-defaults --force --auth-root-authentication-method=normal --innodb-force-recovery=254 --basedir=${PWD} --datadir=${PWD}/data
      

      Leads to:

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Optimized)

      Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-opt/bin/mysqld --no-defaults --lc-me'.
      Program terminated with signal SIGABRT, Aborted.
      #0  0x000014d9f75dd237 in kill () at ../sysdeps/unix/syscall-template.S:78
      [Current thread is 1 (Thread 0x14d9f91ce800 (LWP 2512383))]
      (gdb) bt
      #0  0x000014d9f75dd237 in kill () at ../sysdeps/unix/syscall-template.S:78
      #1  0x000055c9b257b037 in handle_fatal_signal (sig=6) at /test/10.5_opt/sql/signal_handler.cc:342
      #2  <signal handler called>
      #3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #4  0x000014d9f75de8b1 in __GI_abort () at abort.c:79
      #5  0x000055c9b290fb19 in os_file_handle_error_cond_exit (on_error_silent=false, should_abort=true, operation=0x55c9b2d0fcf7 "open", name=0x55c9b4a59078 "./ibdata1") at /test/10.5_opt/storage/innobase/os/os0file.cc:3464
      #6  os_file_handle_error (operation=0x55c9b2d0fcf7 "open", name=0x55c9b4a59078 "./ibdata1") at /test/10.5_opt/storage/innobase/os/os0file.cc:212
      #7  os_file_create_func (name=name@entry=0x55c9b4a59078 "./ibdata1", create_mode=create_mode@entry=52, purpose=purpose@entry=62, type=type@entry=100, read_only=read_only@entry=true, success=success@entry=0x7fffe0c8b427) at /test/10.5_opt/storage/innobase/os/os0file.cc:1424
      #8  0x000055c9b2ad212b in pfs_os_file_create_func (purpose=62, type=100, src_file=0x55c9b2ef1bb8 "/test/10.5_opt/storage/innobase/fsp/fsp0file.cc", src_line=72, src_line=72, src_file=0x55c9b2ef1bb8 "/test/10.5_opt/storage/innobase/fsp/fsp0file.cc", success=0x7fffe0c8b427, read_only=true, type=100, purpose=62, create_mode=52, name=0x55c9b4a59078 "./ibdata1", key=<optimized out>) at /test/10.5_opt/storage/innobase/include/os0file.ic:168
      #9  Datafile::open_or_create (this=this@entry=0x55c9b4a590a8, read_only_mode=true) at /test/10.5_opt/storage/innobase/fsp/fsp0file.cc:70
      #10 0x000055c9b2ad9826 in SysTablespace::create_file (file=@0x55c9b4a590a8: {_vptr.Datafile = 0x55c9b352ca90 <vtable for Datafile+16>, m_name = 0x55c9b4a591d8 "ibdata1", m_filepath = 0x55c9b4a59078 "./ibdata1", m_filename = 0x55c9b4a5907a "ibdata1", m_handle = {m_file = -1, m_psi = 0x0}, m_open_flags = OS_FILE_CREATE, m_size = 768, m_order = 0, m_type = SRV_NOT_RAW, m_space_id = 18446744073709551615, m_flags = 21, m_exists = false, m_is_valid = false, m_first_page = 0x0, m_last_os_error = 0, m_file_info = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __glibc_reserved = {0, 0, 0}}}, this=0x55c9b3ff1bc0 <srv_sys_space>) at /test/10.5_opt/storage/innobase/fsp/fsp0sysspace.cc:448
      #11 SysTablespace::open_or_create (this=0x55c9b3ff1bc0 <srv_sys_space>, is_temp=is_temp@entry=false, create_new_db=create_new_db@entry=true, sum_new_sizes=sum_new_sizes@entry=0x7fffe0c8b7d0, flush_lsn=flush_lsn@entry=0x7fffe0c8b7c8) at /test/10.5_opt/storage/innobase/fsp/fsp0sysspace.cc:867
      #12 0x000055c9b29b0e8b in srv_start (create_new_db=true) at /test/10.5_opt/storage/innobase/srv/srv0start.cc:1360
      #13 0x000055c9b28a2c02 in innodb_init (p=<optimized out>) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:4001
      #14 0x000055c9b257df3e in ha_initialize_handlerton (plugin=0x55c9b49985b0) at /test/10.5_opt/sql/handler.cc:645
      #15 0x000055c9b23991b3 in plugin_initialize (tmp_root=tmp_root@entry=0x7fffe0c90d10, plugin=plugin@entry=0x55c9b49985b0, argc=argc@entry=0x55c9b371fc80 <remaining_argc>, argv=argv@entry=0x55c9b4961e38, options_only=options_only@entry=false) at /test/10.5_opt/sql/sql_plugin.cc:1459
      #16 0x000055c9b239a453 in plugin_init (argc=argc@entry=0x55c9b371fc80 <remaining_argc>, argv=<optimized out>, flags=1) at /test/10.5_opt/sql/sql_plugin.cc:1751
      #17 0x000055c9b22bf7ed in init_server_components () at /test/10.5_opt/sql/mysqld.cc:4909
      #18 0x000055c9b22c558a in mysqld_main (argc=<optimized out>, argv=<optimized out>) at /test/10.5_opt/sql/mysqld.cc:5492
      #19 0x000014d9f75bfb97 in __libc_start_main (main=0x55c9b2288940 <main(int, char**)>, argc=13, argv=0x7fffe0c92ca8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffe0c92c98) at ../csu/libc-start.c:310
      #20 0x000055c9b22ba1fa in _start ()
      

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Debug)

      mysqld: /test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc:430: dberr_t SysTablespace::create_file(Datafile&): Assertion `!srv_read_only_mode || m_ignore_read_only' failed.
      

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Debug)

      mysqld: /test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc:430: dberr_t SysTablespace::create_file(Datafile&): Assertion `!srv_read_only_mode || m_ignore_read_only' failed.
      200723 15:22:06 [ERROR] mysqld got signal 6 ;
      

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Debug)

      Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --lc-me'.
      Program terminated with signal SIGABRT, Aborted.
      #0  0x000014744422b237 in kill () at ../sysdeps/unix/syscall-template.S:78
      [Current thread is 1 (Thread 0x147445e1c800 (LWP 2487656))]
      (gdb) bt
      #0  0x000014744422b237 in kill () at ../sysdeps/unix/syscall-template.S:78
      #1  0x000055846afc171f in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:342
      #2  <signal handler called>
      #3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #4  0x000014744422c8b1 in __GI_abort () at abort.c:79
      #5  0x000014744421c42a in __assert_fail_base (fmt=0x1474443a3a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55846bcce808 "!srv_read_only_mode || m_ignore_read_only", file=file@entry=0x55846bcce6d8 "/test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc", line=line@entry=430, function=function@entry=0x55846bcce5a0 <SysTablespace::create_file(Datafile&)::__PRETTY_FUNCTION__> "dberr_t SysTablespace::create_file(Datafile&)") at assert.c:92
      #6  0x000014744421c4a2 in __GI___assert_fail (assertion=assertion@entry=0x55846bcce808 "!srv_read_only_mode || m_ignore_read_only", file=file@entry=0x55846bcce6d8 "/test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc", line=line@entry=430, function=function@entry=0x55846bcce5a0 <SysTablespace::create_file(Datafile&)::__PRETTY_FUNCTION__> "dberr_t SysTablespace::create_file(Datafile&)") at assert.c:101
      #7  0x000055846b712f23 in SysTablespace::create_file (this=this@entry=0x55846ce2e960 <srv_sys_space>, file=@0x55846ea6e568: {_vptr.Datafile = 0x55846c35e850 <vtable for Datafile+16>, m_name = 0x55846ea6e698 "ibdata1", m_filepath = 0x55846ea6e538 "./ibdata1", m_filename = 0x55846ea6e53a "ibdata1", m_handle = {m_file = -1, m_psi = 0x0}, m_open_flags = OS_FILE_CREATE, m_size = 768, m_order = 0, m_type = SRV_NOT_RAW, m_space_id = 18446744073709551615, m_flags = 21, m_exists = false, m_is_valid = false, m_first_page = 0x0, m_last_os_error = 0, m_file_info = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __glibc_reserved = {0, 0, 0}}}) at /test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc:430
      #8  0x000055846b7135b5 in SysTablespace::open_or_create (this=0x55846ce2e960 <srv_sys_space>, is_temp=is_temp@entry=false, create_new_db=create_new_db@entry=true, sum_new_sizes=sum_new_sizes@entry=0x7ffdc8e32268, flush_lsn=flush_lsn@entry=0x7ffdc8e32260) at /test/10.5_dbg/storage/innobase/fsp/fsp0sysspace.cc:867
      #9  0x000055846b5748d6 in srv_start (create_new_db=<optimized out>) at /test/10.5_dbg/storage/innobase/srv/srv0start.cc:1360
      #10 0x000055846b38eb0e in innodb_init (p=<optimized out>) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:4001
      #11 0x000055846afc5ff5 in ha_initialize_handlerton (plugin=0x55846e9a2a40) at /test/10.5_dbg/sql/handler.cc:645
      #12 0x000055846ad31043 in plugin_initialize (tmp_root=tmp_root@entry=0x7ffdc8e37a50, plugin=plugin@entry=0x55846e9a2a40, argc=argc@entry=0x55846c555e80 <remaining_argc>, argv=argv@entry=0x55846e962298, options_only=<optimized out>) at /test/10.5_dbg/sql/sql_plugin.cc:1459
      #13 0x000055846ad32ada in plugin_init (argc=argc@entry=0x55846c555e80 <remaining_argc>, argv=<optimized out>, flags=1) at /test/10.5_dbg/sql/sql_plugin.cc:1751
      #14 0x000055846ac143c4 in init_server_components () at /test/10.5_dbg/sql/mysqld.cc:4909
      #15 0x000055846ac1ad6e in mysqld_main (argc=<optimized out>, argv=<optimized out>) at /test/10.5_dbg/sql/mysqld.cc:5492
      #16 0x000055846ac0d6b3 in main (argc=<optimized out>, argv=<optimized out>) at /test/10.5_dbg/sql/main.cc:25
      

      Same issue reproducible on 10.3 using slightly modified testcase (using mysql_install_db):

      $ rm -Rf data*; ./scripts/mysql_install_db --no-defaults --force --auth-root-authentication-method=normal --innodb-force-recovery=254 --basedir=${PWD} --datadir=${PWD}/data
      

      Bug confirmed present in:
      MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.3.24 (opt), 10.3.24 (dbg), 10.4.14 (opt), 10.4.14 (dbg), 10.5.5 (opt), 10.5.5 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.2.33 (opt), 10.2.33 (dbg)

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.