MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / changeReplicationId

Function changeReplicationId

src/replication.cpp:2267–2271  ·  view source on GitHub ↗

Change the current instance replication ID with a new, random one. * This will prevent successful PSYNCs between this master and other * slaves, so the command should be called when something happens that * alters the current story of the dataset. */

Source from the content-addressed store, hash-verified

2265 * slaves, so the command should be called when something happens that
2266 * alters the current story of the dataset. */
2267void changeReplicationId(void) {
2268 getRandomHexChars(g_pserver->replid,CONFIG_RUN_ID_SIZE);
2269 g_pserver->replid[CONFIG_RUN_ID_SIZE] = '\0';
2270 saveMasterStatusToStorage(false);
2271}
2272
2273/* Clear (invalidate) the secondary replication ID. This happens, for
2274 * example, after a full resynchronization, when we start a new replication

Callers 5

syncCommandFunction · 0.85
shiftReplicationIdFunction · 0.85
replicationCronFunction · 0.85
initServerConfigFunction · 0.85
debugCommandFunction · 0.85

Calls 2

getRandomHexCharsFunction · 0.85

Tested by

no test coverage detected