readysettech / readyset

Readyset is a MySQL and Postgres wire-compatible caching layer that sits in front of existing databases to speed up queries and horizontally scale read throughput. Under the hood, ReadySet caches the results of cached select statements and incrementally updates these results over time as the underlying data changes.
https://readyset.io
Other
4.54k stars 126 forks source link

If two ReadySet instances are started on a MySQL master, it will result in an error: ‘a slave with the same server_uuid/server_id’. #1367

Open zhugaojian opened 2 months ago

zhugaojian commented 2 months ago

mysql: 8.0.22-13 Percona Server (GPL) readyset: stable-240829

2024-09-10T09:13:21.940167Z INFO replicators::mysql_connector::connector: Starting binlog replication next_position=mysql-bin.000047:3271 2024-09-10T09:13:21.945168Z INFO replicators::noria_adapter: MySQL connected 2024-09-10T09:13:21.945177Z INFO replicators::noria_adapter: binlog_position=mysql-bin.000047:3271 2024-09-10T09:13:22.974100Z WARN replicators::noria_adapter: Restarting adapter after error encountered error=Error during replication: Server error: ERROR HY000 (1236): A slave with the same server_uuid/server_id as this slave has connected to the master; the first event 'mysql-bin.000047' at 3271, the last event read from '/mysql/binlog/mysql-bin.000047' at 125, the last byte read from '/mysql/binlog/mysql-bin.000047' at 3271.' 2024-09-10T09:13:22.974135Z ERROR replicators: Error in replication, will retry after timeout error=Error during replication: Server error:ERROR HY000 (1236): A slave with the same server_uuid/server_id as this slave has connected to the master; the first event 'mysql-bin.000047' at 3271, the last event read from '/mysql/binlog/mysql-bin.000047' at 125, the last byte read from '/mysql/binlog/mysql-bin.000047' at 3271.' timeout_sec=1

altmannmarcelo commented 2 months ago

Hi @zhugaojian .

The problem here is that Readyset (like MySQL) uses a default server_id. We use 4294967240 which is close to the maximum server_id range in order to avoid conflicts with replicas. . If you want to have multiple readyset's connected to the same source server, you need to set --replication-server-id.

Thanks for using Readyset!

zhugaojian commented 2 months ago

Hi @zhugaojian .

The problem here is that Readyset (like MySQL) uses a default server_id. We use 4294967240 which is close to the maximum server_id range in order to avoid conflicts with replicas. . If you want to have multiple readyset's connected to the same source server, you need to set --replication-server-id.

Thanks for using Readyset!

got it, thanks!