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

Add warning messages for applier FK failures

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Galera Maintenance, Q4/2025 Galera Development

    Description

      Consider 3-node cluster and let their identifies be node_1, node_2 and node_3. Assume following kind of tables with data:

      CREATE TABLE parent(id integer not null primary key, f1 integer) ENGINE=InnoDB;
      CREATE TABLE child(id integer not null primary key, fk_col integer, foreign key fk_id (fk_col) 
      references parent.f1 ON UPDATE CASCADE ON DELETE CASCADE) ENGINE=InnoDB;
      INSERT INTO parent values (1,1);
      

      Now there is two non-conflicting autocommit transactions in different nodes like this:

      --connection node_1
      --send INSERT INTO child VALUES (1,1);
      --connection node_2
      --send INSERT INTO child VALUES (2,1);
      

      Locally both transactions commit successfully and send write set to node_3 where these two writeset can be executed
      concurrently, because they are not conflicting. Both transactions try to take record lock for parent (1,1) row to avoid concurrent UPDATE/DELETE changing it.

      In this task foreign constraint errors that happen in node_3 executed by applier thread should be logged to error log. If error is something else than LOCK_WAIT it is indication of problems. Possible reasons:

      • There is not enough information on writeset to avoid problematic concurrent execution e.g. some writeset key information is missing.
      • For some reason databases are inconsistent state
      • There is a bug on implementation

      Currently, if there is apply error error log will contain apply error and inconsistency voting messages but exact reason i.e. what exact point of foreign key action error happened is not logged anywhere. Some of the current code error cases might not possible for applier threads some are but finding exact correct test case might be hard.

      Attachments

        Issue Links

          Activity

            People

              janlindstrom Jan Lindström
              janlindstrom Jan Lindström
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.