Generalise handling create instance error. Use SRI_MASTER, SRI_SLAVE or * SRI_SENTINEL as a role value. */
| 1746 | /* Generalise handling create instance error. Use SRI_MASTER, SRI_SLAVE or |
| 1747 | * SRI_SENTINEL as a role value. */ |
| 1748 | const 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 */ |
| 1773 | void initializeSentinelConfig() { |
no outgoing calls
no test coverage detected