Describe the bug

When using the latest version of redis-cli available on homebrew (6.0.7) mass insertion of ~800k ZADD commands fails by apparently misreading (or misexecuting) commands. Likely mixing multiple commands together, resulting in random errors related to 'bad syntax' when no errors are actually present in the file. This same mass-insertion, with the same data, does not fail in redis-cli 6.0.5.

Command:

cat myFile.txt | redis-cli --pipe

Note the non-existent command ZAADD instead of the actual written command ZADD:

ERR unknown command `ZAADD`, with args beginning with: `ac:ngram:wachovia `, `0`, `wachovia bank nj`

To reproduce

Create a huge file executing multiple ZADD statements, and the occasional HMSET (around 800k should do it.)

.
.
ZADD "ac:ngram:weyerhaeuser co wa" 0 "weyerhaeuser co wa" 
ZADD "ac:ngram:weyerhaeuser co wa" 0 "weyerhaeuser co wa" 
ZADD "ac:ngram:weyerhaeuser co wa" 0 "weyerhaeuser co wa"
HMSET "ac:results:abmps wa" title "ABMPS, WA" zip "98667" 
.
.

Run the command to mass-insert this file using redis-cli (6.0.7)

cat my-800k-line-file.txt | redis-cli --pipe

Expected behavior

Mass insertion should execute line-by-line and not accidentally mix any commands or lines together.

Additional information

It's worth noting that this was reproduced on two diff macbook pro's running hombrew installed redis, and executed from zshell.

Comment From: madolson

Would you be able to provide us with the file you are using so that we can reproduce the issue?

Comment From: oranagra

@yossigo i'm guessing this is due to d9f970d8d3f0b694f1e8915cab6d4eab9cfb2ef1, can you take a look?

Comment From: yossigo

Looks like it's specific to OS X. I'll take a look.

Comment From: deanshelton913

@madolson, The file i have is larger than 10MB and can not be uploaded to github. It will be available for a short time from an S3 bucket I am planning to delete someday, here.

Comment From: yossigo

@deanshelton913 The fix is now merged to unstable, if you fetch it and build a new redis-cli it should work (and if it doesn't please let me know! thanks).

Comment From: deanshelton913

woot! Thank you, guys. Any idea when we can expect an official release?

Comment From: itamarhaber

This will surely be in 6.2 (ETA unknown ATM but hoplefully no later then 31/12/2020) and 6.0.8 if we have justification to release it (waiting for more moderate++ issues).