2 days ago
- During the first Redis developers meeting, diskless replication was identified as a high-priority feature to avoid disk usage during slave synchronization.
- In traditional replication, full resynchronization requires creating an RDB file on disk and sending it to slaves, causing disk pressure and latency issues.
- Diskless replication allows the master's child process to write RDB data directly to slave sockets without intermediate disk writes, addressing use cases with slow disks or caching environments.
- The implementation uses a rio abstraction to write to file descriptors, a random EOF marker to indicate transfer completion, and SO_SNDTIMEO for timeout handling.
- Multiple slaves can be served simultaneously by waiting a few seconds for new slaves and writing data in small chunks to each file descriptor in a loop.
- Partial failures are managed by marking failed FDs with error codes and using a pipe to report slave transfer status to the parent process.
- Diskless replication enables a fully disk-free Redis setup, leading to plans for improved support of replication without persistence.