mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
set module eviction context flag only in masters (#8631)
REDISMODULE_CTX_FLAGS_EVICT and REDISMODULE_CTX_FLAGS_MAXMEMORY shouldn't be set when the module is run inside a replica that doesn't do eviction. one may argue that the database is under eviction (the master does eviction and sends DELs to the replica). but on the other hand, we don't really know the master's configuration. all that matters is if the current instance does evictions or not.
This commit is contained in:
parent
df5f543b65
commit
40d555dbb7
@ -2084,7 +2084,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
|
||||
flags |= REDISMODULE_CTX_FLAGS_LOADING;
|
||||
|
||||
/* Maxmemory and eviction policy */
|
||||
if (server.maxmemory > 0) {
|
||||
if (server.maxmemory > 0 && (!server.masterhost || !server.repl_slave_ignore_maxmemory)) {
|
||||
flags |= REDISMODULE_CTX_FLAGS_MAXMEMORY;
|
||||
|
||||
if (server.maxmemory_policy != MAXMEMORY_NO_EVICTION)
|
||||
|
Loading…
Reference in New Issue
Block a user