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

InnoDB assertion failure `key_version != ENCRYPTION_KEY_VERSION_INVALID`

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.2
    • N/A
    • None
    • None

    Description

      Assertion failure in innodb -

      2025-11-20 16:06:40 0x7f5d567fc6c0  InnoDB: Assertion failure in file /home/rb/w/p/server/storage/innobase/fil/fil0crypt.cc line 522
      InnoDB: Failing assertion: key_version != ENCRYPTION_KEY_VERSION_INVALID
      

      Reproduction steps-
      Latest hashicorp encryption plugin with FLUSH command support. clone the tree bb-main-mdev-38111

      MTR test case

      --source include/have_innodb.inc
      --source hashicorp_plugin.inc
       
      --exec vault secrets disable flush_race_test > /dev/null
      --exec vault secrets enable -path /flush_race_test -version=2 kv > /dev/null
      --exec vault kv put /flush_race_test/1 data="59af70fb2f9f9e0acbff9af9c81dec91" > /dev/null
      --exec vault kv put /flush_race_test/2 data="526540c9854d26cea56a463e4ccff3ec" > /dev/null
       
      --echo # restart the server with encryption
      --let $vault_defaults=--plugin-load-add=hashicorp_key_management --hashicorp_key_management=force --hashicorp-key-management-check-kv-version=on --hashicorp-key-management-vault-url=$VAULT_ADDR/v1/flush_race_test/ --hashicorp-key-management-token=$VAULT_TOKEN
      --let $innodb_defaults=--innodb-encrypt-tables=ON --innodb-encrypt-log=ON --innodb-encryption-threads=4 --innodb-encryption-rotate-key-age=1
      --let $restart_parameters=$vault_defaults $innodb_defaults
      --let $restart_noprint=2
      --source include/restart_mysqld.inc
       
      CREATE TABLE t1 (c1 INT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
      FLUSH HASHICORP_KEY_MANAGEMENT_CACHE;
      DROP TABLE t1;
       
      --exec vault secrets disable flush_race_test > /dev/null
      

      error log with backtrace -

      Version: '12.2.0-MariaDB-debug-log'  socket: '/home/rb/w/p/mdev-38111-build/mysql-test/var/tmp/mysqld.1.sock'  port: 19030  Source distribution
      2025-11-20 16:06:39 0 [Note] /home/rb/w/p/mdev-38111-build/sql/mariadbd (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
      2025-11-20 16:06:39 0 [Note] InnoDB: FTS optimize thread exiting.
      2025-11-20 16:06:40 0 [Note] mariadbd: hashicorp: Key not found (key id: 1)
      2025-11-20 16:06:40 0x7f5d567fc6c0  InnoDB: Assertion failure in file /home/rb/w/p/server/storage/innobase/fil/fil0crypt.cc line 522
      InnoDB: Failing assertion: key_version != ENCRYPTION_KEY_VERSION_INVALID
      InnoDB: We intentionally generate a memory trap.
      InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      InnoDB: If you get repeated assertion failures or crashes, even
      InnoDB: immediately after the mariadbd startup, there may be
      InnoDB: corruption in the InnoDB tablespace. Please refer to
      InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
      InnoDB: about forcing recovery.
      251120 16:06:40 [ERROR] /home/rb/w/p/mdev-38111-build/sql/mariadbd got signal 6 ;
      Sorry, we probably made a mistake, and this is a bug.
       
      Your assistance in bug reporting will enable us to fix this for the next release.
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs about how to report
      a bug on https://jira.mariadb.org/.
       
      Please include the information from the server start above, to the end of the
      information below.
       
      Server version: 12.2.0-MariaDB-debug-log source revision: 61917292d5522b98df7bf18bdb9f8a541b61982c
       
      The information page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/
      contains instructions to obtain a better version of the backtrace below.
      Following these instructions will help MariaDB developers provide a fix quicker.
       
      Attempting backtrace. Include this in the bug report.
      (note: Retrieving this information may fail)
       
      Thread pointer: 0x0
      stack_bottom = 0x0 thread_stack 0x49000
      mysys/stacktrace.c:215(my_print_stacktrace)[0x5966280a1950]
      sql/signal_handler.cc:230(handle_fatal_signal)[0x596627605632]
      libc_sigaction.c:0(__restore_rt)[0x7f5d78045330]
      nptl/pthread_kill.c:44(__pthread_kill_implementation)[0x7f5d7809eb2c]
      posix/raise.c:27(__GI_raise)[0x7f5d7804527e]
      stdlib/abort.c:81(__GI_abort)[0x7f5d780288ff]
      2025-11-20 16:06:43 0 [Note] InnoDB: Memory pressure event disregarded; innodb_buffer_pool_size=8m, innodb_buffer_pool_size_auto_min=8m
      ut/ut0new.cc:84(ut_new_boot())[0x596627e2640c]
      fil/fil0crypt.cc:525(fil_encrypt_buf_for_full_crc32(fil_space_crypt_t*, unsigned long, unsigned long, unsigned long, unsigned char const*, unsigned char*))[0x596627f49e5f]
      fil/fil0crypt.cc:571(fil_encrypt_buf(fil_space_crypt_t*, unsigned long, unsigned long, unsigned char const*, unsigned long, unsigned char*, bool))[0x596627f4a1cf]
      fil/fil0crypt.cc:622(fil_space_encrypt(fil_space_t const*, unsigned long, unsigned char*, unsigned char*))[0x596627f4a3b6]
      buf/buf0flu.cc:655(buf_page_encrypt(fil_space_t*, buf_page_t*, unsigned char*, buf_tmp_buffer_t**, unsigned long*))[0x596627eb3501]
      buf/buf0flu.cc:825(buf_page_t::flush(fil_space_t*))[0x596627eb48ad]
      buf/buf0flu.cc:1697(buf_flush_list_space(fil_space_t*, unsigned long*))[0x596627eb8b67]
      fil/fil0crypt.cc:1918(fil_crypt_flush_space(rotate_thread_t*))[0x596627f4e03f]
      fil/fil0crypt.cc:2005(fil_crypt_complete_rotate_space(rotate_thread_t*))[0x596627f4e51e]
      fil/fil0crypt.cc:2087(fil_crypt_thread())[0x596627f4e871]
      bits/invoke.h:61(void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()))[0x596627f50bf7]
      bits/invoke.h:97(std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()))[0x596627f50ba3]
      bits/std_thread.h:292(void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>))[0x596627f50b44]
      bits/std_thread.h:299(std::thread::_Invoker<std::tuple<void (*)()> >::operator()())[0x596627f50b14]
      bits/std_thread.h:244(std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run())[0x596627f50af4]
      /lib/x86_64-linux-gnu/libstdc++.so.6(+0xecdb4)[0x7f5d784ecdb4]
      nptl/pthread_create.c:447(start_thread)[0x7f5d7809caa4]
      x86_64/clone3.S:80(clone3)[0x7f5d78129c6c]
      Writing a core file...
      Working directory at /home/rb/w/p/mdev-38111-build/mysql-test/var/mysqld.1/data
      Resource Limits (excludes unlimited resources):
      
      

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            raghunandan.bhat Raghunandan Bhat
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.