- 22 Jul, 2014 1 commit
-
-
antirez authored
-
- 20 Mar, 2014 1 commit
-
-
antirez authored
This new function is useful to get a number of random entries from an hash table when we just need to do some sampling without particularly good distribution. It just jumps at a random place of the hash table and returns the first N items encountered by scanning linearly. The main usefulness of this function is to speedup Redis internal sampling of the key space, for example for key eviction or expiry.
-
- 10 Dec, 2013 1 commit
-
-
antirez authored
Redis hash table implementation has many non-blocking features like incremental rehashing, however while deleting a large hash table there was no way to have a callback called to do some incremental work. This commit adds this support, as an optiona callback argument to dictEmpty() that is currently called at a fixed interval (one time every 65k deletions).
-
- 25 Oct, 2013 1 commit
-
-
Pieter Noordhuis authored
-
- 19 Aug, 2013 1 commit
-
-
antirez authored
dict.c allows the user to create unsafe iterators, that are iterators that will not touch the dictionary data structure in any way, preventing copy on write, but at the same time are limited in their usage. The limitation is that when itearting with an unsafe iterator, no call to other dictionary functions must be done inside the iteration loop, otherwise the dictionary may be incrementally rehashed resulting into missing elements in the set of the elements returned by the iterator. However after introducing this kind of iterators a number of bugs were found due to misuses of the API, and we are still finding bugs about this issue. The bugs are not trivial to track because the effect is just missing elements during the iteartion. This commit introduces auto-detection of the API misuse. The idea is that an unsafe iterator has a contract: from initialization to the release of the iterator the dictionary should not change. So we take a fingerprint of the dictionary state, xoring a few important dict properties when the unsafe iteartor is initialized. We later check when the iterator is released if the fingerprint is still the same. If it is not, we found a misuse of the iterator, as not allowed API calls changed the internal state of the dictionary. This code was checked against a real bug, issue #1240. This is what Redis prints (aborting) when a misuse is detected: Assertion failed: (iter->fingerprint == dictFingerprint(iter->d)), function dictReleaseIterator, file dict.c, line 587.
-
- 05 Oct, 2012 1 commit
-
-
antirez authored
The previously used hash function, djbhash, is not secure against collision attacks even when the seed is randomized as there are simple ways to find seed-independent collisions. The new hash function appears to be safe (or much harder to exploit at least) in this case, and has better distribution. Better distribution does not always means that's better. For instance in a fast benchmark with "DEBUG POPULATE 1000000" I obtained the following results: 1.6 seconds with djbhash 2.0 seconds with murmurhash2 This is due to the fact that djbhash will hash objects that follow the pattern `prefix:<id>` and where the id is numerically near, to near buckets. This improves the locality. However in other access patterns with keys that have no relation murmurhash2 has some (apparently minimal) speed advantage. On the other hand a better distribution should significantly improve the quality of the distribution of elements returned with dictGetRandomKey() that is used in SPOP, SRANDMEMBER, RANDOMKEY, and other commands. Everything considered, and under the suspect that this commit fixes a security issue in Redis, we are switching to the new hash function. If some serious speed regression will be found in the future we'll be able to step back easiliy. This commit fixes issue #663.
-
- 03 Oct, 2012 1 commit
-
-
Greg Hurrell authored
-
- 21 Jan, 2012 1 commit
-
-
antirez authored
Fix for hash table collision attack. We simply randomize hash table initialization value at startup time.
-
- 09 Nov, 2011 1 commit
-
-
antirez authored
-
- 08 Nov, 2011 4 commits
-
-
antirez authored
entry. Field name of hash entry union modified for clarity.
-
antirez authored
dict.c: added macros in dict.h to set signed and unsigned 64 bit values directly inside the hash entry without using additional memory.
-
antirez authored
-
antirez authored
dict.c: added two lower level methods for directly manipulating hash entries. This is useful in order to set 64 bit integers as values directly inside the hash entry (in order to save memory), without casting, and even in 32 bit builds.
-
- 02 Nov, 2011 1 commit
-
-
antirez authored
-
- 10 May, 2011 1 commit
-
-
antirez authored
Introduced a safe iterator interface that can be used to iterate while accessing the dictionary at the same time. Now the default interface is consireded unsafe and should be used only with dictNext()
-
- 03 Nov, 2010 1 commit
-
-
antirez authored
-
- 01 Jul, 2010 1 commit
-
-
antirez authored
networking related stuff moved into networking.c moved more code more work on layout of source code SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;) cleanly compiling again after the first split, now splitting it in more C files moving more things around... work in progress split replication code splitting more Sets split Hash split replication split even more splitting more splitting minor change
-
- 16 Apr, 2010 1 commit
-
-
antirez authored
-
- 15 Apr, 2010 2 commits
- 08 Apr, 2010 1 commit
-
-
antirez authored
Prevent hash table resize while there are active child processes in order to play well with copy on write
-
- 19 Feb, 2010 1 commit
-
-
antirez authored
A problem with replication with multiple slaves connectiong to a single master fixed. It was due to a typo, and reported on github by the user micmac. Also the copyright year fixed from many files.
-
- 08 Jun, 2009 1 commit
-
-
antirez authored
SPOP implemented. Hash table resizing for Sets and Expires too. Changed the resize policy to play better with RANDOMKEY and SPOP.
-
- 30 Apr, 2009 1 commit
-
-
antirez authored
-
- 01 Apr, 2009 1 commit
-
-
antirez authored
-
- 22 Mar, 2009 1 commit
-
-
antirez authored
-