Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show problem with 'keys' command with specific command sequence. #487

Closed
wants to merge 1 commit into from
Closed

Conversation

alicebob
Copy link
Contributor

Hi Redis,

we encountered a small problem when the 'keys' command is misbehaving. Or at least not behaving as we expect. This test has the minimal sequence we need to reproduce.

Piping this to redis-cli gives similar results:

flushall
set a c
set t c
set e c
set s c
set foo b
expire s 5
keys *

@fgeller
Copy link

fgeller commented Apr 30, 2012

+1

@pietern
Copy link
Contributor

pietern commented Apr 30, 2012

Thanks for the report. For the completeness of the issue, for me the output of this snippet on 2.6-rc1 is:

$ cat | src/redis-cli
flushall
set a c
set t c
set e c
set s c
set foo b
expire s 5
keys *
OK
OK
OK
OK
OK
OK
(integer) 1
1) "e"
2) "a"
3) "s"

@pietern
Copy link
Contributor

pietern commented Apr 30, 2012

It appears to only manifest itself when EXPIRE gets called. When it is called before SET foo even weirder results for KEYS show up, including duplicates. I guess this is related to the incremental rehashing process.

@pietern
Copy link
Contributor

pietern commented Apr 30, 2012

Let's continue in #488.

@alicebob Thanks for reporting the issue and submitting a failing test.

@pietern pietern closed this Apr 30, 2012
@alicebob
Copy link
Contributor Author

Excellent, thanks for the quick fix!

@antirez
Copy link
Contributor

antirez commented May 1, 2012

Thanks you for the report and the fix! Merging.

yosh pushed a commit to yosh/redis that referenced this pull request May 1, 2012
Use safe dictionary iterator from KEYS (fixes redis#487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants