In the process of upgrading redis3.2 to redis4.0, can I use the AOF log of redis4.0 instance to recover to redis3.2. What are the risks of such an operation.

Comment From: oranagra

Hi, First, you need to be sure you didn't enable aof-use-rdb-preamble. that's not supported in 3.2, and also there are differences in the RDB file encoding: https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_Version_History.textile

Assuming you didn't enable it, the only problem you may experience is if your AOF file contains commands that are not supported by redis 3.2. This could happen for 2 reasons: 1. If you started using new commands that are only available in 4.0. 2. If some logic inside redis changed and now old commands replicate into the AOF file differently. for example i remember we recently changed INCRBYFLOAT to be propagated to AOF by using SET ... KEEPTTL. I don't recall off the top of my head any such changes in 4.0, but this was a long time ago.

Please note however, that when processing the commands in an AOF file, redis ignores any errors these commands produce, and will proceed processing the rest of the commands as if nothing happened. So if a command is completely missing, the AOF loading will fail, but if it is present but one of the arguments is unrecognized, the command will fail and the loading will proceed. In some cases it can be helpful for you, but it can cause data inconsistency.