1. 09 Dec, 2014 8 commits
  2. 05 Dec, 2014 1 commit
  3. 04 Dec, 2014 1 commit
  4. 03 Dec, 2014 5 commits
  5. 02 Dec, 2014 3 commits
    • antirez's avatar
      6a0b1b5b
    • antirez's avatar
      Mark PFCOUNT as read-only, even if not true. · 69efb59a
      antirez authored
      PFCOUNT is technically speaking a write command, since the cached value
      of the HLL is exposed in the data structure (design error, mea culpa), and
      can be modified by PFCOUNT.
      
      However if we flag PFCOUNT as "w", read only slaves can't execute the
      command, which is a problem since there are environments where slaves
      are used to scale PFCOUNT reads.
      
      Nor it is possible to just prevent PFCOUNT to modify the data structure
      in slaves, since without the cache we lose too much efficiency.
      
      So while this commit allows slaves to create a temporary inconsistency
      (the strings representing the HLLs in the master and slave can be
      different in certain moments) it is actually harmless.
      
      In the long run this should be probably fixed by turning the HLL into a
      more opaque representation, for example by storing the cached value in
      the part of the string which is not exposed (this should be possible
      with SDS strings).
      69efb59a
    • antirez's avatar
      2e4d043c
  6. 28 Nov, 2014 3 commits
  7. 26 Nov, 2014 1 commit
    • antirez's avatar
      Fix DEBUG OBJECT lru field to report seconds. · 4c1b3add
      antirez authored
      Because of (not so) recent Redis changes, now the LRU internally
      reported unit is milliseconds, not seconds, but the DEBUG OBJECT output
      was still claiming seconds while providing milliseconds.
      However OBJECT IDLETIME was working as expected, which is the correct
      API to use.
      4c1b3add
  8. 25 Nov, 2014 3 commits
  9. 24 Nov, 2014 1 commit
  10. 14 Nov, 2014 10 commits
    • antirez's avatar
      9466f3b3
    • antirez's avatar
      lua_cjson.c Lua includes: angled -> quoted. · 4861457d
      antirez authored
      4861457d
    • antirez's avatar
      6b53b32b
    • Matt Stancliff's avatar
      Lua: add cmsgpack scripting tests · 8934c480
      Matt Stancliff authored
      Basically: test to make sure we can load cmsgpack
      and do some sanity checks to make sure pack/unpack works
      properly.  We also have a bonus test for circular encoding
      and decoding because I was curious how it worked.
      8934c480
    • Matt Stancliff's avatar
      Lua: upgrade cmsgpack to 0.4.0 · 8c3bcbfc
      Matt Stancliff authored
      Main reasons for upgrade:
        - Remove a warning when building Redis
        - Add multi pack/unpack
        - Improve memory usage and use Lua allocator properly
        - Fix some edge case encoding/decoding bugs
      8c3bcbfc
    • Matt Stancliff's avatar
      Lua: remove new warning added by cjson header · aa1a0d6f
      Matt Stancliff authored
      clang doesn't like "extern inline" when no definition
      is given right away.
      aa1a0d6f
    • Matt Stancliff's avatar
      Lua: Use Redis solaris compatability for cjson too · 546db94c
      Matt Stancliff authored
      cjson calls isinf, but some Solaris versions don't have isinf
      even with the attempted fix we have in deps/Makefile.
      
      We can harmlessly include the Redis solarisfixes.h header to
      give cjson proper isinf.
      
      Note: cjson has a compile-time setting for using their own defined
      isinf, but the Redis definition in solarisfixes.h is more complete.
      
      Fixes antirez#1620
      546db94c
    • Matt Stancliff's avatar
      Lua: Upgrade cjson to 2.1.0 (2012-03-01) · 03ca2231
      Matt Stancliff authored
      The new cjson has some improvements over our current version including
      increased platform compatability, a new resource limit to restrict
      decode depth, and better invalid number handling.
      
      One minor change was required to deps/Makefile because this version
      of cjson doesn't export itself globally, so we added a quick little
      define of -DENABLE_CJSON_GLOBAL.
      
      cjson now has an optional higher performing float parsing interface,
      but we are not including it (g_fmt.c, dtoa.c) because it requires
      endianness declaration during compile time.
      
      This commit is exactly lua_cjson.c from 2.1.0 with one minor
      change of altering the two Lua includes for local search
      instead of system-wide importing.
      03ca2231
    • Matt Stancliff's avatar
      Lua: add cjson scripting test · 330ebea4
      Matt Stancliff authored
      Two simple decode tests added mainly to check that
      the 'cjson' global gets registered and is usable.
      330ebea4
    • Matt Stancliff's avatar
      Lua: Add bitop · d071e5fe
      Matt Stancliff authored
      A few people have written custom C commands because bit
      manipulation isn't exposed through Lua.  Let's give
      them Mike Pall's bitop.
      
      This adds bitop 1.0.2 (2012-05-08) from http://bitop.luajit.org/
      
      bitop is imported as "bit" into the global namespace.
      
      New Lua commands: bit.tobit, bit.tohex, bit.bnot, bit.band, bit.bor, bit.bxor,
      bit.lshift, bit.rshift, bit.arshift, bit.rol, bit.ror, bit.bswap
      
      Verification of working (the asserts would abort on error, so (nil) is correct):
      127.0.0.1:6379> eval "assert(bit.tobit(1) == 1); assert(bit.band(1) == 1); assert(bit.bxor(1,2) == 3); assert(bit.bor(1,2,4,8,16,32,64,128) == 255)" 0
      (nil)
      127.0.0.1:6379> eval 'assert(0x7fffffff == 2147483647, "broken hex literals"); assert(0xffffffff == -1 or 0xffffffff == 2^32-1, "broken hex literals"); assert(tostring(-1) == "-1", "broken tostring()"); assert(tostring(0xffffffff) == "-1" or tostring(0xffffffff) == "4294967295", "broken tostring()")' 0
      (nil)
      
      Tests also integrated into the scripting tests and can be run with:
      ./runtest --single unit/scripting
      
      Tests are excerpted from `bittest.lua` included in the bitop distribution.
      d071e5fe
  11. 12 Nov, 2014 4 commits
    • antirez's avatar
      THP detection for LATENCY DOCTOR. · c623f0ac
      antirez authored
      c623f0ac
    • antirez's avatar
      Check THP support at startup and warn about it. · 868f40c1
      antirez authored
      868f40c1
    • antirez's avatar
      THP detection / reporting functions added. · e293cfcf
      antirez authored
      e293cfcf
    • antirez's avatar
      Diskless SYNC: fix RDB EOF detection. · 90911905
      antirez authored
      RDB EOF detection was relying on the final part of the RDB transfer to
      be a magic 40 bytes EOF marker. However as the slave is put online
      immediately, and because of sockets timeouts, the replication stream is
      actually contiguous with the RDB file.
      
      This means that to detect the EOF correctly we should either:
      
      1) Scan all the stream searching for the mark. Sucks CPU-wise.
      2) Start to send the replication stream only after an acknowledge.
      3) Implement a proper chunked encoding.
      
      For now solution "2" was picked, so the master does not start to send
      ASAP the stream of commands in the case of diskless replication. We wait
      for the first REPLCONF ACK command from the slave, that certifies us
      that the slave correctly loaded the RDB file and is ready to get more
      data.
      90911905