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

Block instant alter operation for the table with FULLTEXT index

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TEXT, KEY (FTS_DOC_ID), FULLTEXT fk (c)) ENGINE=InnoDB;
      INSERT INTO t1 (c) VALUES ('foo');
      ALTER TABLE t1 ADD d GEOMETRY DEFAULT ST_GEOMFROMTEXT('Point(1 1)');
      REPLACE INTO t1 (d) VALUES (NULL);
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 e1e142e7

      mysqld: /data/src/10.3/storage/innobase/fts/fts0fts.cc:3228: void fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, ulint*, fts_doc_t*): Assertion `!page_rec_is_comp(clust_rec) || rec_get_status(clust_rec) == REC_STATUS_ORDINARY' failed.
      190802 17:08:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f0cf5864f12 in __GI___assert_fail (assertion=0x560c450ce008 "!page_rec_is_comp(clust_rec) || rec_get_status(clust_rec) == REC_STATUS_ORDINARY", file=0x560c450cd500 "/data/src/10.3/storage/innobase/fts/fts0fts.cc", line=3228, function=0x560c450d05e0 <fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, unsigned long*, fts_doc_t*)::__PRETTY_FUNCTION__> "void fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, ulint*, fts_doc_t*)") at assert.c:101
      #8  0x0000560c44ae80f2 in fts_fetch_doc_from_rec (get_doc=0x7f0c9c03d6c8, clust_index=0x7f0c9c0a8258, pcur=0x7f0cf0062500, offsets=0x7f0c9c050478, doc=0x7f0cf00623b0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3228
      #9  0x0000560c44ae8df1 in fts_add_doc_by_id (ftt=0x7f0c9c0450d8, doc_id=2, fts_indexes=0x0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3540
      #10 0x0000560c44ae743e in fts_add (ftt=0x7f0c9c0450d8, row=0x7f0c9c010f80) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:2847
      #11 0x0000560c44ae7be5 in fts_commit_table (ftt=0x7f0c9c0450d8) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3019
      #12 0x0000560c44ae7cd9 in fts_commit (trx=0x7f0ceb3ff0f0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3068
      #13 0x0000560c449a58b2 in trx_commit_low (trx=0x7f0ceb3ff0f0, mtr=0x7f0cf0062c50) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1445
      #14 0x0000560c449a5a7d in trx_commit (trx=0x7f0ceb3ff0f0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1534
      #15 0x0000560c449a5e86 in trx_commit_for_mysql (trx=0x7f0ceb3ff0f0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1670
      #16 0x0000560c447811fd in innobase_commit_low (trx=0x7f0ceb3ff0f0) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4407
      #17 0x0000560c44781592 in innobase_commit_ordered_2 (trx=0x7f0ceb3ff0f0, thd=0x7f0c9c000b00) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4521
      #18 0x0000560c44781a80 in innobase_commit (hton=0x560c47b1f910, thd=0x7f0c9c000b00, commit_trx=false) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4637
      #19 0x0000560c445765ec in commit_one_phase_2 (thd=0x7f0c9c000b00, all=false, trans=0x7f0c9c004030, is_real_trans=true) at /data/src/10.3/sql/handler.cc:1641
      #20 0x0000560c445764e8 in ha_commit_one_phase (thd=0x7f0c9c000b00, all=false) at /data/src/10.3/sql/handler.cc:1621
      #21 0x0000560c44575c81 in ha_commit_trans (thd=0x7f0c9c000b00, all=false) at /data/src/10.3/sql/handler.cc:1483
      #22 0x0000560c443ef006 in trans_commit_stmt (thd=0x7f0c9c000b00) at /data/src/10.3/sql/transaction.cc:505
      #23 0x0000560c4427f90b in mysql_execute_command (thd=0x7f0c9c000b00) at /data/src/10.3/sql/sql_parse.cc:6098
      #24 0x0000560c44284602 in mysql_parse (thd=0x7f0c9c000b00, rawbuf=0x7f0c9c012818 "REPLACE INTO t1 (d) VALUES (NULL)", length=33, parser_state=0x7f0cf00645e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7829
      #25 0x0000560c44272200 in dispatch_command (command=COM_QUERY, thd=0x7f0c9c000b00, packet=0x7f0c9c160121 "REPLACE INTO t1 (d) VALUES (NULL)", packet_length=33, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #26 0x0000560c44270c23 in do_command (thd=0x7f0c9c000b00) at /data/src/10.3/sql/sql_parse.cc:1401
      #27 0x0000560c443daa4c in do_handle_one_connection (connect=0x560c47e553b0) at /data/src/10.3/sql/sql_connect.cc:1403
      #28 0x0000560c443da7ae in handle_one_connection (arg=0x560c47e553b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #29 0x0000560c44cb5ed8 in pfs_spawn_thread (arg=0x560c47d9daa0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #30 0x00007f0cf73d94a4 in start_thread (arg=0x7f0cf0065700) at pthread_create.c:456
      #31 0x00007f0cf5921d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Not reproducible on 10.2 and 10.4.
      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            I think that we should also require ADD FULLTEXT INDEX to rebuild the table if the table is already in instant ALTER format.

            Alternatively, we can rewrite the fulltext search code and test (with RQG) that it can deal with records that contain or lack instantly added columns. (For missing columns, the default values must be substituted from the metadata record.) This should be tested also in the case where FTS_DOC_ID or a fulltext-indexed column was added instantly.

            marko Marko Mäkelä added a comment - I think that we should also require ADD FULLTEXT INDEX to rebuild the table if the table is already in instant ALTER format. Alternatively, we can rewrite the fulltext search code and test (with RQG) that it can deal with records that contain or lack instantly added columns. (For missing columns, the default values must be substituted from the metadata record.) This should be tested also in the case where FTS_DOC_ID  or a fulltext-indexed column was added instantly.
            alice Alice Sherepa added a comment -

            I am getting something related on 10.10:

            mysqld: /10.10/storage/innobase/fts/fts0fts.cc:3113: void fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, rec_offs*, fts_doc_t*): Assertion `!page_rec_is_comp(clust_rec) || rec_get_status(clust_rec) == REC_STATUS_ORDINARY' failed.
            220705 14:20:13 [ERROR] mysqld got signal 6 ;
             
            Server version: 10.10.0-MariaDB-debug-log
             
            linux/raise.c:51(__GI_raise)[0x7f554b76f7bb]
            stdlib/abort.c:81(__GI_abort)[0x7f554b75a535]
            intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f554b75a40f]
            ??:0(__assert_fail)[0x7f554b768102]
            fts/fts0fts.cc:3116(fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, unsigned short*, fts_doc_t*))[0x557a3f0bb0de]
            fts/fts0fts.cc:3423(fts_add_doc_by_id(fts_trx_table_t*, unsigned long))[0x557a3f0bcd5e]
            fts/fts0fts.cc:2750(fts_add(fts_trx_table_t*, fts_trx_row_t*))[0x557a3f0b9452]
            fts/fts0fts.cc:2911(fts_commit_table(fts_trx_table_t*))[0x557a3f0ba718]
            fts/fts0fts.cc:2959(fts_commit(trx_t*))[0x557a3f0ba89e]
            trx/trx0trx.cc:1414(trx_t::commit_low(mtr_t*))[0x557a3ee3cda4]
            trx/trx0trx.cc:1456(trx_t::commit_persist())[0x557a3ee3ee48]
            trx/trx0trx.cc:1473(trx_t::commit())[0x557a3ee3f10f]
            trx/trx0trx.cc:1590(trx_commit_for_mysql(trx_t*))[0x557a3ee3f942]
            handler/ha_innodb.cc:4332(innobase_commit_low(trx_t*))[0x557a3e923d65]
            handler/ha_innodb.cc:4440(innobase_commit_ordered_2(trx_t*, THD*))[0x557a3e924452]
            handler/ha_innodb.cc:4488(innobase_commit_ordered(handlerton*, THD*, bool))[0x557a3e924839]
            sql/log.cc:9415(TC_LOG::run_commit_ordered(THD*, bool))[0x557a3e243f5d]
            sql/log.cc:8636(MYSQL_BIN_LOG::trx_group_commit_leader(MYSQL_BIN_LOG::group_commit_entry*))[0x557a3e23e6db]
            sql/log.cc:8216(MYSQL_BIN_LOG::write_transaction_to_binlog_events(MYSQL_BIN_LOG::group_commit_entry*))[0x557a3e23b6a9]
            sql/log.cc:7813(MYSQL_BIN_LOG::write_transaction_to_binlog(THD*, binlog_cache_mngr*, Log_event*, bool, bool, bool, bool))[0x557a3e23960c]
            sql/log.cc:1900(binlog_flush_cache(THD*, binlog_cache_mngr*, Log_event*, bool, bool, bool, bool))[0x557a3e2146d5]
            sql/log.cc:2050(binlog_commit_flush_xid_caches(THD*, binlog_cache_mngr*, bool, unsigned long long))[0x557a3e215bbe]
            sql/log.cc:10354(MYSQL_BIN_LOG::log_and_order(THD*, unsigned long long, bool, bool, bool))[0x557a3e249f25]
            sql/handler.cc:1876(ha_commit_trans(THD*, bool))[0x557a3dee0c76]
            sql/transaction.cc:266(trans_commit(THD*))[0x557a3daed834]
            sql/sql_parse.cc:5624(mysql_execute_command(THD*, bool))[0x557a3d62a2bc]
            sql/sql_parse.cc:8036(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x557a3d639d8b]
            sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x557a3d610437]
            sql/sql_parse.cc:1407(do_command(THD*, bool))[0x557a3d60d16d]
            sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x557a3daaba77]
            sql/sql_connect.cc:1314(handle_one_connection)[0x557a3daab2fc]
            perfschema/pfs.cc:2203(pfs_spawn_thread)[0x557a3e749741]
            nptl/pthread_create.c:487(start_thread)[0x7f554bc27fa3]
            x86_64/clone.S:97(clone)[0x7f554b830eff]
             
            Query (0x6290014b92a8): COMMIT 
            

            alice Alice Sherepa added a comment - I am getting something related on 10.10: mysqld: /10.10/storage/innobase/fts/fts0fts.cc:3113: void fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, rec_offs*, fts_doc_t*): Assertion `!page_rec_is_comp(clust_rec) || rec_get_status(clust_rec) == REC_STATUS_ORDINARY' failed. 220705 14:20:13 [ERROR] mysqld got signal 6 ;   Server version: 10.10.0-MariaDB-debug-log   linux/raise.c:51(__GI_raise)[0x7f554b76f7bb] stdlib/abort.c:81(__GI_abort)[0x7f554b75a535] intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f554b75a40f] ??:0(__assert_fail)[0x7f554b768102] fts/fts0fts.cc:3116(fts_fetch_doc_from_rec(fts_get_doc_t*, dict_index_t*, btr_pcur_t*, unsigned short*, fts_doc_t*))[0x557a3f0bb0de] fts/fts0fts.cc:3423(fts_add_doc_by_id(fts_trx_table_t*, unsigned long))[0x557a3f0bcd5e] fts/fts0fts.cc:2750(fts_add(fts_trx_table_t*, fts_trx_row_t*))[0x557a3f0b9452] fts/fts0fts.cc:2911(fts_commit_table(fts_trx_table_t*))[0x557a3f0ba718] fts/fts0fts.cc:2959(fts_commit(trx_t*))[0x557a3f0ba89e] trx/trx0trx.cc:1414(trx_t::commit_low(mtr_t*))[0x557a3ee3cda4] trx/trx0trx.cc:1456(trx_t::commit_persist())[0x557a3ee3ee48] trx/trx0trx.cc:1473(trx_t::commit())[0x557a3ee3f10f] trx/trx0trx.cc:1590(trx_commit_for_mysql(trx_t*))[0x557a3ee3f942] handler/ha_innodb.cc:4332(innobase_commit_low(trx_t*))[0x557a3e923d65] handler/ha_innodb.cc:4440(innobase_commit_ordered_2(trx_t*, THD*))[0x557a3e924452] handler/ha_innodb.cc:4488(innobase_commit_ordered(handlerton*, THD*, bool))[0x557a3e924839] sql/log.cc:9415(TC_LOG::run_commit_ordered(THD*, bool))[0x557a3e243f5d] sql/log.cc:8636(MYSQL_BIN_LOG::trx_group_commit_leader(MYSQL_BIN_LOG::group_commit_entry*))[0x557a3e23e6db] sql/log.cc:8216(MYSQL_BIN_LOG::write_transaction_to_binlog_events(MYSQL_BIN_LOG::group_commit_entry*))[0x557a3e23b6a9] sql/log.cc:7813(MYSQL_BIN_LOG::write_transaction_to_binlog(THD*, binlog_cache_mngr*, Log_event*, bool, bool, bool, bool))[0x557a3e23960c] sql/log.cc:1900(binlog_flush_cache(THD*, binlog_cache_mngr*, Log_event*, bool, bool, bool, bool))[0x557a3e2146d5] sql/log.cc:2050(binlog_commit_flush_xid_caches(THD*, binlog_cache_mngr*, bool, unsigned long long))[0x557a3e215bbe] sql/log.cc:10354(MYSQL_BIN_LOG::log_and_order(THD*, unsigned long long, bool, bool, bool))[0x557a3e249f25] sql/handler.cc:1876(ha_commit_trans(THD*, bool))[0x557a3dee0c76] sql/transaction.cc:266(trans_commit(THD*))[0x557a3daed834] sql/sql_parse.cc:5624(mysql_execute_command(THD*, bool))[0x557a3d62a2bc] sql/sql_parse.cc:8036(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x557a3d639d8b] sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x557a3d610437] sql/sql_parse.cc:1407(do_command(THD*, bool))[0x557a3d60d16d] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x557a3daaba77] sql/sql_connect.cc:1314(handle_one_connection)[0x557a3daab2fc] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x557a3e749741] nptl/pthread_create.c:487(start_thread)[0x7f554bc27fa3] x86_64/clone.S:97(clone)[0x7f554b830eff]   Query (0x6290014b92a8): COMMIT

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              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.