[MDEV-29136] Assertion `!share->no_status_updates' failed in _ma_mark_file_changed_now upon CHECK on S3 table Created: 2022-07-19  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - S3
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: regression


 Description   

drop table if exists t;
create table t (b varchar(8192)) engine=Aria;
insert into t values (repeat('1',8182));
alter table t engine=S3;
check table t;
 
# Cleanup
drop table t;

10.5 8494758e

mariadbd: /data/src/10.5/storage/maria/ma_locking.c:451: _ma_mark_file_changed_now: Assertion `!share->no_status_updates' failed.
220719 18:50:58 [ERROR] mysqld got signal 6 ;
 
#6  0x00007f64e1c2040f in __assert_fail_base (fmt=0x7f64e1d89128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563d6b0ec77e "!share->no_status_updates", file=0x563d6b0ec650 "/data/src/10.5/storage/maria/ma_locking.c", line=451, function=<optimized out>) at assert.c:92
        str = 0x7f64c010acf0 "\220.\005\300d\177"
        total = 4096
#7  0x00007f64e1c2f662 in __GI___assert_fail (assertion=0x563d6b0ec77e "!share->no_status_updates", file=0x563d6b0ec650 "/data/src/10.5/storage/maria/ma_locking.c", line=451, function=0x563d6b0ec840 <__PRETTY_FUNCTION__.3> "_ma_mark_file_changed_now") at assert.c:101
No locals.
#8  0x0000563d6a6dbe05 in _ma_mark_file_changed_now (share=0x7f64c00859a8) at /data/src/10.5/storage/maria/ma_locking.c:451
        buff = "\177\000"
        error = 1
        _db_stack_frame_ = {func = 0x563d6b105100 "_ma_change_bitmap_page", file = 0x563d6b104bd8 "/data/src/10.5/storage/maria/ma_bitmap.c", level = 2147483659, line = -1, prev = 0x7f64dc2dff40}
        __PRETTY_FUNCTION__ = "_ma_mark_file_changed_now"
#9  0x0000563d6a76f24e in _ma_bitmap_mark_file_changed (share=0x7f64c00859a8, flush_translog=1 '\001') at /data/src/10.5/storage/maria/ma_bitmap.c:387
No locals.
#10 0x0000563d6a7709bf in _ma_change_bitmap_page (info=0x7f64c0060cc8, bitmap=0x7f64c0086500, page=0) at /data/src/10.5/storage/maria/ma_bitmap.c:1136
        _db_stack_frame_ = {func = 0x563d6b1054a7 "_ma_bitmap_get_page_bits", file = 0x563d6b104bd8 "/data/src/10.5/storage/maria/ma_bitmap.c", level = 2147483658, line = -1, prev = 0x7f64dc2dffc0}
#11 0x0000563d6a773397 in bitmap_get_page_bits (info=0x7f64c0060cc8, bitmap=0x7f64c0086500, page=2) at /data/src/10.5/storage/maria/ma_bitmap.c:2400
        bitmap_page = 0
        offset_page = 22077
        offset = 3221775752
        tmp = 32612
        data = 0x7f64dc2dffc0 "F\201\020k=V"
        _db_stack_frame_ = {func = 0x563d6b108146 "check_head_page", file = 0x563d6b107040 "/data/src/10.5/storage/maria/ma_check.c", level = 2147483657, line = -1, prev = 0x7f64dc2e00f0}
#12 0x0000563d6a773471 in _ma_bitmap_get_page_bits (info=0x7f64c0060cc8, bitmap=0x7f64c0086500, page=2) at /data/src/10.5/storage/maria/ma_bitmap.c:2424
        tmp = 0
#13 0x0000563d6a774c73 in _ma_check_if_right_bitmap_type (info=0x7f64c0060cc8, page_type=BLOB_PAGE, page=2, bitmap_pattern=0x7f64dc2e00a4) at /data/src/10.5/storage/maria/ma_bitmap.c:3042
        __PRETTY_FUNCTION__ = "_ma_check_if_right_bitmap_type"
#14 0x0000563d6a78e63b in check_head_page (param=0x7f64c0253570, info=0x7f64c0060cc8, record=0x7f64c006a1d8 "\376\366\037", '\061' <repeats 197 times>..., extend=1, page_pos=8192, page_buff=0x7f64c006e288 "", row_count=1) at /data/src/10.5/storage/maria/ma_check.c:1836
        bitmap_pattern = 32612
        extent_page = 2
        page_count = 0
        page_type = 3
        extents = 0x7f64c0079c6f "\003"
        i = 0
        pos = 12
        length = 28
        flag = 128
        share = 0x7f64c00859a8
        dir_entry = 0x7f64c0070280 "\f"
        row = 0
        llbuff = "\272\204\020k=V\000\000@p\020k=V\000\000\b\000\000\200\320\037"
        llbuff2 = "p\001.\334d\177\000\000\301Gwj=V\000\000\070j\000\300d\177"
        page = 1
        _db_stack_frame_ = {func = 0x563d6b1084ba "maria_chk_data_link", file = 0x563d6b107040 "/data/src/10.5/storage/maria/ma_check.c", level = 2147483656, line = -1, prev = 0x7f64dc2e02e0}
