Unverified Commit 09f9e4b0 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #6600 from oranagra/5_module_flags

module documentation mismatches: loading and fork child for 5.0 branch
parents 7a7fbe70 8d8d68dd
...@@ -1518,6 +1518,8 @@ int RM_GetSelectedDb(RedisModuleCtx *ctx) { ...@@ -1518,6 +1518,8 @@ int RM_GetSelectedDb(RedisModuleCtx *ctx) {
* * REDISMODULE_CTX_FLAGS_OOM_WARNING: Less than 25% of memory remains before * * REDISMODULE_CTX_FLAGS_OOM_WARNING: Less than 25% of memory remains before
* reaching the maxmemory level. * reaching the maxmemory level.
* *
* * REDISMODULE_CTX_FLAGS_LOADING: Server is loading RDB/AOF
*
* * REDISMODULE_CTX_FLAGS_REPLICA_IS_STALE: No active link with the master. * * REDISMODULE_CTX_FLAGS_REPLICA_IS_STALE: No active link with the master.
* *
* * REDISMODULE_CTX_FLAGS_REPLICA_IS_CONNECTING: The replica is trying to * * REDISMODULE_CTX_FLAGS_REPLICA_IS_CONNECTING: The replica is trying to
...@@ -1596,6 +1598,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) { ...@@ -1596,6 +1598,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
if (retval == C_ERR) flags |= REDISMODULE_CTX_FLAGS_OOM; if (retval == C_ERR) flags |= REDISMODULE_CTX_FLAGS_OOM;
if (level > 0.75) flags |= REDISMODULE_CTX_FLAGS_OOM_WARNING; if (level > 0.75) flags |= REDISMODULE_CTX_FLAGS_OOM_WARNING;
/* Presence of children processes. */
if (hasActiveChildProcess()) flags |= REDISMODULE_CTX_FLAGS_ACTIVE_CHILD;
return flags; return flags;
} }
......
...@@ -779,6 +779,11 @@ void updateDictResizePolicy(void) { ...@@ -779,6 +779,11 @@ void updateDictResizePolicy(void) {
dictDisableResize(); dictDisableResize();
} }
int hasActiveChildProcess() {
return server.rdb_child_pid != -1 ||
server.aof_child_pid != -1;
}
/* ======================= Cron: called every 100 ms ======================== */ /* ======================= Cron: called every 100 ms ======================== */
/* Add a sample to the operations per second array of samples. */ /* Add a sample to the operations per second array of samples. */
......
...@@ -1653,6 +1653,7 @@ void openChildInfoPipe(void); ...@@ -1653,6 +1653,7 @@ void openChildInfoPipe(void);
void closeChildInfoPipe(void); void closeChildInfoPipe(void);
void sendChildInfo(int process_type); void sendChildInfo(int process_type);
void receiveChildInfo(void); void receiveChildInfo(void);
int hasActiveChildProcess();
/* Sorted sets data type */ /* Sorted sets data type */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment