Skip to content

Commit

Permalink
Do the invalidate in clusterDoBeforeSleep
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed May 29, 2024
1 parent db9f16f commit 1513a9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ void clusterSaveConfigOrDie(int do_fsync) {
serverLog(LL_WARNING, "Fatal: can't update cluster config file.");
exit(1);
}
clearCachedClusterSlotsResponse();
}

/* Lock the cluster config using flock(), and retain the file descriptor used to
Expand Down Expand Up @@ -4847,6 +4846,9 @@ void clusterBeforeSleep(void) {
}

void clusterDoBeforeSleep(int flags) {
/* Clear the cache if there are config changes here. */
if (flags & CLUSTER_TODO_SAVE_CONFIG) clearCachedClusterSlotsResponse();

server.cluster->todo_before_sleep |= flags;
}

Expand Down
1 change: 0 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,6 @@ static int updateClusterIp(const char **err) {
int updateClusterHostname(const char **err) {
UNUSED(err);
clusterUpdateMyselfHostname();
clearCachedClusterSlotsResponse();
return 1;
}

Expand Down

0 comments on commit 1513a9b

Please sign in to comment.