MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelCallClientReconfScript

Function sentinelCallClientReconfScript

app/redis-6.2.6/src/sentinel.c:1027–1038  ·  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

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

Callers 2

Calls 3

ll2stringFunction · 0.85
announceSentinelAddrFunction · 0.85

Tested by

no test coverage detected