gtid_domain_id variable is needed to be able to have multisource+GTID slaves.
The idea is to slowly deploy this to first one of the misc shards and leave it running for a few days to make sure the logs rotate fine etc.
Then maybe one shard of codfw
This injects new objects on the binlogs, so it needs to be treated carefully.
More context on why this is needed: https://phabricator.wikimedia.org/T146261#2744128
From my tests, this would do the trick
gtid_domain_id = <%= @my_hostname.gsub(/^db(\d+)\..*$/, '\1') %>