Skip to content

[BUG] Redis-cli 6.0.7 fails mass-insertion with "unknown command" by apparently misreading stdin #7744

@deanshelton913

Description

@deanshelton913

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions