hello community folks, I have a question regarding command rename with AOF. the version of redis is 5.0.

from the redis.conf https://github.com/redis/redis/blob/unstable/redis.conf#L903, currently the command renaming doesn't work well with aof. For example, if we rename the SET command to SETHIDDEN and enabling aof, the SETHIDDEN will be persisted into aof file. But when we stop the server and we define another rename config for SET to SETHIDDEN2, the server cannot restart since it cannot recognize SETHIDDEN command when loading the command from aof.

My question is: is there any way we can fix this issue? or if we use command renaming, we are not recommended to use aof? if Redis can provide another config, like RENAME-COMMAND-ONLOAD SET SETHIDDEN, this only valid for server loading time when start, we can solve this problem when loading the data from aof, or maybe this is not something worth to work on since rename has been deprecated? thanks!

Comment From: madolson

Do you have a use case for renaming commands that isn't solved by redis ACLs? I think the solution is more or less to just use ACLs.

Comment From: daidaotong

Hi @madolson, yes the ACL is definitely the best way to substitute command renamings, however, the customer doesn't want to upgrade Redis from 5.0 to 6.0 for now. Is there any other way this can be solved based on the 5.0 feature currently or in the future? Thanks

Comment From: daniel-house

I have been working on a module that extends the behavior of the set-command. To do this I use the rename-command directive to rename SET to SET-NATIVE, and when the module loads it uses RedisModule_CreateCommand to define SET. The handler for SET does some stuff and then uses RedisModule_Call to run SET-NATIVE.

Comment From: madolson

@daidaotong I don't think there is any concrete plan to solve that, especially since that functionality won't see new development. You might want to force your customers to use the same renamed-commands configuration between two servers that share the same AOF file.

Side node, we solved this in AWS by replicating AOF/replication stream with the un-renamed commands. We never upstreamed this because salvatore was against extending the command renaming system at the time, a stance I share now.

Comment From: daniel-house

Perhaps my use-case would be better addressed by adding some kind of command interceptor or wrapper that could be set via the module API. As it stands today, command renaming is the cleanest way I can find to get the result I need.

Comment From: madolson

Modules can definitely also be a good solution. In either case, I don't think we'll solve this, so marking this to be closed unless you want to keep advocating for it:

Comment From: daniel-house

I don't want to advocate for any specific suggestions made in this thread but I am worried that the existing rename-command will be deleted without a replacement. Could you suggest a better place to track my concern?