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

Document new wsrep_mode system variable for Galera in 10.6

Details

    Description

      Two new features for Galera

      • Write a warning to error log if Galera replicates InnoDB table with no primary key
      • Write a warning to error log if Galera replicates a table with storage engine not supported by Galera

      Rules

      • Write a warning to error log if Galera replicates table with storage engine not supported by Galera (at the moment only InnoDB is supported if log_warnings > 1
        • Warning is pushed to client also
        • MyISAM is allowed if wsrep_replicate_myisam=ON
      • Write a warning to error log if Galera replicates table with no primary key if log_warnings > 1
        • Warning is pushed to client also
        • MyISAM is allowed if wsrep_relicate_myisam=ON
      • In both cases apply flood control if >= 10 same warning is writen to error log (requires log_warnings > 1), flood control will suppress warnings for 300 seconds

      Attachments

        Issue Links

          Activity

            jplindst Jan Lindström (Inactive) added a comment - - edited

            Example 1:

            CREATE TABLE t1(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=INNODB;
            CREATE TABLE t2(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MYISAM;
            CREATE TABLE t3(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=ARIA;
            CREATE TABLE t4(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MEMORY;
            SET GLOBAL wsrep_replicate_myisam=ON;
            SET GLOBAL log_warnings=2;
            SET GLOBAL wsrep_mode= STRICT_REPLICATION;
            INSERT INTO t1 values (1,'innodb1');
            INSERT INTO t2 values (1,'myisam1');
            INSERT INTO t3 values (1,'aria1');
            Warnings:
            Warning        1290    WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera
            INSERT INTO t4 values (1,'memory1');
            Warnings:
            Warning        1290    WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera
            SET GLOBAL wsrep_replicate_myisam=OFF;
            INSERT INTO t2 values (2,'myisam2');
            Warnings:
            Warning        1290    WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
            

            Error log:

            2021-02-23  8:03:57 11 [Warning] WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera
            2021-02-23  8:03:57 11 [Note] WSREP: Suppressing warnings of type 'WSREP_REQUIRE_INNODB' for up to 300 seconds because of flooding
            

            Example2:

            CREATE TABLE t1(a int, b varchar(50)) ENGINE=INNODB;
            CREATE TABLE t2(a int, b varchar(50)) ENGINE=MYISAM;
            CREATE TABLE t3(a int, b varchar(50)) ENGINE=MEMORY;
            SET GLOBAL wsrep_replicate_myisam=ON;
            SET GLOBAL log_warnings=2;
            SET GLOBAL wsrep_mode= REQUIRED_PRIMARY_KEY;
            INSERT INTO t1 values (1,'test1');
            Warnings:
            Warning        1290    WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t1' should have PRIMARY KEY defined.
            INSERT INTO t2 values (1,'myisam1');
            Warnings:
            Warning        1290    WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t2' should have PRIMARY KEY defined.
            

            Error log:

            2021-02-23  8:07:46 11 [Warning] WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t1' should have PRIMARY KEY defined
            2021-02-23  8:07:46 11 [Note] WSREP: Suppressing warnings of type 'WSREP_REQUIRE_PRIMARY_KEY' for up to 300 seconds because of flooding
            

            jplindst Jan Lindström (Inactive) added a comment - - edited Example 1: CREATE TABLE t1(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=INNODB; CREATE TABLE t2(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MYISAM; CREATE TABLE t3(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=ARIA; CREATE TABLE t4(a int NOT NULL PRIMARY KEY, b varchar(50)) ENGINE=MEMORY; SET GLOBAL wsrep_replicate_myisam=ON; SET GLOBAL log_warnings=2; SET GLOBAL wsrep_mode= STRICT_REPLICATION; INSERT INTO t1 values (1,'innodb1'); INSERT INTO t2 values (1,'myisam1'); INSERT INTO t3 values (1,'aria1'); Warnings: Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria for table 'test'.'t3' is not supported in Galera INSERT INTO t4 values (1,'memory1'); Warnings: Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MEMORY for table 'test'.'t4' is not supported in Galera SET GLOBAL wsrep_replicate_myisam=OFF; INSERT INTO t2 values (2,'myisam2'); Warnings: Warning 1290 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera Error log: 2021-02-23 8:03:57 11 [Warning] WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM for table 'test'.'t2' is not supported in Galera 2021-02-23 8:03:57 11 [Note] WSREP: Suppressing warnings of type 'WSREP_REQUIRE_INNODB' for up to 300 seconds because of flooding Example2: CREATE TABLE t1(a int, b varchar(50)) ENGINE=INNODB; CREATE TABLE t2(a int, b varchar(50)) ENGINE=MYISAM; CREATE TABLE t3(a int, b varchar(50)) ENGINE=MEMORY; SET GLOBAL wsrep_replicate_myisam=ON; SET GLOBAL log_warnings=2; SET GLOBAL wsrep_mode= REQUIRED_PRIMARY_KEY; INSERT INTO t1 values (1,'test1'); Warnings: Warning 1290 WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t1' should have PRIMARY KEY defined. INSERT INTO t2 values (1,'myisam1'); Warnings: Warning 1290 WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t2' should have PRIMARY KEY defined. Error log: 2021-02-23 8:07:46 11 [Warning] WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table 'test'.'t1' should have PRIMARY KEY defined 2021-02-23 8:07:46 11 [Note] WSREP: Suppressing warnings of type 'WSREP_REQUIRE_PRIMARY_KEY' for up to 300 seconds because of flooding

            People

              dbart Daniel Bartholomew
              jplindst Jan Lindström (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.