Per-session server_id

Registered by Laurynas Biveinis on 2013-05-23

Currently server_id is a global variable. It makes sense to have it as a session variable too, for external replication such as Tungsten support. In that case a session replaying a binlog from another server would set it to that server's id. This way binlog has the ultimate source server id attached to it no matter how many hosts it passes, and that would provide loop detection for multi-master replication.

Simply changing server_id to be a session variable is impossible because then its global value changes would apply only to new sessions, which breaks dynamic server_id behavior compatibility. Thus we need a new variable instead, i.e. session_server_id or override_server_id or pseudo_server_id. Setting this variable would require SUPER privileges.

It would have the following values:
- 0 (the default): use the global server_id value. Note that this is different from the global server_id == 0 which disables replication.
- non-zero: binlog events in this session have this server_id value.

https://bugs.mysql.com/bug.php?id=35125
https://mariadb.atlassian.net/browse/MDEV-500
MariaDB git commit ab8e8f4b2

https://github.com/percona/percona-server/pull/128

Blueprint information

Status:
Complete
Approver:
Laurynas Biveinis
Priority:
Medium
Drafter:
Laurynas Biveinis
Direction:
Approved
Assignee:
Sergei Glushchenko
Definition:
Approved
Series goal:
Accepted for 5.6
Implementation:
Implemented
Milestone target:
milestone icon 5.6.26-74.0
Started by
Laurynas Biveinis on 2015-08-14
Completed by
Laurynas Biveinis on 2015-08-18

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.