#15 0x0000563d6a78f3a5 in check_block_record (param=0x7f64c0253570, info=0x7f64c0060cc8, extend=1, record=0x7f64c006a1d8 "\376\366\037", '\061' <repeats 197 times>...) at /data/src/10.5/storage/maria/ma_check.c:2048
        bitmap_pattern = 377
        bitmap_for_page = 1
        row_count = 1
        real_row_count = 1
        empty_space = 8144
        page_type = 1
        share = 0x7f64c00859a8
        pos = 8192
        page = 1
        page_buff = 0x7f64c006e288 ""
        bitmap_buff = 0x7f64c006c288 "y\001"
        data = 0x7f64c006c288 "y\001"
        llbuff = "\020 \000\000\000\000\000\000\270\f\000\300\000\000\000\000\220\002.\334\000"
        llbuff2 = "\330\241\006\300d\177\000\000\020 \000\000\000\000\000\000\272\204\020k=V"
        block_size = 8192
        full_page_count = 0
        tail_count = 0
        full_dir = 0 '\000'
        now_transactional = 0 '\000'
        offset_page = 0
        offset = 0
        free_count = 0
        lsn = 0
        __PRETTY_FUNCTION__ = "check_block_record"
#16 0x0000563d6a78f9d2 in maria_chk_data_link (param=0x7f64c0253570, info=0x7f64c0060cc8, extend=1 '\001') at /data/src/10.5/storage/maria/ma_check.c:2152
        share = 0x7f64c00859a8
        error = 0
        record = 0x7f64c006a1d8 "\376\366\037", '\061' <repeats 197 times>...
        llbuff = " \003.\334d\177\000\000\227\355\377i=V\000\000B:G\000\000"
        llbuff2 = "P\003.\334d\177\000\000z\246\vj=V\000\000\070]\351j=V"
        llbuff3 = "\266z\201j\005\000\000\000\326\247\204\222~\225\020\000p\003.\334d\177"
        _db_stack_frame_ = {func = 0x563d6aefc610 "mysql_admin_table", file = 0x563d6aefc320 "/data/src/10.5/sql/sql_admin.cc", level = 2147483655, line = -1, prev = 0x7f64dc2e05b0}
#17 0x0000563d6a6f074d in ha_maria::check (this=0x7f64c0057c30, thd=0x7f64c0000db8, check_opt=0x7f64c0006220) at /data/src/10.5/storage/maria/ha_maria.cc:1341
        old_testflag = 4194832
        error = 0
        fatal_error = -600964128
        param = 0x7f64c0253570
        share = 0x7f64c00859a8
        old_proc_info = 0x563d6ae6fad5 "Executing"
        old_trn = 0x563d6ba9df00 <dummy_transaction_object>
        __PRETTY_FUNCTION__ = "virtual int ha_maria::check(THD*, HA_CHECK_OPT*)"
#18 0x0000563d6a4a5356 in handler::ha_check (this=0x7f64c0057c30, thd=0x7f64c0000db8, check_opt=0x7f64c0006220) at /data/src/10.5/sql/handler.cc:4625
        error = 32612
        __PRETTY_FUNCTION__ = "int handler::ha_check(THD*, HA_CHECK_OPT*)"
