1. 21 3月, 2014 1 次提交
  2. 11 3月, 2014 1 次提交
  3. 27 2月, 2014 2 次提交
    • A
      Initial implementation of BITPOS. · 3294f74f
      antirez 提交于
      It appears to work but more stress testing, and both unit tests and
      fuzzy testing, is needed in order to ensure the implementation is sane.
      3294f74f
    • A
      Initial implementation of BITPOS. · 25e2791e
      antirez 提交于
      It appears to work but more stress testing, and both unit tests and
      fuzzy testing, is needed in order to ensure the implementation is sane.
      25e2791e
  4. 13 2月, 2014 1 次提交
    • A
      Update cached time in rdbLoad() callback. · 85492dcf
      antirez 提交于
      server.unixtime and server.mstime are cached less precise timestamps
      that we use every time we don't need an accurate time representation and
      a syscall would be too slow for the number of calls we require.
      
      Such an example is the initialization and update process of the last
      interaction time with the client, that is used for timeouts.
      
      However rdbLoad() can take some time to load the DB, but at the same
      time it did not updated the time during DB loading. This resulted in the
      bug described in issue #1535, where in the replication process the slave
      loads the DB, creates the redisClient representation of its master, but
      the timestamp is so old that the master, under certain conditions, is
      sensed as already "timed out".
      
      Thanks to @yoav-steinberg and Redis Labs Inc for the bug report and
      analysis.
      85492dcf
  5. 12 2月, 2014 1 次提交
    • A
      AOF: don't abort on write errors unless fsync is 'always'. · fadbbdd3
      antirez 提交于
      A system similar to the RDB write error handling is used, in which when
      we can't write to the AOF file, writes are no longer accepted until we
      are able to write again.
      
      For fsync == always we still abort on errors since there is currently no
      easy way to avoid replying with success to the user otherwise, and this
      would violate the contract with the user of only acknowledging data
      already secured on disk.
      fadbbdd3
  6. 03 2月, 2014 2 次提交
    • A
      Move mstime_t define outside sentinel.c. · ddcf1603
      antirez 提交于
      The define is now used in other parts of Redis 2.8 tree instead of long
      long.
      
      A nice side effect is that now 2.8 and unstable sentinel.c files are
      identical as it should be.
      ddcf1603
    • A
      Scripting: use mstime() and mstime_t for lua_time_start. · 3da5cbe5
      antirez 提交于
      server.lua_time_start is expressed in milliseconds. Use mstime_t instead
      of long long, and populate it with mstime() instead of ustime()/1000.
      
      Functionally identical but more natural.
      3da5cbe5
  7. 31 1月, 2014 2 次提交
  8. 14 1月, 2014 1 次提交
  9. 08 1月, 2014 1 次提交
    • A
      Don't send REPLCONF ACK to old masters. · 2a1a31ca
      antirez 提交于
      Masters not understanding REPLCONF ACK will reply with errors to our
      requests causing a number of possible issues.
      
      This commit detects a global replication offest set to -1 at the end of
      the replication, and marks the client representing the master with the
      REDIS_PRE_PSYNC flag.
      
      Note that this flag was called REDIS_PRE_PSYNC_SLAVE but now it is just
      REDIS_PRE_PSYNC as it is used for both slaves and masters starting with
      this commit.
      
      This commit fixes issue #1488.
      2a1a31ca
  10. 19 12月, 2013 1 次提交
  11. 11 12月, 2013 3 次提交
    • Y
    • A
      Slaves heartbeats during sync improved. · 563d6b3f
      antirez 提交于
      The previous fix for false positive timeout detected by master was not
      complete. There is another blocking stage while loading data for the
      first synchronization with the master, that is, flushing away the
      current data from the DB memory.
      
      This commit uses the newly introduced dict.c callback in order to make
      some incremental work (to send "\n" heartbeats to the master) while
      flushing the old data from memory.
      
      It is hard to write a regression test for this issue unfortunately. More
      support for debugging in the Redis core would be needed in terms of
      functionalities to simulate a slow DB loading / deletion.
      563d6b3f
    • A
      dict.c: added optional callback to dictEmpty(). · b6610a56
      antirez 提交于
      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).
      b6610a56
  12. 03 12月, 2013 1 次提交
  13. 28 11月, 2013 1 次提交
  14. 21 11月, 2013 3 次提交
  15. 06 11月, 2013 1 次提交
    • A
      SCAN code refactored to parse cursor first. · 060d56e7
      antirez 提交于
      The previous implementation of SCAN parsed the cursor in the generic
      function implementing SCAN, SSCAN, HSCAN and ZSCAN.
      
      The actual higher-level command implementation only checked for empty
      keys and return ASAP in that case. The result was that inverting the
      arguments of, for instance, SSCAN for example and write:
      
          SSCAN 0 key
      
      Instead of
      
          SSCAN key 0
      
      Resulted into no error, since 0 is a non-existing key name very likely.
      Just the iterator returned no elements at all.
      
      In order to fix this issue the code was refactored to extract the
      function to parse the cursor and return the error. Every higher level
      command implementation now parses the cursor and later checks if the key
      exist or not.
      060d56e7
  16. 29 10月, 2013 4 次提交
  17. 06 8月, 2013 3 次提交
    • A
      Add per-db average TTL information in INFO output. · fa48b1fa
      antirez 提交于
      Example:
      
      db0:keys=221913,expires=221913,avg_ttl=655
      
      The algorithm uses a running average with only two samples (current and
      previous). Keys found to be expired are considered at TTL zero even if
      the actual TTL can be negative.
      
      The TTL is reported in milliseconds.
      fa48b1fa
    • A
      Some activeExpireCycle() refactoring. · 00c8cfef
      antirez 提交于
      00c8cfef
    • A
      Draft #1 of a new expired keys collection algorithm. · 500155b9
      antirez 提交于
      The main idea here is that when we are no longer to expire keys at the
      rate the are created, we can't block more in the normal expire cycle as
      this would result in too big latency spikes.
      
      For this reason the commit introduces a "fast" expire cycle that does
      not run for more than 1 millisecond but is called in the beforeSleep()
      hook of the event loop, so much more often, and with a frequency bound
      to the frequency of executed commnads.
      
      The fast expire cycle is only called when the standard expiration
      algorithm runs out of time, that is, consumed more than
      REDIS_EXPIRELOOKUPS_TIME_PERC of CPU in a given cycle without being able
      to take the number of already expired keys that are yet not collected
      to a number smaller than 25% of the number of keys.
      
      You can test this commit with different loads, but a simple way is to
      use the following:
      
      Extreme load with pipelining:
      
      redis-benchmark -r 100000000 -n 100000000  \
              -P 32 set ele:rand:000000000000 foo ex 2
      
      Remove the -P32 in order to avoid the pipelining for a more real-world
      load.
      
      In another terminal tab you can monitor the Redis behavior with:
      
      redis-cli -i 0.1 -r -1 info keyspace
      
      and
      
      redis-cli --latency-history
      
      Note: this commit will make Redis printing a lot of debug messages, it
      is not a good idea to use it in production.
      500155b9
  18. 16 7月, 2013 1 次提交
  19. 12 7月, 2013 2 次提交
    • A
      SORT ALPHA: use collation instead of binary comparison. · 18fabeb2
      antirez 提交于
      Note that we only do it when STORE is not used, otherwise we want an
      absolutely locale independent and binary safe sorting in order to ensure
      AOF / replication consistency.
      
      This is probably an unexpected behavior violating the least surprise
      rule, but there is currently no other simple / good alternative.
      18fabeb2
    • A
      Fixed compareStringObject() and introduced collateStringObject(). · d8fcbb66
      antirez 提交于
      compareStringObject was not always giving the same result when comparing
      two exact strings, but encoded as integers or as sds strings, since it
      switched to strcmp() when at least one of the strings were not sds
      encoded.
      
      For instance the two strings "123" and "123\x00456", where the first
      string was integer encoded, would result into the old implementation of
      compareStringObject() to return 0 as if the strings were equal, while
      instead the second string is "greater" than the first in a binary
      comparison.
      
      The same compasion, but with "123" encoded as sds string, would instead
      return a value < 0, as it is correct. It is not impossible that the
      above caused some obscure bug, since the comparison was not always
      deterministic, and compareStringObject() is used in the implementation
      of skiplists, hash tables, and so forth.
      
      At the same time, collateStringObject() was introduced by this commit, so
      that can be used by SORT command to return sorted strings usign
      collation instead of binary comparison. See next commit.
      d8fcbb66
  20. 11 7月, 2013 4 次提交
    • A
      getClientPeerId() refactored into two functions. · 3472d045
      antirez 提交于
      3472d045
    • A
      getClientPeerId() now reports errors. · da183666
      antirez 提交于
      We now also use it in CLIENT KILL implementation.
      da183666
    • A
      getClientPeerID introduced. · 4fa68b28
      antirez 提交于
      The function returns an unique identifier for the client, as ip:port for
      IPv4 and IPv6 clients, or as path:0 for Unix socket clients.
      
      See the top comment in the function for more info.
      4fa68b28
    • G
      Add macro to define clusterNode.ip buffer size. · 68d72aa5
      Geoff Garside 提交于
      Add REDIS_CLUSTER_IPLEN macro to define the size of the clusterNode ip
      character array. Additionally use this macro in inet_ntop(3) calls where
      the size of the array was being defined manually.
      
      The REDIS_CLUSTER_IPLEN is defined as INET_ADDRSTRLEN which defines the
      correct size of a buffer to store an IPv4 address in. The
      INET_ADDRSTRLEN macro itself is defined in the <netinet/in.h> header
      file and should be portable across the majority of systems.
      68d72aa5
  21. 08 7月, 2013 2 次提交
  22. 01 7月, 2013 1 次提交
  23. 26 6月, 2013 1 次提交