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

Enable replicate-rewrite-db in multi source

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • N/A
    • Replication
    • None

    Description

      The task would enable online operations only using SQL command

      We would following workflow

      set global replicate-same-server-id=1:

      CHANGE MASTER 'online' TO master_host='127.0.0.1, master_user='skysql' , master_password='skyvodka' ;

      set global online.replicate_do_table='db1.t';
      set global online.rewrite_db='db->db_new';
      create or replace database db_new;
      create or replace table db_new.t like db_new.t ;

      -> online operation to be produce resharding or ddl
      alter table db_new.t add column c1 int ;
      LOCK TABLE db_new.t
      set global online.@@slav_pos = @@current_pos;

      CHANGE MASTER 'online' TO master_use_gtid=slave_pos
      START SLAVE;
      UNLOCK TABLE db_new.t

      insert ignore into db_new.t select * from db.t

      Wait to catch replication
      rename atomic of the 2 tables

      reset replication

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              stephane@skysql.com VAROQUI Stephane
              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.