If MASTER <-> SLAVE sync will start in the middle of AOF rewrite, the child process will be killed without cleaning up temp AOF rewrite files. The only strange thing for me is the 8 seconds difference between last modification time of the file (which happened earlier) and the moment when child rewrited process has been killed (which happened later).

P.S. File's last modification matches the moment of flushing old data. Killing the child rewrite process may not be even the cause.

8031:S 16 Sep 08:45:52.050 * MASTER <-> SLAVE sync started
8031:S 16 Sep 08:45:52.050 * Non blocking connect for SYNC fired the event.
8031:S 16 Sep 08:45:52.050 * Master replied to PING, replication can continue...
8031:S 16 Sep 08:45:52.051 * Partial resynchronization not possible (no cached master)
8031:S 16 Sep 08:45:52.060 * Full resync from master: b71e54f321e7ad2c8d56a1d20197c0d43d6c54c1:2338043
8031:S 16 Sep 08:45:52.099 * MASTER <-> SLAVE sync: receiving 76 bytes from master
8031:S 16 Sep 08:45:56.084 * MASTER <-> SLAVE sync: Flushing old data
8031:S 16 Sep 08:45:58.486 * MASTER <-> SLAVE sync: Loading DB in memory
8031:S 16 Sep 08:46:03.313 * MASTER <-> SLAVE sync: Finished with success
KILL ->>> 8031:S 16 Sep 08:46:03.342 * Killing running AOF rewrite child: 20536
8031:S 16 Sep 08:46:04.098 * Background append only file rewriting started by pid 20682
-rw-r--r-- 1 redis redis 1.7G Sep 17 10:49 appendonly.aof
-rw-r--r-- 1 redis redis   76 Sep 16 08:45 dump.rdb
-rw-r--r-- 1 redis redis    0 Jul 14 20:32 temp-1468528335.2779.rdb
-rw-r--r-- 1 redis redis 937M Sep 16 08:45 temp-rewriteaof-20536.aof
$ date -r temp-rewriteaof-20536.aof 
Fri Sep 16 08:45:56 UTC 2016

Comment From: FNST-zhoush

Any progress about this problem? i met the same problem.

Comment From: yoav-steinberg

Closing as this was fixed in #5920.