Lines Matching refs:flags
164 int flags; /* See SRI_... defines */ member
248 int flags; /* Script job flags: SENTINEL_SCRIPT_* */ member
590 sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ? in sentinelEvent()
630 sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ? in sentinelEvent()
684 sj->flags = SENTINEL_SCRIPT_NONE; in sentinelScheduleScriptExecution()
702 if (sj->flags & SENTINEL_SCRIPT_RUNNING) continue; in sentinelScheduleScriptExecution()
723 if ((sj->flags & SENTINEL_SCRIPT_RUNNING) && sj->pid == pid) in sentinelGetScriptListNodeByPid()
746 if (sj->flags & SENTINEL_SCRIPT_RUNNING) continue; in sentinelRunPendingScripts()
751 sj->flags |= SENTINEL_SCRIPT_RUNNING; in sentinelRunPendingScripts()
762 sj->flags &= ~SENTINEL_SCRIPT_RUNNING; in sentinelRunPendingScripts()
822 sj->flags &= ~SENTINEL_SCRIPT_RUNNING; in sentinelCollectTerminatedScripts()
851 if (sj->flags & SENTINEL_SCRIPT_RUNNING && in sentinelKillTimedoutScripts()
882 (sj->flags & SENTINEL_SCRIPT_RUNNING) ? "running" : "scheduled"); in sentinelPendingScriptsCommand()
887 if (sj->flags & SENTINEL_SCRIPT_RUNNING) { in sentinelPendingScriptsCommand()
1019 serverAssert(ri->flags & SRI_SENTINEL); in sentinelTryConnectionSharing()
1055 serverAssert(ri->flags & SRI_SENTINEL); in sentinelUpdateSentinelAddressInAllMasters()
1145 sentinelRedisInstance *createSentinelRedisInstance(char *name, int flags, char *hostname, int port,… in createSentinelRedisInstance() argument
1151 serverAssert(flags & (SRI_MASTER|SRI_SLAVE|SRI_SENTINEL)); in createSentinelRedisInstance()
1152 serverAssert((flags & SRI_MASTER) || master != NULL); in createSentinelRedisInstance()
1159 if (flags & SRI_SLAVE) { in createSentinelRedisInstance()
1168 if (flags & SRI_MASTER) table = sentinel.masters; in createSentinelRedisInstance()
1169 else if (flags & SRI_SLAVE) table = master->slaves; in createSentinelRedisInstance()
1170 else if (flags & SRI_SENTINEL) table = master->sentinels; in createSentinelRedisInstance()
1183 ri->flags = flags; in createSentinelRedisInstance()
1226 ri->role_reported = ri->flags & (SRI_MASTER|SRI_SLAVE); in createSentinelRedisInstance()
1259 if ((ri->flags & SRI_SLAVE) && (ri->flags & SRI_PROMOTED) && ri->master) in releaseSentinelRedisInstance()
1273 serverAssert(ri->flags & SRI_MASTER); in sentinelRedisInstanceLookupSlave()
1283 if (ri->flags & SRI_MASTER) return "master"; in sentinelRedisInstanceTypeStr()
1284 else if (ri->flags & SRI_SLAVE) return "slave"; in sentinelRedisInstanceTypeStr()
1285 else if (ri->flags & SRI_SENTINEL) return "sentinel"; in sentinelRedisInstanceTypeStr()
1360 void sentinelAddFlagsToDictOfRedisInstances(dict *instances, int flags) { in sentinelAddFlagsToDictOfRedisInstances() argument
1367 ri->flags |= flags; in sentinelAddFlagsToDictOfRedisInstances()
1374 void sentinelDelFlagsToDictOfRedisInstances(dict *instances, int flags) { in sentinelDelFlagsToDictOfRedisInstances() argument
1381 ri->flags &= ~flags; in sentinelDelFlagsToDictOfRedisInstances()
1398 void sentinelResetMaster(sentinelRedisInstance *ri, int flags) { in sentinelResetMaster() argument
1399 serverAssert(ri->flags & SRI_MASTER); in sentinelResetMaster()
1402 if (!(flags & SENTINEL_RESET_NO_SENTINELS)) { in sentinelResetMaster()
1408 ri->flags &= SRI_MASTER; in sentinelResetMaster()
1427 if (flags & SENTINEL_GENERATE_EVENT) in sentinelResetMaster()
1433 int sentinelResetMastersByPattern(char *pattern, int flags) { in sentinelResetMastersByPattern() argument
1444 sentinelResetMaster(ri,flags); in sentinelResetMastersByPattern()
1536 if ((master->flags & SRI_FAILOVER_IN_PROGRESS) && in sentinelGetCurrentMasterAddress()
1565 if (ri->flags & SRI_MASTER) return "master"; in sentinelGetInstanceTypeString()
1566 else if (ri->flags & SRI_SLAVE) return "slave"; in sentinelGetInstanceTypeString()
1567 else if (ri->flags & SRI_SENTINEL) return "sentinel"; in sentinelGetInstanceTypeString()
1874 char *auth_pass = (ri->flags & SRI_MASTER) ? ri->auth_pass : in sentinelSendAuthIfNeeded()
1936 if ((ri->flags & (SRI_MASTER|SRI_SLAVE)) && link->pc == NULL) { in sentinelReconnectInstance()
1968 if (link->cc && (ri->flags & SRI_SENTINEL || link->pc)) in sentinelReconnectInstance()
1981 master->flags & SRI_MASTER && in sentinelMasterLooksSane()
1983 (master->flags & (SRI_S_DOWN|SRI_O_DOWN)) == 0 && in sentinelMasterLooksSane()
2022 if ((ri->flags & SRI_MASTER) && in sentinelRefreshInstanceInfo()
2125 ((ri->flags & (SRI_MASTER|SRI_SLAVE)) == role) ? in sentinelRefreshInstanceInfo()
2129 ri->flags & SRI_MASTER ? "master" : "slave"); in sentinelRefreshInstanceInfo()
2137 if ((ri->flags & SRI_MASTER) && role == SRI_SLAVE) { in sentinelRefreshInstanceInfo()
2144 if ((ri->flags & SRI_SLAVE) && role == SRI_MASTER) { in sentinelRefreshInstanceInfo()
2147 if ((ri->flags & SRI_PROMOTED) && in sentinelRefreshInstanceInfo()
2148 (ri->master->flags & SRI_FAILOVER_IN_PROGRESS) && in sentinelRefreshInstanceInfo()
2176 if (!(ri->flags & SRI_PROMOTED) && in sentinelRefreshInstanceInfo()
2191 if ((ri->flags & SRI_SLAVE) && in sentinelRefreshInstanceInfo()
2214 if ((ri->flags & SRI_SLAVE) && role == SRI_SLAVE && in sentinelRefreshInstanceInfo()
2215 (ri->flags & (SRI_RECONF_SENT|SRI_RECONF_INPROG))) in sentinelRefreshInstanceInfo()
2218 if ((ri->flags & SRI_RECONF_SENT) && in sentinelRefreshInstanceInfo()
2224 ri->flags &= ~SRI_RECONF_SENT; in sentinelRefreshInstanceInfo()
2225 ri->flags |= SRI_RECONF_INPROG; in sentinelRefreshInstanceInfo()
2230 if ((ri->flags & SRI_RECONF_INPROG) && in sentinelRefreshInstanceInfo()
2233 ri->flags &= ~SRI_RECONF_INPROG; in sentinelRefreshInstanceInfo()
2234 ri->flags |= SRI_RECONF_DONE; in sentinelRefreshInstanceInfo()
2286 (ri->flags & SRI_S_DOWN) && in sentinelPingReplyCallback()
2287 !(ri->flags & SRI_SCRIPT_KILL_SENT)) in sentinelPingReplyCallback()
2293 ri->flags |= SRI_SCRIPT_KILL_SENT; in sentinelPingReplyCallback()
2471 sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ? ri : ri->master; in sentinelSendHello()
2529 if (!(master->flags & SRI_MASTER)) return C_ERR; in sentinelForceHelloUpdateForMaster()
2587 if ((ri->flags & SRI_SLAVE) && in sentinelSendPeriodicCommands()
2588 ((ri->master->flags & (SRI_O_DOWN|SRI_FAILOVER_IN_PROGRESS)) || in sentinelSendPeriodicCommands()
2602 if ((ri->flags & SRI_SENTINEL) == 0 && in sentinelSendPeriodicCommands()
2637 char *flags = sdsempty(); in addReplySentinelRedisInstance() local
2660 if (ri->flags & SRI_S_DOWN) flags = sdscat(flags,"s_down,"); in addReplySentinelRedisInstance()
2661 if (ri->flags & SRI_O_DOWN) flags = sdscat(flags,"o_down,"); in addReplySentinelRedisInstance()
2662 if (ri->flags & SRI_MASTER) flags = sdscat(flags,"master,"); in addReplySentinelRedisInstance()
2663 if (ri->flags & SRI_SLAVE) flags = sdscat(flags,"slave,"); in addReplySentinelRedisInstance()
2664 if (ri->flags & SRI_SENTINEL) flags = sdscat(flags,"sentinel,"); in addReplySentinelRedisInstance()
2665 if (ri->link->disconnected) flags = sdscat(flags,"disconnected,"); in addReplySentinelRedisInstance()
2666 if (ri->flags & SRI_MASTER_DOWN) flags = sdscat(flags,"master_down,"); in addReplySentinelRedisInstance()
2667 if (ri->flags & SRI_FAILOVER_IN_PROGRESS) in addReplySentinelRedisInstance()
2668 flags = sdscat(flags,"failover_in_progress,"); in addReplySentinelRedisInstance()
2669 if (ri->flags & SRI_PROMOTED) flags = sdscat(flags,"promoted,"); in addReplySentinelRedisInstance()
2670 if (ri->flags & SRI_RECONF_SENT) flags = sdscat(flags,"reconf_sent,"); in addReplySentinelRedisInstance()
2671 if (ri->flags & SRI_RECONF_INPROG) flags = sdscat(flags,"reconf_inprog,"); in addReplySentinelRedisInstance()
2672 if (ri->flags & SRI_RECONF_DONE) flags = sdscat(flags,"reconf_done,"); in addReplySentinelRedisInstance()
2674 if (sdslen(flags) != 0) sdsrange(flags,0,-2); /* remove last "," */ in addReplySentinelRedisInstance()
2675 addReplyBulkCString(c,flags); in addReplySentinelRedisInstance()
2676 sdsfree(flags); in addReplySentinelRedisInstance()
2687 if (ri->flags & SRI_FAILOVER_IN_PROGRESS) { in addReplySentinelRedisInstance()
2706 if (ri->flags & SRI_S_DOWN) { in addReplySentinelRedisInstance()
2712 if (ri->flags & SRI_O_DOWN) { in addReplySentinelRedisInstance()
2723 if (ri->flags & (SRI_MASTER|SRI_SLAVE)) { in addReplySentinelRedisInstance()
2739 if (ri->flags & SRI_MASTER) { in addReplySentinelRedisInstance()
2778 if (ri->flags & SRI_SLAVE) { in addReplySentinelRedisInstance()
2808 if (ri->flags & SRI_SENTINEL) { in addReplySentinelRedisInstance()
2871 if (ri->flags & (SRI_S_DOWN|SRI_O_DOWN)) continue; in sentinelIsQuorumReachable()
2946 if (!sentinel.tilt && ri && (ri->flags & SRI_S_DOWN) && in sentinelCommand()
2947 (ri->flags & SRI_MASTER)) in sentinelCommand()
2952 if (ri && ri->flags & SRI_MASTER && strcasecmp(c->argv[5]->ptr,"*")) { in sentinelCommand()
2991 if (ri->flags & SRI_FAILOVER_IN_PROGRESS) { in sentinelCommand()
3002 ri->flags |= SRI_FORCE_FAILOVER; in sentinelCommand()
3258 if (ri->flags & SRI_O_DOWN) status = "odown"; in sentinelInfoCommand()
3259 else if (ri->flags & SRI_S_DOWN) status = "sdown"; in sentinelInfoCommand()
3445 (ri->flags & SRI_MASTER && in sentinelCheckSubjectivelyDown()
3451 if ((ri->flags & SRI_S_DOWN) == 0) { in sentinelCheckSubjectivelyDown()
3454 ri->flags |= SRI_S_DOWN; in sentinelCheckSubjectivelyDown()
3458 if (ri->flags & SRI_S_DOWN) { in sentinelCheckSubjectivelyDown()
3460 ri->flags &= ~(SRI_S_DOWN|SRI_SCRIPT_KILL_SENT); in sentinelCheckSubjectivelyDown()
3476 if (master->flags & SRI_S_DOWN) { in sentinelCheckObjectivelyDown()
3484 if (ri->flags & SRI_MASTER_DOWN) quorum++; in sentinelCheckObjectivelyDown()
3492 if ((master->flags & SRI_O_DOWN) == 0) { in sentinelCheckObjectivelyDown()
3495 master->flags |= SRI_O_DOWN; in sentinelCheckObjectivelyDown()
3499 if (master->flags & SRI_O_DOWN) { in sentinelCheckObjectivelyDown()
3501 master->flags &= ~SRI_O_DOWN; in sentinelCheckObjectivelyDown()
3527 ri->flags |= SRI_MASTER_DOWN; in sentinelReceiveIsMasterDownReply()
3529 ri->flags &= ~SRI_MASTER_DOWN; in sentinelReceiveIsMasterDownReply()
3551 void sentinelAskMasterStateToOtherSentinels(sentinelRedisInstance *master, int flags) { in sentinelAskMasterStateToOtherSentinels() argument
3564 ri->flags &= ~SRI_MASTER_DOWN; in sentinelAskMasterStateToOtherSentinels()
3574 if ((master->flags & SRI_S_DOWN) == 0) continue; in sentinelAskMasterStateToOtherSentinels()
3576 if (!(flags & SENTINEL_ASK_FORCED) && in sentinelAskMasterStateToOtherSentinels()
3674 serverAssert(master->flags & (SRI_O_DOWN|SRI_FAILOVER_IN_PROGRESS)); in sentinelGetLeader()
3797 serverAssert(master->flags & SRI_MASTER); in sentinelStartFailover()
3800 master->flags |= SRI_FAILOVER_IN_PROGRESS; in sentinelStartFailover()
3822 if (!(master->flags & SRI_O_DOWN)) return 0; in sentinelStartFailoverIfNeeded()
3825 if (master->flags & SRI_FAILOVER_IN_PROGRESS) return 0; in sentinelStartFailoverIfNeeded()
3919 if (master->flags & SRI_S_DOWN) in sentinelSelectSlave()
3928 if (slave->flags & (SRI_S_DOWN|SRI_O_DOWN)) continue; in sentinelSelectSlave()
3936 if (master->flags & SRI_S_DOWN) in sentinelSelectSlave()
3966 if (!isleader && !(ri->flags & SRI_FORCE_FAILOVER)) { in sentinelFailoverWaitStart()
3998 slave->flags |= SRI_PROMOTED; in sentinelFailoverSelectSlave()
4053 master->promoted_slave->flags & SRI_S_DOWN) return; in sentinelFailoverDetectEnd()
4061 if (slave->flags & (SRI_PROMOTED|SRI_RECONF_DONE)) continue; in sentinelFailoverDetectEnd()
4062 if (slave->flags & SRI_S_DOWN) continue; in sentinelFailoverDetectEnd()
4092 if (slave->flags & (SRI_RECONF_DONE|SRI_RECONF_SENT)) continue; in sentinelFailoverDetectEnd()
4100 slave->flags |= SRI_RECONF_SENT; in sentinelFailoverDetectEnd()
4118 if (slave->flags & (SRI_RECONF_SENT|SRI_RECONF_INPROG)) in sentinelFailoverReconfNextSlave()
4131 if (slave->flags & (SRI_PROMOTED|SRI_RECONF_DONE)) continue; in sentinelFailoverReconfNextSlave()
4137 if ((slave->flags & SRI_RECONF_SENT) && in sentinelFailoverReconfNextSlave()
4142 slave->flags &= ~SRI_RECONF_SENT; in sentinelFailoverReconfNextSlave()
4143 slave->flags |= SRI_RECONF_DONE; in sentinelFailoverReconfNextSlave()
4148 if (slave->flags & (SRI_RECONF_SENT|SRI_RECONF_INPROG)) continue; in sentinelFailoverReconfNextSlave()
4156 slave->flags |= SRI_RECONF_SENT; in sentinelFailoverReconfNextSlave()
4183 serverAssert(ri->flags & SRI_MASTER); in sentinelFailoverStateMachine()
4185 if (!(ri->flags & SRI_FAILOVER_IN_PROGRESS)) return; in sentinelFailoverStateMachine()
4212 serverAssert(ri->flags & SRI_FAILOVER_IN_PROGRESS); in sentinelAbortFailover()
4215 ri->flags &= ~(SRI_FAILOVER_IN_PROGRESS|SRI_FORCE_FAILOVER); in sentinelAbortFailover()
4219 ri->promoted_slave->flags &= ~SRI_PROMOTED; in sentinelAbortFailover()
4250 if (ri->flags & (SRI_MASTER|SRI_SLAVE)) { in sentinelHandleRedisInstance()
4255 if (ri->flags & SRI_MASTER) { in sentinelHandleRedisInstance()
4277 if (ri->flags & SRI_MASTER) { in sentinelHandleDictOfRedisInstances()