dolthub / dolthub/dolt

binlog replication works if both replica and master have the same `@@GLOBAL.SERVER_ID`

Open
#5,586 0 comments 0 reactions 2 assignees Claimed by @zachmu View on GitHub
bug replication
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

This is supposed to fail.

Repro:

1. Start a MySQL. Keep the default server id of 1.
2. Prepare it for replication.
```
```SQL
mysql> SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON;
Query OK, 0 rows affected (0.00 sec)

mysql> SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
Query OK, 0 rows affected (0.01 sec)

mysql> SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
Query OK, 0 rows affected (0.01 sec)

mysql> SET @@GLOBAL.GTID_MODE = ON;
Query OK, 0 rows affected (0.00 sec)
```
3. Start a dolt sql-server on a different port
4. Prepare it to be a replica with same `@@GLOBAL.SERVER_ID`:
```SQL
mysql> SET @@GLOBAL.SERVER_ID=;
Query OK, 1 row affected (0.00 sec)

mysql> CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=3306;
Query OK, 0 rows affected (0.00 sec)
```

5. Start Replica works in this case but should fail because the primary and replica both have the same `SERVER_ID.`
```SQL
mysql> START REPLICA;
Query OK, 0 rows affected (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.