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

FLUSH MASTER fails with ER_NO_UNIQUE_LOGFILE and causes subsequent assertion failure `Count >= rest_length' in _my_b_write

    XMLWordPrintable

    Details

      Description

      FLUSH MASTER syntax is documented as deprecated, but it still exists and causes the problems as below.

      --source include/have_log_bin.inc
       
      --error 0,ER_NO_UNIQUE_LOGFILE
      FLUSH MASTER;
      CREATE DATABASE db;
       
      # Cleanup
      DROP DATABASE db;
      

      The first statement fails with ER_NO_UNIQUE_LOGFILE:

      10.1 ecd3a7e00de debug

      query 'FLUSH MASTER' failed: 1098: Can't generate a unique log-filename master-bin.(1-999)
      

      The second statement causes the assertion failure:

      10.1 ecd3a7e00de debug

      2018-12-11 23:59:26 140476796680960 [ERROR] Log filename extension number exhausted: 11936128518282651044. Please fix this by archiving old logs and updating the index files.
      2018-12-11 23:59:26 140476796680960 [ERROR] Can't generate a unique log-filename master-bin.(1-999)
       
      2018-12-11 23:59:26 140476796680960 [ERROR] MYSQL_BIN_LOG::open failed to generate new file name.
      mysqld: /data/src/10.1/mysys/mf_iocache.c:511: _my_b_write: Assertion `Count >= rest_length' failed.
      181211 23:59:26 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc34baebee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005555ec4c45bd in _my_b_write (info=0x5555ecf6a118 <mysql_bin_log+920>, Buffer=0x7fc34d9090f0 ">3\020\\\242\001", Count=19) at /data/src/10.1/mysys/mf_iocache.c:511
      #9  0x00005555ec4c31f2 in my_b_write (info=0x5555ecf6a118 <mysql_bin_log+920>, Buffer=0x7fc34d9090f0 ">3\020\\\242\001", Count=19) at /data/src/10.1/include/my_sys.h:538
      #10 0x00005555ec4c6483 in my_b_safe_write (info=0x5555ecf6a118 <mysql_bin_log+920>, Buffer=0x7fc34d9090f0 ">3\020\\\242\001", Count=19) at /data/src/10.1/mysys/mf_iocache.c:1745
      #11 0x00005555ebf79e97 in Log_event_writer::write_internal (this=0x7fc34d9091e0, pos=0x7fc34d9090f0 ">3\020\\\242\001", len=19) at /data/src/10.1/sql/log_event.cc:1176
      #12 0x00005555ebf7a0d1 in Log_event_writer::encrypt_and_write (this=0x7fc34d9091e0, pos=0x7fc34d9090f0 ">3\020\\\242\001", len=19) at /data/src/10.1/sql/log_event.cc:1219
      #13 0x00005555ebf7a312 in Log_event_writer::write_header (this=0x7fc34d9091e0, pos=0x7fc34d9090f0 ">3\020\\\242\001", len=19) at /data/src/10.1/sql/log_event.cc:1262
      #14 0x00005555ebf7a7b1 in Log_event::write_header (this=0x7fc34d9092c0, event_data_length=19) at /data/src/10.1/sql/log_event.cc:1355
      #15 0x00005555ebf85698 in Gtid_log_event::write (this=0x7fc34d9092c0) at /data/src/10.1/sql/log_event.cc:6766
      #16 0x00005555ebdfb765 in Log_event_writer::write (this=0x7fc34d9091e0, ev=0x7fc34d9092c0) at /data/src/10.1/sql/log_event.h:4941
      #17 0x00005555ebf6619b in MYSQL_BIN_LOG::write_event (this=0x5555ecf69d80 <mysql_bin_log>, ev=0x7fc34d9092c0, file=0x5555ecf6a118 <mysql_bin_log+920>) at /data/src/10.1/sql/log.cc:5251
      #18 0x00005555ebbad9b8 in MYSQL_BIN_LOG::write_event (this=0x5555ecf69d80 <mysql_bin_log>, ev=0x7fc34d9092c0) at /data/src/10.1/sql/log.h:750
      #19 0x00005555ebf67f31 in MYSQL_BIN_LOG::write_gtid_event (this=0x5555ecf69d80 <mysql_bin_log>, thd=0x7fc3448da070, standalone=true, is_transactional=false, commit_id=0) at /data/src/10.1/sql/log.cc:5965
      #20 0x00005555ebf68a4c in MYSQL_BIN_LOG::write (this=0x5555ecf69d80 <mysql_bin_log>, event_info=0x7fc34d9096b0, with_annotate=0x0) at /data/src/10.1/sql/log.cc:6271
      #21 0x00005555ebc16006 in mysql_create_db_internal (thd=0x7fc3448da070, db=0x7fc343043128 "db", options=..., create_info=0x7fc34d909a30, silent=false) at /data/src/10.1/sql/sql_db.cc:704
      #22 0x00005555ebc163ca in mysql_create_db (thd=0x7fc3448da070, db=0x7fc343043128 "db", options=..., create_info=0x7fc3448deb38) at /data/src/10.1/sql/sql_db.cc:783
      #23 0x00005555ebc4a43c in mysql_execute_command (thd=0x7fc3448da070) at /data/src/10.1/sql/sql_parse.cc:4447
      #24 0x00005555ebc535eb in mysql_parse (thd=0x7fc3448da070, rawbuf=0x7fc343043088 "CREATE DATABASE db", length=18, parser_state=0x7fc34d90a5e0) at /data/src/10.1/sql/sql_parse.cc:7467
      #25 0x00005555ebc41e3c in dispatch_command (command=COM_QUERY, thd=0x7fc3448da070, packet=0x7fc346554071 "CREATE DATABASE db", packet_length=18) at /data/src/10.1/sql/sql_parse.cc:1495
      #26 0x00005555ebc40bc1 in do_command (thd=0x7fc3448da070) at /data/src/10.1/sql/sql_parse.cc:1124
      #27 0x00005555ebd7b720 in do_handle_one_connection (thd_arg=0x7fc3448da070) at /data/src/10.1/sql/sql_connect.cc:1330
      #28 0x00005555ebd7b484 in handle_one_connection (arg=0x7fc3448da070) at /data/src/10.1/sql/sql_connect.cc:1242
      #29 0x00005555ec1397c6 in pfs_spawn_thread (arg=0x7fc34b03a170) at /data/src/10.1/storage/perfschema/pfs.cc:1861
      #30 0x00007fc34d5d4494 in start_thread (arg=0x7fc34d90bb00) at pthread_create.c:333
      #31 0x00007fc34bba893f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.0.
      Not reproducible on a non-debug build (not even the SQL error).

      Note: If the syntax has long been deprecated and no longer supported, maybe it should be removed in 10.4 until it's too late. I leave it to whoever works on it to decide whether to fix the failure in previous versions or not.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sujatha.sivakumar Sujatha Sivakumar
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: