Addressing the Defrag Supported AOF Loading Error and How to solve it

Hey Folks,
I am Abhishek from Squad 50
This is regarding the Open Source Software Module-Contributing to Redis under the FOSS Course in the Live Books.
TL;DR-Redis is a database which stores data on memory to make it readily availabe and locally so it is non volatile.

And while executing the Make Test, some of you might have encountered an error in AOF Loading(AOF-Append Only File; logs all the database updates)








Active defrag - AOF loading in tests/unit/memefficiency.tcl
Expected 170 <= 40 (context: type eval line 37 cmd {assert {$max_latency <= 40}} proc ::test)


So what’s happening is the defragger is not getting a chance to get triggered and run
There is a simple fix to this.
1)Close the terminal
2)Go to the path in your local where you cloned it

Redis > tests > unit > memefficiency.tcl

Open that file in a text editor & Search(Ctrl F), Copy Paste this

r config set key-load-delay

there change the value to anything below -40 to --25 or -20(i.e default value maybe of a higher value greater than -40 )
Do trial and error, Play with the values, might take several runs for success

What we did just now is we made the AOF loading slower, and giving the defragger a chance to get triggered and run.
In Layman Terms, Machine is too fast to handle that specific test case xd.

Hopefully, now you will get all test cases passed if you run Make Test after that minor edit.

1 Like

I’d trust redis tests to work very well – it’s an industry standard part of the stack. Did you google for the error? Perhaps someone has a proper fix?

Or if what you’ve discovered is the proper fix – then you can contribute the change back to redis!

I see some related discussions here - perhaps it helps:




Yes,it is fixed but i think for some machines we need to manually change the value
Because it was patched in 2021 and i still got that same error