From 2ccb9263140a383f1916e8df522e14f36aed76da Mon Sep 17 00:00:00 2001 From: Istemi Ekin Akkus <5419814+iakkus@users.noreply.github.com> Date: Sun, 25 Apr 2021 09:05:12 +0200 Subject: [PATCH] Modules: Fix RM_GetClusterNodeInfo() to correctly populate the master_id (#8846) (cherry picked from commit af035c1e1d3bcaf662051cff4dc49f6051321c9c) --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index 05bf3a275..727cdc43f 100644 --- a/src/module.c +++ b/src/module.c @@ -6168,7 +6168,7 @@ int RM_GetClusterNodeInfo(RedisModuleCtx *ctx, const char *id, char *ip, char *m /* If the information is not available, the function will set the * field to zero bytes, so that when the field can't be populated the * function kinda remains predictable. */ - if (node->flags & CLUSTER_NODE_MASTER && node->slaveof) + if (node->flags & CLUSTER_NODE_SLAVE && node->slaveof) memcpy(master_id,node->slaveof->name,REDISMODULE_NODE_ID_LEN); else memset(master_id,0,REDISMODULE_NODE_ID_LEN);