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

Function validateConfiguration

src/server.cpp:7400–7417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7398}
7399
7400static void validateConfiguration()
7401{
7402 updateMasterAuth();
7403
7404 if (cserver.cthreads > (int)std::thread::hardware_concurrency()) {
7405 serverLog(LL_WARNING, "WARNING: server-threads is greater than this machine's core count. Truncating to %u threads", std::thread::hardware_concurrency());
7406 cserver.cthreads = (int)std::thread::hardware_concurrency();
7407 cserver.cthreads = std::max(cserver.cthreads, 1); // in case of any weird sign overflows
7408 }
7409
7410 if (g_pserver->enable_multimaster && !g_pserver->fActiveReplica) {
7411 serverLog(LL_WARNING, "ERROR: Multi Master requires active replication to be enabled.");
7412 serverLog(LL_WARNING, "\tKeyDB will now exit. Please update your configuration file.");
7413 exit(EXIT_FAILURE);
7414 }
7415
7416 g_pserver->repl_backlog_size = g_pserver->repl_backlog_config_size; // this is normally set in the update logic, but not on initial config
7417}
7418
7419int iAmMaster(void) {
7420 return ((!g_pserver->cluster_enabled && (listLength(g_pserver->masters) == 0 || g_pserver->fActiveReplica)) ||

Callers 1

mainFunction · 0.85

Calls 2

updateMasterAuthFunction · 0.85
serverLogFunction · 0.85

Tested by

no test coverage detected