Skip to content

Instantly share code, notes, and snippets.

# Imported old TTYtter config for oysttyer.
# Now using OAuth, with key in .ttytterkey
ansi=1
ssl=1
vcheck=1
# Not needed with the streaming API.
# mentions=1
verify=1
dostream=1
oysttyer(13252,0x7fff7e679000) malloc: *** error for object 0x7fef3cb0f228: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

#Remastering MySQL Replicas

The scenario here is that we have two replicas, A and B, which both share a master M. We want to make B a replica of A, so that the replication chain goes M > A > B. A prerequesite is that A needs to have binary logging enabled with log_slave_updates turned on, and A should not be receiving any local writes other than from replication.

In order to achieve the switch we need to have a single point in time at which we know both A's replicaton position relative to the master M, and A's own binary log position. Then we need to make B reach the exact same position relative to the master, at which point we can change master to point at the corresponding coordinates on A.

This procedure involves stopping and restarting replication on both replicas; very briefly on A, but a couple of times on B. It shouldn't be performed on hosts that are especially sensitive to replication delay. However even when carrying out this process by hand the delay shouldn't exceed more than a few minutes,

@johndalton
johndalton / replication_shuffle.md
Last active November 12, 2017 11:41
Doing the Replication Shuffle

Doing the Replication Shuffle

Here's the scenario. You have three hosts, a master (M) and two replicas (R and S).o

    M
   / \
  R   S

You want to move the replica S so that its master is R, like so: