3 ms·
I built a redis AOF rewriting toolchain to undelete keys at specific points in time because I was working with people who picked a storage engine without consis
by hughrr 5y ago
I built a redis AOF rewriting toolchain to undelete keys at specific points in time because I was working with people who picked a storage engine without consistency guarantees without understanding the consequences. The tool will trace the lifecycle of a key through the AOF and all events attached to it so you can pick an event to “undo”. The output is a bunch of commands to recreate the key in the state you need it in.
I’m not publishing the source because it’s extremely dangerous and not very well tested. In the wrong (or right but with misunderstood intention) hands it can make your day worse.
It works by iterating through the AOF, filtering all commands related to the interesting key and replaying all commands except matching ones into a standalone instance of redis. Then it dumps the key that is left.