Redis AOF rewriting strategy question

problem description

when using Redis AOF rewriting policy, the profile parameters are not consistent with the actual effect. The parameters are as follows:

appendonly yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 1mb

theoretical results:

trigger rewriting policy when the AOF file reaches 1m for the first time
when the AOF file reaches 2m again
when the AOF file reaches 4m again, trigger the rewriting policy
and so on 2 ^ n, where (n > = 0)

actual result:

rewriting policy is triggered when the AOF file reaches 1m for the first time
when the AOF file grows to 1.6m again, the rewriting policy is triggered
not tested later

the platform version of the problem and what methods you have tried

CentOS7.4, Redis4.0.1

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

question:
if calculated according to the rewriting rule, the rewrite should follow 2 ^ n, where (n > = 0), but in the actual test, the second rewrite does not take effect at 2m, but at about 1.6m. Take a look at the source code on the Internet, and the condition for automatic trigger is

.
long long growth =(server.appendonly_current_size*100/base) - 100;
 if (growth >=server.auto_aofrewrite_perc)

AOF file size, which is based on the values aof_current_size and aof_base_size via redis-cli info

May.22,2021

because the purpose of rewriting is to reduce file size by merging commands.

triggers a rewrite when it reaches 1m, and the size after the rewrite must be less than 1m. According to your situation, you can calculate that the size after the rewrite is 0.8m, so the next rewrite occurs at 1.6m.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3fc8f-2c4c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3fc8f-2c4c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?