Search code examples
redisdumpslave

Configure Redis slave to stop saving data to file


Can I configure Redis slave to stop saving dumps? I have omitted all save instructions in config file but slave is still doing dumps.


Solution

  • So I assume you have checked in the configuration file of the slave that RDB is deactivated (all save lines commented out), and the slave has been restarted after the configuration file has been changed (so this configuration is active).

    At this point the background dump operation of the slave is deactivated, but it does not prevent the slave to write a dump file. Actually, the slave has to write a dump file at startup time: this is how it retrieves the data from the master in bulk mode.

    When the slave starts, it sends a SYNC request to the master:

    • The master starts accumulating Redis commands.
    • The master performs a background dump
    • The master sends the dump file to the slave in bulk mode
    • The slave reads the dump file from the master and write it to the disk
    • When it is complete, the slave loads the dump file from the disk
    • The slave starts processing Redis commands accumulated by the master
    • Eventually, the slave will catch up
    • The slave is in sync with the master

    That's why you can find dump files on slave side even if RDB is deactivated for the slaves.