[MDEV-32730] Create server on master node is not replicate to slave Created: 2023-11-08  Updated: 2023-11-14

Status: Open
Project: MariaDB Server
Component/s: Replication, Server
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.5, 10.6, 10.11, 11.0, 11.1, 11.2

Type: Bug Priority: Minor
Reporter: Khamhak Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5023 Documentation CREATE SERVER regarding... Closed
relates to MDEV-21605 Clean up and speed up interfaces for ... Closed

 Description   

My steps:

Master

MariaDB [(none)]> CREATE SERVER corehis_servertest FOREIGN DATA WRAPPER mysql OPTIONS (HOST '10.151.101.*',USER 'rpt',PASSWORD '********', PORT 4008,DATABASE 'corehistest');
 
 
MariaDB [(none)]> select * from mysql.servers;
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+
| Server_name        | Host           | Db          | Username | Password      | Port | Socket | Wrapper | Owner |
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+
| core001_server     | 10.151.101.* | core001     | rpt      | ******** | 4008 |        | mysql   |       |
| payment_server     | 10.151.101.* | payment   | rpt      | ******** | 4008 |        | mysql   |       |
| corehis_server     | 10.151.101.* | corehis        | rpt      | ******** | 4008 |        | mysql   |       |
| corehis_servertest | 10.151.101.* | corehistest | rpt      | ******** | 4008 |        | mysql   |       |
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+

Slave

 
MariaDB [(none)]> select * from mysql.servers;
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+
| Server_name        | Host           | Db          | Username | Password      | Port | Socket | Wrapper | Owner |
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+
| core001_server     | 10.151.101.* | core001     | rpt      | ******** | 4008 |        | mysql   |       |
| payment_server     | 10.151.101.* | payment   | rpt      | ******** | 4008 |        | mysql   |       |
| corehis_server     | 10.151.101.* | corehis        | rpt      | ******** | 4008 |        | mysql   |       |
+--------------------+----------------+-------------+----------+---------------+------+--------+---------+-------+



 Comments   
Comment by Daniel Black [ 2023-11-08 ]

I'm not sure what made this receive specific attention however from documentation https://mariadb.com/kb/en/create-server/

"CREATE SERVER is not written to the binary log, irrespective of the binary log format being used"

Comment by Khamhak [ 2023-11-08 ]

Hi Daniel Black
You mean CREATE SERVER is not replicate, if I want have same servers on all master and slave I should create on all two nodes?

Comment by Daniel Black [ 2023-11-08 ]

If its not written to the binary log it won't replicate.

A small modification was added in 10.5.2 with commit, intentionally but I don't see why.

Documentation change indicate it was there previously (I tested, it was in 10.4).

I do follow your case that its important for all servers in a replication change to have the same SERVER definition.

Unfortunately for the moment you will need to CREATE SERVER on all nodes.

Comment by Khamhak [ 2023-11-08 ]

Thank you so much.

Comment by Sergei Golubchik [ 2023-11-09 ]

Documentation contains the line

CREATE SERVER is not written to the [[binary-log|binary log]], irrespective of the [[binary-log-formats|binary log format]] being used.

since November 2014.

Replication appears to be disabled in the commit 36290c0923 with the explanation

Due to Bug 25705 replication of
DROP/CREATE/ALTER SERVER is broken.
Make sure at least we do not attempt to
replicate these statements using RBR,
as this violates the assert in close_mysql_tables().

Comment by Daniel Black [ 2023-11-14 ]

Spoke to monty, he's ok with this being changed, I assume non-GA version.

Generated at Thu Feb 08 10:33:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.