#19 0x0000563d6a2ed285 in mysql_admin_table (thd=0x7f64c0000db8, tables=0x7f64c00153d0, check_opt=0x7f64c0006220, operator_name=0x563d6aefcc14 "check", lock_type=TL_READ_NO_INSERT, org_open_for_modify=false, repair_table_use_frm=false, extra_open_options=32, prepare_func=0x0, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x563d6a4a5194 <handler::ha_check(THD*, st_ha_check_opt*)>, view_operator_func=0x563d6a26899f <view_check(THD*, TABLE_LIST*, st_ha_check_opt*)>, is_cmd_replicated=false) at /data/src/10.5/sql/sql_admin.cc:832
        table_name = {str = 0x7f64dc2e05f0 "test.t", length = 6}
        db = 0x7f64c0015aa8 "test"
        fatal_error = false
        open_for_modify = false
        table_name_buff = "test.t\000\000p\b.\334d\177\000\000\006\000\000\000d\177\000\000\340\f\000\300\000\000\000\000_\024\060k=V\000\000\000\000\000\000\000\000\000\000@\006.\334d\177\000\000\036\001\331j\000\000\001\000\036S\001\300d\177\000\000\b\000\000\000\000\000\000\000\000\000.\334d\177\000\000\340\f\000\300d\177\000\000\020S\001\300d\177\000\000\005\000\000\000\000\000\000\000\000\000.\334d\177\000\000o\363\333j=V\000\000\340\306\351j=V\000\000\320\b.\334d\177\000\000\v\000\000\000d\177\000\000\340\f\000\300d\177\000\000\300Z\001\300d\177\000\000\002\000\000\000\000\000\000\000\220\031\351j=V", '\000' <repeats 12 times>, "E\000\340\002<\003"...
        open_error = false
        collect_eis = false
        table = 0x7f64c00153d0
        field_list = {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f64c0015b58, last = 0x7f64c0015d80, elements = 4}, <No data fields>}
        item = 0x7f64c0015cd0
        protocol = 0x7f64c00013b0
        lex = 0x7f64c0004e98
        result_code = 0
        compl_result_code = 0
        need_repair_or_alter = false
        suspended_wfc = 0x0
        is_table_modified = false
        _db_stack_frame_ = {func = 0x563d6aefcbf7 "Sql_cmd_check_table::execute", file = 0x563d6aefc320 "/data/src/10.5/sql/sql_admin.cc", level = 2147483654, line = -1, prev = 0x7f64dc2e0c30}
        __PRETTY_FUNCTION__ = "bool mysql_admin_table(THD*, TABLE_LIST*, HA_CHECK_OPT*, const char*, thr_lock_type, bool, bool, uint, int (*)(THD*, TABLE_LIST*, HA_CHECK_OPT*), int (handler::*)(THD*, HA_CHECK_OPT*), int (*)(THD*, T"...
#20 0x0000563d6a2ef626 in Sql_cmd_check_table::execute (this=0x7f64c0015ab0, thd=0x7f64c0000db8) at /data/src/10.5/sql/sql_admin.cc:1424
        m_lex = 0x7f64c0004e98
        first_table = 0x7f64c00153d0
        lock_type = TL_READ_NO_INSERT
        res = true
        _db_stack_frame_ = {func = 0x563d6aeab998 "mysql_execute_command", file = 0x563d6aeaad20 "/data/src/10.5/sql/sql_parse.cc", level = 2147483653, line = -1, prev = 0x7f64dc2e0e00}
#21 0x0000563d6a137c00 in mysql_execute_command (thd=0x7f64c0000db8) at /data/src/10.5/sql/sql_parse.cc:6056
        res = 0
        up_result = 0
        lex = 0x7f64c0004e98
        select_lex = 0x7f64c0005770
        first_table = 0x7f64c00153d0
        all_tables = 0x7f64c00153d0
        unit = 0x7f64c0004f60
        have_table_map_for_update = false
        rpl_filter = 0x0
        _db_stack_frame_ = {func = 0x563d6aeaccef "mysql_parse", file = 0x563d6aeaad20 "/data/src/10.5/sql/sql_parse.cc", level = 2147483652, line = -1, prev = 0x7f64dc2e1210}
        __PRETTY_FUNCTION__ = "int mysql_execute_command(THD*)"
        ots = {ctx = 0x7f64c0004b60, traceable = false}
        trace_command = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x563d6b71dd28 <vtable for Json_writer_object+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
        trace_command_steps = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x563d6b71dd08 <vtable for Json_writer_array+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
        orig_binlog_format = BINLOG_FORMAT_MIXED
        orig_current_stmt_binlog_format = BINLOG_FORMAT_STMT
#22 0x0000563d6a13dcf9 in mysql_parse (thd=0x7f64c0000db8, rawbuf=0x7f64c0015310 "check table t extended", length=22, parser_state=0x7f64dc2e13d0, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:8100
        found_semicolon = 0x0
        error = 32612
        lex = 0x7f64c0004e98
        err = false
        _db_stack_frame_ = {func = 0x563d6aeab1b2 "dispatch_command", file = 0x563d6aeaad20 "/data/src/10.5/sql/sql_parse.cc", level = 2147483651, line = -1, prev = 0x7f64dc2e13b0}
        __PRETTY_FUNCTION__ = "void mysql_parse(THD*, char*, uint, Parser_state*, bool, bool)"
