Multimaster requires Active Replication
Former-commit-id: 4d4eca54336c73848ffa36cb1778b7c853f77f7f
This commit is contained in:
parent
6eadfd5d34
commit
f12d664374
@ -5032,6 +5032,21 @@ void *workerThreadMain(void *parg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void validateConfiguration()
|
||||||
|
{
|
||||||
|
if (cserver.cthreads > (int)std::thread::hardware_concurrency()) {
|
||||||
|
serverLog(LL_WARNING, "WARNING: server-threads is greater than this machine's core count. Truncating to %u threads", std::thread::hardware_concurrency());
|
||||||
|
cserver.cthreads = (int)std::thread::hardware_concurrency();
|
||||||
|
cserver.cthreads = std::max(cserver.cthreads, 1); // in case of any weird sign overflows
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_pserver->enable_multimaster && !g_pserver->fActiveReplica) {
|
||||||
|
serverLog(LL_WARNING, "ERROR: Multi Master requires active replication to be enabled.");
|
||||||
|
serverLog(LL_WARNING, "\tKeyDB will now exit. Please update your configuration file.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int j;
|
int j;
|
||||||
@ -5204,11 +5219,7 @@ int main(int argc, char **argv) {
|
|||||||
serverLog(LL_WARNING, "Configuration loaded");
|
serverLog(LL_WARNING, "Configuration loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cserver.cthreads > (int)std::thread::hardware_concurrency()) {
|
validateConfiguration();
|
||||||
serverLog(LL_WARNING, "WARNING: server-threads is greater than this machine's core count. Truncating to %u threads", std::thread::hardware_concurrency());
|
|
||||||
cserver.cthreads = (int)std::thread::hardware_concurrency();
|
|
||||||
cserver.cthreads = std::max(cserver.cthreads, 1); // in case of any weird sign overflows
|
|
||||||
}
|
|
||||||
|
|
||||||
cserver.supervised = redisIsSupervised(cserver.supervised_mode);
|
cserver.supervised = redisIsSupervised(cserver.supervised_mode);
|
||||||
int background = cserver.daemonize && !cserver.supervised;
|
int background = cserver.daemonize && !cserver.supervised;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user