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

add column to table with system versioning on Galera cluster is not replicated

    XMLWordPrintable

Details

    Description

      When adding column to table with system versioning in Galera cluster, the column is only added on first node, other nodes do not get the column added and instead print this warning in their logs:

      2020-10-08 15:29:23 2 [Warning] WSREP: Ignoring error 'Not allowed for system-versioned `dbname`.`tablename`. Change @@system_versioning_alter_history to proceed with ALTER.' on query.

      To reproduce:

      1. On 2-node Galera cluster, create simple table:

      CREATE TABLE `tablename` (
      `id` SERIAL,
        `start_time` TIMESTAMP(6) GENERATED ALWAYS AS ROW START INVISIBLE,
        `end_time` TIMESTAMP(6) GENERATED ALWAYS AS ROW END INVISIBLE,
      PRIMARY KEY (`id`) 
      )
      ENGINE = InnoDB
      DEFAULT CHARACTER SET = latin1 WITH SYSTEM VERSIONING;
      

      2) Try to add a new column to the table:

      SET @@system_versioning_alter_history = 'KEEP';
      ALTER TABLE tablename
          ADD COLUMN `newcol` VARCHAR(1024) DEFAULT NULL
          AFTER id;
      SET @@system_versioning_alter_history = 0;
      

      Notice that new column is added on whichever Galera node #2 was run on, but propagation to other nodes is not successful.

      Attachments

        Activity

          People

            janlindstrom Jan Lindström
            matt666 Matt
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.