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

Function clusterUpdateMyselfFlags

src/cluster.cpp:482–492  ·  view source on GitHub ↗

Some flags (currently just the NOFAILOVER flag) may need to be updated * in the "myself" node based on the current configuration of the node, * that may change at runtime via CONFIG SET. This function changes the * set of flags in myself->flags accordingly. */

Source from the content-addressed store, hash-verified

480 * that may change at runtime via CONFIG SET. This function changes the
481 * set of flags in myself->flags accordingly. */
482void clusterUpdateMyselfFlags(void) {
483 int oldflags = myself->flags;
484 int nofailover = g_pserver->cluster_slave_no_failover ?
485 CLUSTER_NODE_NOFAILOVER : 0;
486 myself->flags &= ~CLUSTER_NODE_NOFAILOVER;
487 myself->flags |= nofailover;
488 if (myself->flags != oldflags) {
489 clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
490 CLUSTER_TODO_UPDATE_STATE);
491 }
492}
493
494void clusterInit(void) {
495 int saveconf = 0;

Callers 2

clusterInitFunction · 0.85
clusterCronFunction · 0.85

Calls 1

clusterDoBeforeSleepFunction · 0.85

Tested by

no test coverage detected