Skip to content

Commit

Permalink
Update src/cluster_legacy.c
Browse files Browse the repository at this point in the history
Co-authored-by: Ping Xie <pingxie@outlook.com>
Signed-off-by: Binbin <binloveplay1314@qq.com>
  • Loading branch information
enjoy-binbin and PingXie authored Aug 29, 2024
1 parent 87dcb22 commit 7788208
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3343,8 +3343,7 @@ int clusterProcessPacket(clusterLink *link) {
* so we can try a psync. */
serverLog(LL_NOTICE, "I'm a sub-replica! Reconfiguring myself as a replica of %.40s from %.40s",
myself->replicaof->replicaof->name, myself->replicaof->name);
int are_in_same_shard = areInSameShard(myself->replicaof->replicaof, myself);
clusterSetPrimary(myself->replicaof->replicaof, 1, !are_in_same_shard);
clusterSetPrimary(myself->replicaof->replicaof, 1, !areInSameShard(myself->replicaof->replicaof, myself));
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG| CLUSTER_TODO_UPDATE_STATE | CLUSTER_TODO_FSYNC_CONFIG);
}

Expand Down

0 comments on commit 7788208

Please sign in to comment.