Describe the bug

In Redis 6.0.9 snapshotting was disabled if there was no save directive in the config file. This is consistent with the docs: https://raw.githubusercontent.com/redis/redis/6.0/redis.conf

Note: you can disable saving completely by commenting out all "save" lines.

In Redis 6.2-rc1 snapshotting seems to be enabled even with no save directive in the config file.

To reproduce

echo > redis-config
docker run -v $(pwd)/redis-config:/redis-config -p 6379:6379 redis:6.2-rc1-alpine redis-server /redis-config
for VARIABLE in {1..200}; do redis-cli set one two; done

Expected behavior

Don't expect to see after 5 mins:

100 changes in 300 seconds. Saving...

Comment From: ShooterIT

Related PRs: https://github.com/redis/redis/pull/7092 , https://github.com/redis/redis/pull/7767

Now, There is a basic question, default SAVE param is? 🤔 From redis.conf comments, it likely should be empty.

Comment From: oranagra

There used to be a bug (#5629) in which passing any command line configuration (which is probably happens in docker) would reset the default save config.

This bug is now fixed in 6.2, and the behavior change is mentioned in the release notes:

* Not resetting "save" config when Redis is started with command line arguments. (#7092)
  In case you provide command line arguments without "save" and count on it
  being disabled, Now the defaults "save" config will kick in.

The default behavior of redis (when just lunched like ./redis-server) was that it has a default save, and that's always been the case.

src/redis-server &
...
redis-cli config get save
1) "save"
2) "3600 1 300 100 60 10000"

So it seems like the documentation in redis.conf is simply incorrect, and that but i mentioned above made it look correct, but only in certain scenarios.

@itamarhaber maybe you have something to contribute here? can we just update redis.conf doc line?

Comment From: simonkotwicz

Note that this has the potential to break anyone using a config file (passed as a command line arg - redis-server my-redis-config) and if snapshotting fails (due to a file permission error for example) it will also fail writes due to the default stop-writes-on-bgsave-error yes.

Comment From: oranagra

@simonkotwicz indeed this is a behavior change, i'm hoping people read the release notes carefully, specifically the ones in the "behavior change" section.

as far as i understand your example i don't think there's a behavior change in that case. let's consider these * ./redis-server - when no arguments, redis starts with default save config as it always has. * ./redis-server redis.conf - also no change, it'll use the default or what specified in the config file. * ./redis-server redis.conf --port 12345 - this is where the bug was (the argument was resetting the save config) * ./redis-server --port 12345 - same as the above.

Comment From: itamarhaber

I concur with @oranagra

Comment From: simonkotwicz

PR to fix a typo https://github.com/redis/redis/pull/8362