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

CREATE OR REPLACE TRIGGER in Galera cluster not replicating

    XMLWordPrintable

Details

    Description

      When I execute this Statements:
      CREATE DATABASE IF NOT EXISTS ReplicationBug;
      CREATE TABLE IF NOT EXISTS ReplicationBug.Test (id int(10));
      CREATE OR REPLACE TRIGGER ReplicationBug.NotReplicatingTrigger
      BEFORE INSERT
      ON ReplicationBug.Test
      FOR EACH ROW
      BEGIN
      SET NEW.id = 100;
      END;

      And than (I change the Value which i assign to the NEW.id to 200):
      CREATE OR REPLACE TRIGGER ReplicationBug.NotReplicatingTrigger
      BEFORE INSERT
      ON ReplicationBug.Test
      FOR EACH ROW
      BEGIN
      SET NEW.id = 200;
      END;

      The change to the trigger is only on one node of the galera cluster. The other nodes still have the old trigger definition, which assignes NEW.id the value of 100.

      Looking in the mysqld.log of one of the nodes which did not replicate, I get the following error message:
      2020-01-27 14:43:54 13 [ERROR] Slave SQL: Error 'Trigger 'ReplicationBug.NotReplicatingTrigger' already exists' on query.
      It seems that "CREATE OR REPLACE TRIGGER" is transformed to "CREATE TRIGGER" on the other nodes.

      TL/TD:
      The replication of "CREATE OR REPLACE TRIGGER" statements is not working on our galera cluster.

      Attachments

        Issue Links

          Activity

            People

              jplindst Jan Lindström (Inactive)
              Zumbruch Immanuel
              Votes:
              2 Vote for this issue
              Watchers:
              5 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.