Skip to content

MDEV-22250 InnoDB: Failing assertion: opt_no_lock during mariabackup --backup #4148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 10.6
Choose a base branch
from

Conversation

Thirunarayanan
Copy link
Member

  • The Jira issue number for this PR is: MDEV-22250

Description

mysql_inplace_alter_table(): Defer the downgradation of DDL lock after prepare phase completion when fulltext index is being rebuilt

Release Notes

mariabackup defers the downgradation of DDL LOCK after prepare phase when fts indexes are being rebuilt.

How can this PR be tested?

Following patch basically makes mariabackup sleeps for few more seconds:

diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index ef3018c5644..e628b8eea7c 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -1462,6 +1462,8 @@ bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta,
 
        corrupted_pages.backup_fix_ddl(ds_data, ds_meta);
 
+        DBUG_EXECUTE_IF("no_ddl_redo",
+                        my_sleep(100000 * 1000UL););
        // There is no need to stop slave thread before coping non-Innodb data when
        // --no-lock option is used because --no-lock option requires that no DDL or
        // DML to non-transaction tables can occur.

Test case to repeat the issue:

--source include/have_innodb.inc

let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log;
CREATE TABLE t1 ( col1 INT, col_text TEXT, fulltext(col_text))ENGINE=InnoDB;
--delimiter $
--send
BEGIN NOT ATOMIC
  DECLARE n INT DEFAULT 0;
  WHILE n < 50 DO
    ALTER TABLE t1 FORCE;
    ALTER TABLE t1 FORCE;
    ALTER TABLE t1 FORCE;
    SET n = n + 1;
  END WHILE;
END $
--delimiter ;

--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -- target-dir=$targetdir --log-copy-interval=1 --dbug=+d,no_ddl_redo >     $backup_log 2>&1 &

--reap
DROP TABLE t1;
--let SEARCH_PATTERN= Unexpected DDL operation detected in the late     phase of backup
--let SEARCH_FILE=$backup_log
--source include/search_pattern_in_file.inc
--remove_file $backup_log
--rmdir $targetdir

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

…--backup

mysql_inplace_alter_table(): Defer the downgradation of DDL lock
after prepare phase completion when fulltext index is being rebuilt
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants