Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2ccb9263
Commit
2ccb9263
authored
Apr 25, 2021
by
Istemi Ekin Akkus
Committed by
Oran Agra
May 03, 2021
Browse files
Modules: Fix RM_GetClusterNodeInfo() to correctly populate the master_id (#8846)
(cherry picked from commit
af035c1e
)
parent
6384fe34
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
2ccb9263
...
@@ -6168,7 +6168,7 @@ int RM_GetClusterNodeInfo(RedisModuleCtx *ctx, const char *id, char *ip, char *m
...
@@ -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
/* 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
* field to zero bytes, so that when the field can't be populated the
* function kinda remains predictable. */
* 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
);
memcpy
(
master_id
,
node
->
slaveof
->
name
,
REDISMODULE_NODE_ID_LEN
);
else
else
memset
(
master_id
,
0
,
REDISMODULE_NODE_ID_LEN
);
memset
(
master_id
,
0
,
REDISMODULE_NODE_ID_LEN
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment