Skip to content

Commit 0950728

Browse files
committed
Update PeerDB UI to allow setting server_id MySQL setting
1 parent 132c87e commit 0950728

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • ui/app/peers/create/[peerType]/helpers

ui/app/peers/create/[peerType]/helpers/my.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,29 @@ export const mysqlSetting: PeerSetting[] = [
9898
{ value: 'MYSQL_FILEPOS', label: 'FilePos' },
9999
],
100100
},
101+
{
102+
label: 'Server ID',
103+
field: 'serverId',
104+
type: 'number',
105+
optional: true,
106+
stateHandler: (value, setter) => {
107+
const strValue = value as string;
108+
if (!strValue) {
109+
// Leave unset so a random server_id is generated on each CDC run (legacy behavior).
110+
setter((curr) => {
111+
const newCurr = { ...curr } as MySqlConfig;
112+
delete newCurr.serverId;
113+
return newCurr;
114+
});
115+
} else {
116+
setter((curr) => ({ ...curr, serverId: parseInt(strValue, 10) }));
117+
}
118+
},
119+
tips:
120+
'Optional. Fixed server_id used for the MySQL replication (binlog) connection. ' +
121+
'Leave blank to auto-generate a random id on each CDC run. A fixed server_id must be ' +
122+
'unique among replicas, so a peer that sets it cannot be reused across multiple mirrors.',
123+
},
101124
{
102125
label: 'Root Certificate',
103126
stateHandler: (value, setter) => {

0 commit comments

Comments
 (0)