Hi Redis developers,

I'm using Redis version 6.0.9 on Kubernetes using the Bitnami Redis Helm Chart, in master-replica mode.

From the documentation (reported below), I understand that the AOF rewrite feature can be disabled in redis.conf by setting: auto-aof-rewrite-percentage 0.

This produces the desired effect on the Redis master, but not on the replicas, where the parameter seems to be disregarded.

Is this intended?

Thanks.

# Automatic rewrite of the append only file.
# Redis is able to automatically rewrite the log file implicitly calling
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
# 
# This is how it works: Redis remembers the size of the AOF file after the
# latest rewrite (if no rewrite has happened since the restart, the size of
# the AOF at startup is used).
#
# This base size is compared to the current size. If the current size is
# bigger than the specified percentage, the rewrite is triggered. Also
# you need to specify a minimal size for the AOF file to be rewritten, this
# is useful to avoid rewriting the AOF file even if the percentage increase
# is reached but it is still pretty small.
#
# Specify a percentage of zero in order to disable the automatic AOF
# rewrite feature.

Comment From: miluchen

Hi @queeno , here is what I tried..

I started two redis locally (the same ip but different ports), with one as the master and the other as a replica. The master uses port 6379, and the replica's config has replicaof 127.0.0.1 6379. Both the master and replica have appendonly yes, auto-aof-rewrite-percentage 0 and auto-aof-rewrite-min-size 1k. It produces desired effect on both the master and replica, i.e. no automatic rewrite. When I set auto-aof-rewrite-percentage 100, rewrite happens for both.

I guess the replica may not be configured as you expected in your case 🤔

Comment From: oranagra

@queeno the only possible reasons for AOF file to be rewritten when rewrite-percentage is 0, are when BGREWRITEAOF command is called, or if you disable and re-enable the appendonly config. maybe a look at your redis log file in the replica, and a config get rewrite-percentage (also on the replica) will reveal more information.