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

Function sentinelCheckCreateInstanceErrors

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

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

Callers 2

sentinelCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected