1. 27 Mar, 2015 2 commits
  2. 11 Feb, 2015 11 commits
  3. 23 Jan, 2015 1 commit
  4. 29 Sep, 2014 2 commits
    • Matt Stancliff's avatar
      Cleanup wording of dictScan() comment · ef5fc599
      Matt Stancliff authored
      Some language in the comment was difficult
      to understand, so this commit: clarifies wording, removes
      unnecessary words, and relocates some dependent clauses
      closer to what they actually describe.
      
      I also tried to break up longer chains of thought
      (if X, then Y, and Q, and also F, so obviously M)
      into more manageable chunks for ease of understanding.
      ef5fc599
    • Michael Parker's avatar
      Fix hash table size in comment for dictScan · fc8f7ec7
      Michael Parker authored
      Closes #1351
      fc8f7ec7
  5. 26 Aug, 2014 2 commits
  6. 18 Aug, 2014 1 commit
  7. 13 Aug, 2014 1 commit
  8. 20 Mar, 2014 1 commit
    • antirez's avatar
      Added dictGetRandomKeys() to dict.c: mass get random entries. · 5317f5e9
      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.
      5317f5e9
  9. 04 Mar, 2014 2 commits
  10. 10 Dec, 2013 1 commit
    • antirez's avatar
      dict.c: added optional callback to dictEmpty(). · 2eb781b3
      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).
      2eb781b3
  11. 05 Dec, 2013 1 commit
  12. 05 Nov, 2013 1 commit
  13. 28 Oct, 2013 1 commit
  14. 25 Oct, 2013 4 commits
  15. 20 Aug, 2013 1 commit
  16. 19 Aug, 2013 5 commits
    • antirez's avatar
      Revert "Fixed type in dict.c comment: 265 -> 256." · 00ddc350
      antirez authored
      This reverts commit 6253180a.
      00ddc350
    • antirez's avatar
      Fixed type in dict.c comment: 265 -> 256. · 6253180a
      antirez authored
      6253180a
    • antirez's avatar
      assert.h replaced with redisassert.h when appropriate. · 1c754084
      antirez authored
      Also a warning was suppressed by including unistd.h in redisassert.h
      (needed for _exit()).
      1c754084
    • antirez's avatar
      dictFingerprint() fingerprinting made more robust. · 905d4822
      antirez authored
      The previous hashing used the trivial algorithm of xoring the integers
      together. This is not optimal as it is very likely that different
      hash table setups will hash the same, for instance an hash table at the
      start of the rehashing process, and at the end, will have the same
      fingerprint.
      
      Now we hash N integers in a smarter way, by summing every integer to the
      previous hash, and taking the integer hashing again (see the code for
      further details). This way it is a lot less likely that we get a
      collision. Moreover this way of hashing explicitly protects from the
      same set of integers in a different order to hash to the same number.
      
      This commit is related to issue #1240.
      905d4822
    • antirez's avatar
      dict.c iterator API misuse protection. · 48cde3fe
      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.
      48cde3fe
  17. 19 Jan, 2013 1 commit
  18. 28 Nov, 2012 1 commit
  19. 08 Nov, 2012 1 commit