#23 0x0000563d6a129e32 in dispatch_command (command=COM_QUERY, thd=0x7f64c0000db8, packet=0x7f64c000b5c9 "", packet_length=22, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1891
        packet_end = 0x7f64c0015326 ""
        parser_state = {m_lip = {lookahead_token = -1, lookahead_yylval = 0x0, m_thd = 0x7f64c0000db8, m_ptr = 0x7f64c0015327 "\004", m_tok_start = 0x7f64c0015327 "\004", m_tok_end = 0x7f64c0015327 "\004", m_end_of_query = 0x7f64c0015326 "", m_tok_start_prev = 0x7f64c0015326 "", m_buf = 0x7f64c0015310 "check table t extended", m_buf_length = 22, m_echo = true, m_echo_saved = 188, m_cpp_buf = 0x7f64c0015380 "check table t extended", m_cpp_ptr = 0x7f64c0015396 "", m_cpp_tok_start = 0x7f64c0015396 "", m_cpp_tok_start_prev = 0x7f64c0015396 "", m_cpp_tok_end = 0x7f64c0015396 "", m_body_utf8 = 0x0, m_body_utf8_ptr = 0x7f64c0000ce0 "\222<\376k\374\177", m_cpp_utf8_processed_ptr = 0x0, next_state = MY_LEX_END, found_semicolon = 0x0, ignore_space = false, stmt_prepare_mode = false, multi_statements = true, yylineno = 1, m_digest = 0x0, in_comment = NO_COMMENT, in_comment_saved = (unknown: 0x7f64), m_cpp_text_start = 0x7f64c001538c "t extended", m_cpp_text_end = 0x7f64c001538d " extended", m_underscore_cs = 0x0}, m_yacc = {yacc_yyss = 0x0, yacc_yyvs = 0x0, m_set_signal_info = {m_item = {0x0 <repeats 12 times>}}, m_lock_type = TL_UNLOCK, m_mdl_type = MDL_SHARED_READ}, m_digest_psi = 0x7f64c00048f0}
        net = 0x7f64c00010e0
        error = false
        do_end_of_statement = true
        _db_stack_frame_ = {func = 0x563d6aeaaf1d "do_command", file = 0x563d6aeaad20 "/data/src/10.5/sql/sql_parse.cc", level = 2147483650, line = -1, prev = 0x7f64dc2e1c80}
        drop_more_results = false
        __PRETTY_FUNCTION__ = "bool dispatch_command(enum_server_command, THD*, char*, uint, bool, bool)"
        __FUNCTION__ = "dispatch_command"
        res = <optimized out>
#24 0x0000563d6a12868c in do_command (thd=0x7f64c0000db8) at /data/src/10.5/sql/sql_parse.cc:1375
        return_value = false
        packet = 0x7f64c000b5c8 "\027"
        packet_length = 23
        net = 0x7f64c00010e0
        command = COM_QUERY
        _db_stack_frame_ = {func = 0x563d6b309820 "?func", file = 0x563d6b309826 "?file", level = 2147483649, line = -1, prev = 0x0}
        __PRETTY_FUNCTION__ = "bool do_command(THD*)"
        __FUNCTION__ = "do_command"
#25 0x0000563d6a2d5a97 in do_handle_one_connection (connect=0x563d6e6c8c08, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1418
        create_user = true
        thr_create_utime = 4667970239418
        thd = 0x7f64c0000db8
        __PRETTY_FUNCTION__ = "void do_handle_one_connection(CONNECT*, bool)"
#26 0x0000563d6a2d5759 in handle_one_connection (arg=0x563d6e68e958) at /data/src/10.5/sql/sql_connect.cc:1312
        connect = 0x563d6e68e958
#27 0x0000563d6a7e65ec in pfs_spawn_thread (arg=0x563d6e6c7e48) at /data/src/10.5/storage/perfschema/pfs.cc:2201
        typed_arg = 0x563d6e6c7e48
        user_arg = 0x563d6e68e958
        user_start_routine = 0x563d6a2d56fe <handle_one_connection(void*)>
        pfs = 0x7f64e152d140
        klass = 0x563d6e0e8900
#28 0x00007f64e20fbea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140071167469312, -8045554321309496258, 140722120304462, 140722120304463, 140071167467072, 311296, 7967372025448434750, 7967350321962224702}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#29 0x00007f64e1cf8def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Reproducible on 10.5-10.10, both with MinIO and AWS.
No obvious immediate problem on a non-debug build.

The failure started happening after this commit in 10.5:

commit 96329d632159f1f5a017e002c3217e19c79e5731
Author: Monty
Date:   Sun May 29 12:10:37 2022 +0300
 
    Fixed that CHECK TABLE on an S3 table doesn't try to write to files


Generated at Thu Feb 08 10:06:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.