Compare commits

...
2 Commits
Author SHA1 Message Date
antirez e74fe10b00 Redis 2.4.13 2012-05-02 12:14:48 +02:00
Pieter Noordhuis f2ffb59294 Use safe dictionary iterator from KEYS
Every matched key in a KEYS call is checked for expiration. When the key
is set to expire, the call to `getExpire` will assert that the key also
exists in the main dictionary. This in turn causes a rehashing step to
be executed. Rehashing a dictionary when there is an iterator active may
result in the iterator emitting duplicate entries, or not emitting some
entries at all. By using a safe iterator, the rehash step is omitted.
2012-05-01 10:52:27 +02:00
3 changed files with 11 additions and 2 deletions
+9
View File
@@ -18,6 +18,15 @@ to modify your program in order to use Redis 2.4.
CHANGELOG
---------
What's new in Redis 2.4.13
=========================
UPGRADE URGENCY: high for all the users of the KEYS command, otherwise low.
* [BUGFIX] Fix for KEYS command: if the DB contains keys with expires the KEYS
command may return the wrong output, having duplicated or missing
keys. See issue #487 and #488 on github for details.
What's new in Redis 2.4.12
=========================
+1 -1
View File
@@ -273,7 +273,7 @@ void keysCommand(redisClient *c) {
unsigned long numkeys = 0;
void *replylen = addDeferredMultiBulkLength(c);
di = dictGetIterator(c->db->dict);
di = dictGetSafeIterator(c->db->dict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0');
while((de = dictNext(di)) != NULL) {
sds key = dictGetEntryKey(de);
+1 -1
View File
@@ -1 +1 @@
#define REDIS_VERSION "2.4.12"
#define REDIS_VERSION "2.4.13"