Incorrect commands in AOF file.

24 views
Skip to first unread message

Anton Romanov

unread,
Aug 1, 2016, 5:15:03 AM8/1/16
to Redis DB
Hi,

I've ran into an interesting issue. I have an AOF file that has a lot of commands that return the following error "error: ERR wrong number of arguments for 'zadd' command".

In AOF file it looks like this.

*4^M
$4^M
ZADD^M
$3^M
key^M
$1^M
1^M
$0^M
^M
-- NEXT_COMMAND

I tried replicating this behaviour using pipelining, but couldn't make such command to get written to the test AOF file. How is this possible that it appears in the working AOF?

Any ideas are welcome.

Itamar Haber

unread,
Aug 1, 2016, 5:21:28 AM8/1/16
to Redis DB
Hi Anton,

Interesting indeed. This could be a defect in AOF, zsets or something else :) What's your version?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Chief Developer Advocate
Redis Watch Newsletter | &&(curat||edit||janit||)
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Email: ita...@redislabs.com
Twitter: @itamarhaber
Skype: itamar.haber

Blog  |  Twitter  |  LinkedIn


Anton Romanov

unread,
Aug 1, 2016, 10:52:20 AM8/1/16
to Redis DB
Hi Itamar,

Lately it was running on redis-2.8.21 and before that it was one of the first versions in 2.6 branch. Most data manipulation is done using phpredis extension. I'm pretty sure these records could not migrate between Redis versions, because having such commands in an AOF file renders it invalid and Redis won't load it.

I'm thinking it's either corruption or somehow Redis accepted the commands and added them to the AOF.

File corruption is a possibility too. In fact, this AOF has been restored from a broken HDD, but the corrupted parts were filled with null bytes and whole commands containing them were removed.

On the other hand, the command in question looks valid. Both command length and command arguments' length are as they are supposed to be.

What interests me most at this point is whether Redis could actually accept those invalid commands and write them to disk or not.
Reply all
Reply to author
Forward
0 new messages