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

Function sentinelCallClientReconfScript

src/sentinel.cpp:1033–1044  ·  view source on GitHub ↗

This function calls, if any, the client reconfiguration script with the * following parameters: * * * * It is called every time a failover is performed. * * is currently always "failover". * is either "leader" or "observer". * * from/to fields are respectively master -> promoted slave addresses for * "st

Source from the content-addressed store, hash-verified

1031 * from/to fields are respectively master -> promoted slave addresses for
1032 * "start" and "end". */
1033void sentinelCallClientReconfScript(sentinelRedisInstance *master, int role, const char *state, sentinelAddr *from, sentinelAddr *to) {
1034 char fromport[32], toport[32];
1035
1036 if (master->client_reconfig_script == NULL) return;
1037 ll2string(fromport,sizeof(fromport),from->port);
1038 ll2string(toport,sizeof(toport),to->port);
1039 sentinelScheduleScriptExecution(master->client_reconfig_script,
1040 master->name,
1041 (role == SENTINEL_LEADER) ? "leader" : "observer",
1042 state, announceSentinelAddr(from), fromport,
1043 announceSentinelAddr(to), toport, NULL);
1044}
1045
1046/* =============================== instanceLink ============================= */
1047

Callers 2

Calls 3

ll2stringFunction · 0.85
announceSentinelAddrFunction · 0.85

Tested by

no test coverage detected