[MDEV-10909] Enable replicate-rewrite-db in multi source Created: 2016-09-27  Updated: 2022-10-28  Resolved: 2022-10-05

Status: Closed
Project: MariaDB Server
Component/s: Replication
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: VAROQUI Stephane Assignee: Brandon Nesterenko
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-15530 Variable replicate_rewrite_db cannot ... Closed

 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



 Comments   
Comment by Brandon Nesterenko [ 2022-09-27 ]

I think this is duplicated by MDEV-15530. stephane@skysql.com if you get a chance, can you take a look at this file diff to see if this test matches your proposed workflow? If so, I think we can close this ticket as a duplicate. MDEV-15530 is expected to make it into the 10.11 release, and it is currently on the 10.11 preview release if you wanted to test it out.

Comment by VAROQUI Stephane [ 2022-09-28 ]

Thanks, yes it was fixed in MDEV-15530 and online alter table MDEV-16329

But still before it's to late for 10.11

https://github.com/MariaDB/server/commit/f7e114cd4884d982ed4fd57352ee7b59065a9579#
But what happen ligne 32 if you add restart of the slave , i guess this is an other issue storing those variables as a persistent system table or a file so that memory variable is first init from it and overwrite from config variable on startup

Comment by Brandon Nesterenko [ 2022-09-29 ]

If I understand your question, the replication filters are only saved in memory and not persisted (including replicate_rewrite_db). So on a slave restart, any updates set dynamically will be lost. Line 114 of mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result in the 10.11 commit shows this. Is your suggestion to persist the dynamic updates to replication filters? (And you mention the issue that on server restart the configuration file would be reread and potentially inconsistent with any dynamic updates).

I could see the benefit of a new CHANGE MASTER TO option which would enable some sort of "exclusive dynamic replication filter mode" that would make the connection ignore the values set in the configuration files, and it would persist the settings and only allow dynamic updates there on out (or until disabled).

Comment by Brandon Nesterenko [ 2022-10-05 ]

Feedback was given that this ticket is a duplicate

Generated at Thu Feb 08 07:45:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.