we have two redis nodes as master-slave
the memory usage is about 15g
aof rewrite will emit about everyday and it will last about 4 or 5 minutes

when in 8:30:30 the master is unavailble for about 25 seconds, all connections lost and ping timeout, we have our high available watcher which will change the master-slave role

when doing aof rewrite, there are requests(read, write) for redis master, so it is blocked and disconnected?

how to solve it ? need your feedback

master redis version 2.8.10 slave redis version 2.8.12

master log

[3216] 02 Jul 08:30:43.158 * Starting automatic rewriting of AOF on 100% growth
[3216] 02 Jul 08:30:44.142 * Background append only file rewriting started by pid 19808
[19808] 02 Jul 08:35:25.850 * SYNC append only file rewrite performed
[19808] 02 Jul 08:35:26.234 * AOF rewrite: 904 MB of memory used by copy-on-write
[3216] 02 Jul 08:35:26.846 * Background AOF rewrite terminated with success
[3216] 02 Jul 08:35:26.877 * Parent diff successfully flushed to the rewritten AOF (19875686 bytes)
[3216] 02 Jul 08:35:26.877 * Background AOF rewrite finished successfully
[3216] 02 Jul 08:35:29.082 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
[3216] 02 Jul 08:35:52.801 * SLAVE OF xxx.xxx.xxx.xxx:6379 enabled (user request)
[3216] 02 Jul 08:35:52.882 * Connecting to MASTER xxx.xxx.xxx.xxx:6379
[3216] 02 Jul 08:35:52.883 * MASTER <-> SLAVE sync started

slave log

[5368] 02 Jul 08:35:42.199 # Connection with master lost.
[5368] 02 Jul 08:35:42.199 * Caching the disconnected master state.
[5368] 02 Jul 08:35:42.200 * Discarding previously cached master state.
[5368] 02 Jul 08:35:42.200 * MASTER MODE enabled (user request)

Comment From: yoav-steinberg

Looks like a long standing fsync is blocking the master. Might have been improved in newer versions. This is an old issue so I'm closing. In general such questions should go to: * the mailing list * the redis tag at StackOverflow * /r/redis subreddit * github discussions

Comment From: oranagra

Btw we plan to properly resolve this in Redis 7.0 with something we call "multipart aof" similar to what's suggested in #6584