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

Function clusterUpdateMyselfFlags

app/redis-6.2.6/src/cluster.c:467–477  ·  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

465 * that may change at runtime via CONFIG SET. This function changes the
466 * set of flags in myself->flags accordingly. */
467void clusterUpdateMyselfFlags(void) {
468 int oldflags = myself->flags;
469 int nofailover = server.cluster_slave_no_failover ?
470 CLUSTER_NODE_NOFAILOVER : 0;
471 myself->flags &= ~CLUSTER_NODE_NOFAILOVER;
472 myself->flags |= nofailover;
473 if (myself->flags != oldflags) {
474 clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
475 CLUSTER_TODO_UPDATE_STATE);
476 }
477}
478
479void clusterInit(void) {
480 int saveconf = 0;

Callers 2

clusterInitFunction · 0.85
clusterCronFunction · 0.85

Calls 1

clusterDoBeforeSleepFunction · 0.85

Tested by

no test coverage detected