Skip to content

Commit 6835f5e

Browse files
committed
Use random server_id instead of the fixed one
1 parent b8573cb commit 6835f5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mysql_ch_replicator/binlog_replicator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import os.path
66
import json
7+
import random
78

89
from enum import Enum
910
from logging import getLogger
@@ -358,7 +359,7 @@ def __init__(self, mysql_settings: MysqlSettings, replicator_settings: BinlogRep
358359

359360
self.stream = BinLogStreamReader(
360361
connection_settings=mysql_settings,
361-
server_id=842,
362+
server_id=random.randint(1, 2**32-2),
362363
blocking=False,
363364
resume_stream=True,
364365
log_pos=log_pos,

0 commit comments

Comments
 (0)