Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
42e4241e
Unverified
Commit
42e4241e
authored
Sep 14, 2022
by
Viktor Söderqvist
Committed by
GitHub
Sep 13, 2022
Browse files
Avoid crash when a cluster node is a replica of a replica of itself (#11263)
parent
6c03786b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
42e4241e
...
@@ -1977,7 +1977,13 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc
...
@@ -1977,7 +1977,13 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc
clusterDoBeforeSleep
(
CLUSTER_TODO_SAVE_CONFIG
|
clusterDoBeforeSleep
(
CLUSTER_TODO_SAVE_CONFIG
|
CLUSTER_TODO_UPDATE_STATE
|
CLUSTER_TODO_UPDATE_STATE
|
CLUSTER_TODO_FSYNC_CONFIG
);
CLUSTER_TODO_FSYNC_CONFIG
);
}
else
if
(
myself
->
slaveof
&&
myself
->
slaveof
->
slaveof
)
{
}
else
if
(
myself
->
slaveof
&&
myself
->
slaveof
->
slaveof
&&
/* In some rare case when CLUSTER FAILOVER TAKEOVER is used, it
* can happen that myself is a replica of a replica of myself. If
* this happens, we do nothing to avoid a crash and wait for the
* admin to repair the cluster. */
myself
->
slaveof
->
slaveof
!=
myself
)
{
/* Safeguard against sub-replicas. A replica's master can turn itself
/* Safeguard against sub-replicas. A replica's master can turn itself
* into a replica if its last slot is removed. If no other node takes
* into a replica if its last slot is removed. If no other node takes
* over the slot, there is nothing else to trigger replica migration. */
* over the slot, there is nothing else to trigger replica migration. */
...
...
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