1. 18 Apr, 2014 1 commit
  2. 16 Apr, 2014 1 commit
    • antirez's avatar
      String value unsharing refactored into proper function. · 8be30eca
      antirez authored
      All the Redis functions that need to modify the string value of a key in
      a destructive way (APPEND, SETBIT, SETRANGE, ...) require to make the
      object unshared (if refcount > 1) and encoded in raw format (if encoding
      is not already REDIS_ENCODING_RAW).
      
      This was cut & pasted many times in multiple places of the code. This
      commit puts the small logic needed into a function called
      dbUnshareStringValue().
      8be30eca
  3. 21 Mar, 2014 2 commits
    • antirez's avatar
      struct dictEntry -> dictEntry. · 10c8d862
      antirez authored
      10c8d862
    • antirez's avatar
      Obtain LRU clock in a resolution dependent way. · 205c2ccc
      antirez authored
      For testing purposes it is handy to have a very high resolution of the
      LRU clock, so that it is possible to experiment with scripts running in
      just a few seconds how the eviction algorithms works.
      
      This commit allows Redis to use the cached LRU clock, or a value
      computed on demand, depending on the resolution. So normally we have the
      good performance of a precomputed value, and a clock that wraps in many
      days using the normal resolution, but if needed, changing a define will
      switch behavior to an high resolution LRU clock.
      205c2ccc
  4. 11 Mar, 2014 9 commits
  5. 07 Feb, 2014 1 commit
  6. 03 Feb, 2014 1 commit
    • antirez's avatar
      Scripting: expire keys in scripts only at first access. · b089ba98
      antirez authored
      Keys expiring in the middle of the execution of Lua scripts are to
      create inconsistencies in masters and / or AOF files. See the following
      example:
      
          if redis.call("exists",KEYS[1]) == 1
          then
              redis.call("incr","mycounter")
          end
      
          if redis.call("exists",KEYS[1]) == 1
          then
              return redis.call("incr","mycounter")
          end
      
      The script executes two times the same *if key exists then incrementcounter*
      logic. However the two executions will work differently in the master and
      the slaves, provided some unlucky timing happens.
      
      In the master the first time the key may still exist, while the second time
      the key may no longer exist. This will result in the key incremented just one
      time. However as a side effect the master will generate a synthetic
      `DEL` command in the replication channel in order to force the slaves to
      expire the key (given that key expiration is master-driven).
      
      When the same script will run in the slave, the key will no longer be
      there, so the script will not increment the key.
      
      The key idea used to implement the expire-at-first-lookup semantics was
      provided by Marc Gravell.
      b089ba98
  7. 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
  8. 05 Dec, 2013 1 commit
  9. 06 Nov, 2013 1 commit
  10. 05 Nov, 2013 6 commits
  11. 31 Oct, 2013 2 commits
  12. 28 Oct, 2013 2 commits
  13. 25 Oct, 2013 11 commits
  14. 09 Oct, 2013 1 commit