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

Function sentinelCheckCreateInstanceErrors

src/sentinel.cpp:1754–1775  ·  view source on GitHub ↗

Generalise handling create instance error. Use SRI_MASTER, SRI_SLAVE or * SRI_SENTINEL as a role value. */

Source from the content-addressed store, hash-verified

1752/* Generalise handling create instance error. Use SRI_MASTER, SRI_SLAVE or
1753 * SRI_SENTINEL as a role value. */
1754const char *sentinelCheckCreateInstanceErrors(int role) {
1755 switch(errno) {
1756 case EBUSY:
1757 switch (role) {
1758 case SRI_MASTER:
1759 return "Duplicate master name.";
1760 case SRI_SLAVE:
1761 return "Duplicate hostname and port for replica.";
1762 case SRI_SENTINEL:
1763 return "Duplicate runid for sentinel.";
1764 default:
1765 serverAssert(0);
1766 break;
1767 }
1768 break;
1769 case ENOENT:
1770 return "Can't resolve instance hostname.";
1771 case EINVAL:
1772 return "Invalid port number.";
1773 }
1774 return "Unknown Error for creating instances.";
1775}
1776
1777/* init function for g_pserver->sentinel_config */
1778void initializeSentinelConfig() {

Callers 2

sentinelCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected