antirez/redis — pull request #841 by charsyam (2012-12-20 22:03:00+00:00)
Title: Unexpected resync with master

This issue is based on "redis doesn't close replication fd", so it can call syncWithMaster with previous replication fd.

There are 2 approaches.

1] when client requests "slaveof" command
-> closeing replication fd.

2] when syncWithMaster call
-> checking fd is repl_transfer_s

and if repl_state == REDIS_REPL_CONNECTED , then redis doesn't close replication fd.