Move clusterBeforeSleep before blockedBeforeSleep (#12343)
The new blockedBeforeSleep was added in #12337, it breaks the order in 2ecb5ed. This may be related to #2288, quoted from comment in #2288: ``` Moreover the clusterBeforeSleep() call was misplaced at the end of the chain of the beforeSleep() call in redis.c. It should be at the top, before processing un blocking clients. This is exactly the reason in the specific instance of the bug as reported, why the state was not updated in time before clients served. ```
This commit is contained in:
parent
153f8f082e
commit
9600553ef2
12
src/server.c
12
src/server.c
@ -1657,6 +1657,12 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
||||
/* If any connection type(typical TLS) still has pending unread data don't sleep at all. */
|
||||
aeSetDontWait(server.el, connTypeHasPendingData());
|
||||
|
||||
/* Call the Redis Cluster before sleep function. Note that this function
|
||||
* may change the state of Redis Cluster (from ok to fail or vice versa),
|
||||
* so it's a good idea to call it before serving the unblocked clients
|
||||
* later in this function, must be done before blockedBeforeSleep. */
|
||||
if (server.cluster_enabled) clusterBeforeSleep();
|
||||
|
||||
/* Handle blocked clients.
|
||||
* must be done before flushAppendOnlyFile, in case of appendfsync=always,
|
||||
* since the unblocked clients may write data. */
|
||||
@ -1667,12 +1673,6 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
||||
* sets of metrics. */
|
||||
monotime cron_start_time_before_aof = getMonotonicUs();
|
||||
|
||||
/* Call the Redis Cluster before sleep function. Note that this function
|
||||
* may change the state of Redis Cluster (from ok to fail or vice versa),
|
||||
* so it's a good idea to call it before serving the unblocked clients
|
||||
* later in this function. */
|
||||
if (server.cluster_enabled) clusterBeforeSleep();
|
||||
|
||||
/* Run a fast expire cycle (the called function will return
|
||||
* ASAP if a fast cycle is not needed). */
|
||||
if (server.active_expire_enabled && iAmMaster())
|
||||
|
Loading…
x
Reference in New Issue
Block a user