However, this caused stale data to propagate. Next, we tried using a Lua script to trim the sorted set. But this caused a replication backlog and corrupted our AOF files. We finally fixed the issue by ...