• A
    PSYNC: don't use the client buffer to send +CONTINUE and +FULLRESYNC. · 4fe7672d
    antirez 提交于
    When we are preparing an handshake with the slave we can't touch the
    connection buffer as it'll be used to accumulate differences between
    the sent RDB file and what arrives next from clients.
    
    So in short we can't use addReply() family functions.
    
    However we just use write(2) because we know that the socket buffer is
    empty, since a prerequisite for SYNC to work is that the static buffer
    and the output list are empty, and in general it is not expected that a
    client SYNCs after doing some heavy I/O with the master.
    
    However a short write connection is explicitly handled to avoid
    fragility (we simply close the connection and the slave will retry).
    4fe7672d
replication.c 54.0 KB