1. 19 Dec, 2014 1 commit
  2. 18 Dec, 2014 1 commit
    • Alon Diamant's avatar
      Fix: case when SPOP with count>MAXINT, setTypeRandomElements() will get... · 3c8a7558
      Alon Diamant authored
      Fix: case when SPOP with count>MAXINT, setTypeRandomElements() will get negative count argument due to signed/unsigned mismatch.
      
      setTypeRandomElements() now returns unsigned long, and also uses unsigned long for anything related to count of members.
      spopWithCountCommand() now uses unsigned long elements_returned instead of int, for values returned from setTypeRandomElements()
      3c8a7558
  3. 17 Dec, 2014 4 commits
  4. 16 Dec, 2014 1 commit
  5. 15 Dec, 2014 1 commit
  6. 14 Dec, 2014 1 commit
    • Alon Diamant's avatar
      Added <count> parameter to SPOP: · 28802887
      Alon Diamant authored
      spopCommand() now runs spopWithCountCommand() in case the <count> param is found.
      Added intsetRandomMembers() to Intset: Copies N random members from the set into inputted 'values' array. Uses either the Knuth or Floyd sample algos depending on ratio count/size.
      Added setTypeRandomElements() to SET type: Returns a number of random elements from a non empty set. This is a version of setTypeRandomElement() that is modified in order to return multiple entries, using dictGetRandomKeys() and intsetRandomMembers().
      Added tests for SPOP with <count>: unit/type/set, unit/scripting, integration/aof
      --
      Cleaned up code a bit to match with required Redis coding style
      28802887
  7. 13 Dec, 2014 2 commits
  8. 12 Dec, 2014 2 commits
  9. 11 Dec, 2014 9 commits
  10. 10 Dec, 2014 9 commits
    • Pierre-Yves Ritschard's avatar
      b5686c1a
    • antirez's avatar
      Better read-only behavior for expired keys in slaves. · 06e76bc3
      antirez authored
      Slaves key expire is orchestrated by the master. Sometimes the master
      will send the synthesized DEL to expire keys on the slave with a non
      trivial delay (when the key is not accessed, only the incremental expiry
      algorithm will expire it in background).
      
      During that time, a key is logically expired, but slaves still return
      the key if you GET (or whatever) it. This is a bad behavior.
      
      However we can't simply trust the slave view of the key, since we need
      the master to be able to send write commands to update the slave data
      set, and DELs should only happen when the key is expired in the master
      in order to ensure consistency.
      
      However 99.99% of the issues with this behavior is when a client which
      is not a master sends a read only command. In this case we are safe and
      can consider the key as non existing.
      
      This commit does a few changes in order to make this sane:
      
      1. lookupKeyRead() is modified in order to return NULL if the above
      conditions are met.
      2. Calls to lookupKeyRead() in commands actually writing to the data set
      are repliaced with calls to lookupKeyWrite().
      
      There are redundand checks, so for example, if in "2" something was
      overlooked, we should be still safe, since anyway, when the master
      writes the behavior is to don't care about what expireIfneeded()
      returns.
      
      This commit is related to  #1768, #1770, #2131.
      06e76bc3
    • antirez's avatar
      Sentinel: INFO-CACHE comments reworked a bit. · d8158771
      antirez authored
      Changed in order to make them more review friendly, based on the
      experience of reviewing the code myself.
      d8158771
    • antirez's avatar
      Sentinel: INFO-CACHE GCC minior code cleanup. · c83a9172
      antirez authored
      I guess the initial goal of the initialization was to suppress GCC
      warning, but if we have to initialize, we can do it with the base-case
      value instead of NULL which is never retained.
      c83a9172
    • antirez's avatar
      04223216
    • antirez's avatar
      7576a27d
    • antirez's avatar
      test-sds target in Makefile to run sds.c tests. · 0195afae
      antirez authored
      0195afae
    • antirez's avatar
      sds.c: more tests for sdstrim(). · 9bb4ef87
      antirez authored
      9bb4ef87
    • Brochen's avatar
      Update sds.c · 181300d4
      Brochen authored
      in the case (all chars of the string s found in 'cset' ),
      line[573] will no more do the same thing line[572] did.
      this will be more faster especially in the case that the string s is very long and all chars of string s found in 'cset'
      181300d4
  11. 09 Dec, 2014 1 commit
  12. 08 Dec, 2014 3 commits
  13. 05 Dec, 2014 1 commit
  14. 04 Dec, 2014 1 commit
  15. 03 Dec, 2014 3 commits