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

Assertion failed: (thread_group->connection_count > 0), function wait_begin

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.28a
    • 10.0.2, 5.5.30
    • None
    • None

    Description

      Lets imagine following call sequence:

      connection_abort
      threadpool_remove_connection
      unlink_thd
      thd_cleanup
      THD::cleanup
      close_temporary_tables
      MYSQL_BIN_LOG::write
      MYSQL_BIN_LOG::rotate
      MYSQL_BIN_LOG::new_file_without_locking
      MYSQL_BIN_LOG::new_file_impl
      MYSQL_BIN_LOG::close
      MYSQL_LOG::close
      inline_mysql_file_sync
      my_sync
      before_sync_wait = tp_wait_begin
      wait_begin

      If there was only one client connection at the moment, assertion
      (thread_group->connection_count > 0) will trigger.

      In fact this happens constantly on rpl_rotate_logs.test in Percona Server 5.5
      with threadpool. I cannot reproduce it in MariaDB 5.5 but after looking into
      source code I think similar case might be possible.

      Stack trace from PS:

      Assertion failed: (thread_group->connection_count > 0), function wait_begin, file /Users/sergei/percona/repo/55-tp/Percona-Server-5.5.28-rel29.1/sql/threadpool_unix.cc, line 1150.

      #0 0x00007fff9014fce2 in __pthread_kill ()
      #1 0x00007fff85cac7d2 in pthread_kill ()
      #2 0x00007fff85c9da7a in abort ()
      #3 0x00007fff85cd05de in __assert_rtn ()
      #4 0x00000001002d635c in wait_begin (thread_group=<value temporarily unavailable, due to optimizations>)
      at threadpool_unix.cc:1150
      #5 0x00000001002d63ac in tp_wait_begin (thd=0x101169600, type=6) at threadpool_unix.cc:1290
      #6 0x00000001002f8337 in my_sync (fd=76, my_flags=108822512) at my_sync.c:60
      #7 0x00000001000c0d7a in MYSQL_LOG::close (this=0x100a062c8, exiting=3) at mysql_file.h:1423
      #8 0x00000001000c121b in MYSQL_BIN_LOG::close (this=0x100a062c0, exiting=3) at log.cc:6089
      #9 0x00000001000c6d30 in MYSQL_BIN_LOG::new_file_impl (this=0x1067c8620, need_lock=false) at log.cc:4454
      #10 0x00000001000c6f82 in MYSQL_BIN_LOG::new_file_without_locking ()
      at /Users/sergei/percona/repo/55-tp/Percona-Server/sql/log.cc:4358
      #11 0x00000001000c6f82 in MYSQL_BIN_LOG::rotate (this=0x100a062c0, check_purge=0x1067c86de, force_rotate=false)
      at log.cc:5353
      #12 0x00000001000c89a1 in MYSQL_BIN_LOG::write (this=0x1067c8910, event_info=0x1067c8910) at log.cc:5234
      #13 0x0000000100165891 in close_temporary_tables (thd=0x1067c8c50) at sql_base.cc:1778
      #14 0x0000000100183b16 in THD::cleanup (this=0x101169600) at sql_class.cc:1500
      #15 0x00000001000f1aa2 in unlink_thd (thd=0x101169600) at mysqld.cc:2131
      #16 0x00000001002a781c in threadpool_remove_connection (thd=0x101169600) at threadpool_common.cc:175
      #17 0x00000001002d5a98 in connection_abort [inlined] ()
      at /Users/sergei/percona/repo/55-tp/Percona-Server/sql/threadpool_unix.cc:1255
      #18 0x00000001002d5a98 in handle_event [inlined] ()
      at /Users/sergei/percona/repo/55-tp/Percona-Server/sql/threadpool_unix.cc:1452
      #19 0x00000001002d5a98 in worker_main (param=0x1067c8ee0) at threadpool_unix.cc:1489
      #20 0x0000000100465e24 in pfs_spawn_thread (arg=0x1061a1360) at pfs.cc:1015
      #21 0x00007fff85caa8bf in _pthread_start ()
      #22 0x00007fff85cadb75 in thread_start ()

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            sergei Sergei Glushchenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.