1. 08 7月, 2013 1 次提交
  2. 01 7月, 2013 1 次提交
  3. 26 6月, 2013 6 次提交
    • A
      function renamed: popcount_binary -> redisPopcount. · bb0d0fd4
      antirez 提交于
      bb0d0fd4
    • A
      Don't disconnect pre PSYNC replication clients for timeout. · cdf79c06
      antirez 提交于
      Clients using SYNC to replicate are older implementations, such as
      redis-cli --slave, and are not designed to acknowledge the master with
      REPLCONF ACK commands, so we don't have any feedback and should not
      disconnect them on timeout.
      cdf79c06
    • A
      Use the RSC to replicate EVALSHA unmodified. · 545fe0c3
      antirez 提交于
      This commit uses the Replication Script Cache in order to avoid
      translating EVALSHA into EVAL whenever possible for both the AOF and
      slaves.
      545fe0c3
    • A
      Replication of scripts as EVALSHA: sha1 caching implemented. · 9d894b1b
      antirez 提交于
      This code is only responsible to take an LRU-evicted fixed length cache
      of SHA1 that we are sure all the slaves received.
      
      In this commit only the implementation is provided, but the Redis core
      does not use it to actually send EVALSHA to slaves when possible.
      9d894b1b
    • A
      New API to force propagation. · 8328d993
      antirez 提交于
      The old REDIS_CMD_FORCE_REPLICATION flag was removed from the
      implementation of Redis, now there is a new API to force specific
      executions of a command to be propagated to AOF / Replication link:
      
          void forceCommandPropagation(int flags);
      
      The new API is also compatible with Lua scripting, so a script that will
      execute commands that are forced to be propagated, will also be
      propagated itself accordingly even if no change to data is operated.
      
      As a side effect, this new design fixes the issue with scripts not able
      to propagate PUBLISH to slaves (issue #873).
      8328d993
    • A
      PUBSUB command implemented. · a8f1474d
      antirez 提交于
      Currently it implements three subcommands:
      
      PUBSUB CHANNELS [<pattern>]    List channels with non-zero subscribers.
      PUBSUB NUMSUB [channel_1 ...]  List number of subscribers for channels.
      PUBSUB NUMPAT                  Return number of subscribed patterns.
      a8f1474d
  4. 30 5月, 2013 1 次提交
  5. 28 5月, 2013 1 次提交
  6. 27 5月, 2013 2 次提交
    • A
      Replication: send REPLCONF ACK to master. · 146f1d7d
      antirez 提交于
      146f1d7d
    • A
      REPLCONF ACK command. · 1e77b77d
      antirez 提交于
      This special command is used by the slave to inform the master the
      amount of replication stream it currently consumed.
      
      it does not return anything so that we not need to consume additional
      bandwidth needed by the master to reply something.
      
      The master can do a number of things knowing the amount of stream
      processed, such as understanding the "lag" in bytes of the slave, verify
      if a given command was already processed by the slave, and so forth.
      1e77b77d
  7. 15 5月, 2013 4 次提交
  8. 24 4月, 2013 2 次提交
  9. 02 4月, 2013 1 次提交
    • A
      Throttle BGSAVE attempt on saving error. · d6b0c18c
      antirez 提交于
      When a BGSAVE fails, Redis used to flood itself trying to BGSAVE at
      every next cron call, that is either 10 or 100 times per second
      depending on configuration and server version.
      
      This commit does not allow a new automatic BGSAVE attempt to be
      performed before a few seconds delay (currently 5).
      
      This avoids both the auto-flood problem and filling the disk with
      logs at a serious rate.
      
      The five seconds limit, considering a log entry of 200 bytes, will use
      less than 4 MB of disk space per day that is reasonable, the sysadmin
      should notice before of catastrofic events especially since by default
      Redis will stop serving write queries after the first failed BGSAVE.
      
      This fixes issue #849
      d6b0c18c
  10. 28 3月, 2013 1 次提交
    • A
      DEBUG set-active-expire added. · 10d8e6a7
      antirez 提交于
      We need the ability to disable the activeExpireCycle() (active
      expired key collection) call for testing purposes.
      10d8e6a7
  11. 11 3月, 2013 2 次提交
  12. 06 3月, 2013 1 次提交
    • A
      API to lookup commands with their original name. · bc1b2e8f
      antirez 提交于
      A new server.orig_commands table was added to the server structure, this
      contains a copy of the commant table unaffected by rename-command
      statements in redis.conf.
      
      A new API lookupCommandOrOriginal() was added that checks both tables,
      new first, old later, so that rewriteClientCommandVector() and friends
      can lookup commands with their new or original name in order to fix the
      client->cmd pointer when the argument vector is renamed.
      
      This fixes the segfault of issue #986, but does not fix a wider range of
      problems resulting from renaming commands that actually operate on data
      and are registered into the AOF file or propagated to slaves... That is
      command renaming should be handled with care.
      bc1b2e8f
  13. 27 2月, 2013 1 次提交
  14. 26 2月, 2013 1 次提交
    • A
      Set process name in ps output to make operations safer. · ac3100bc
      antirez 提交于
      This commit allows Redis to set a process name that includes the binding
      address and the port number in order to make operations simpler.
      
      Redis children processes doing AOF rewrites or RDB saving change the
      name into redis-aof-rewrite and redis-rdb-bgsave respectively.
      
      This in general makes harder to kill the wrong process because of an
      error and makes simpler to identify saving children.
      
      This feature was suggested by Arnaud GRANAL in the Redis Google Group,
      Arnaud also pointed me to the setproctitle.c implementation includeed in
      this commit.
      
      This feature should work on all the Linux, OSX, and all the three major
      BSD systems.
      ac3100bc
  15. 12 2月, 2013 5 次提交
    • A
    • A
      5fe2577a
    • A
      PSYNC: work in progress, preview #2, rebased to unstable. · 700e5eb4
      antirez 提交于
      700e5eb4
    • A
      Use replicationFeedSlaves() to send PING to slaves. · 01c21f99
      antirez 提交于
      A Redis master sends PING commands to slaves from time to time: doing
      this ensures that even if absence of writes, the master->slave channel
      remains active and the slave can feel the master presence, instead of
      closing the connection for timeout.
      
      This commit changes the way PINGs are sent to slaves in order to use the
      standard interface used to replicate all the other commands, that is,
      the function replicationFeedSlaves().
      
      With this change the stream of commands sent to every slave is exactly
      the same regardless of their exact state (Transferring RDB for first
      synchronization or slave already online). With the previous
      implementation the PING was only sent to online slaves, with the result
      that the output stream from master to slaves was not identical for all
      the slaves: this is a problem if we want to implement partial resyncs in
      the future using a global replication stream offset.
      
      TL;DR: this commit should not change the behaviour in practical terms,
      but is just something in preparation for partial resynchronization
      support.
      01c21f99
    • A
      Emit SELECT to slaves in a centralized way. · 5a35e485
      antirez 提交于
      Before this commit every Redis slave had its own selected database ID
      state. This was not actually useful as the emitted stream of commands
      is identical for all the slaves.
      
      Now the the currently selected database is a global state that is set to
      -1 when a new slave is attached, in order to force the SELECT command to
      be re-emitted for all the slaves.
      
      This change is useful in order to implement replication partial
      resynchronization in the future, as makes sure that the stream of
      commands received by slaves, including SELECT commands, are exactly the
      same for every slave connected, at any time.
      
      In this way we could have a global offset that can identify a specific
      piece of the master -> slaves stream of commands.
      5a35e485
  16. 11 2月, 2013 1 次提交
  17. 05 2月, 2013 2 次提交
    • A
      TCP_NODELAY after SYNC: changes to the implementation. · 5f7dff4d
      antirez 提交于
      5f7dff4d
    • C
      Turn off TCP_NODELAY on the slave socket after SYNC. · 1d80acae
      charsyam 提交于
      Further details from @antirez:
      
      It was reported by @StopForumSpam on Twitter that the Redis replication
      link was strangely using multiple TCP packets for multiple commands.
      This wastes a lot of bandwidth and is due to the TCP_NODELAY option we
      enable on the socket after accepting a new connection.
      
      However the master -> slave channel is a one-way channel since Redis
      replication is asynchronous, so there is no point in trying to reduce
      the latency, we should aim to reduce the bandwidth. For this reason this
      commit introduces the ability to disable the nagle algorithm on the
      socket after a successful SYNC.
      
      This feature is off by default because the delay can be up to 40
      milliseconds with normally configured Linux kernels.
      1d80acae
  18. 28 1月, 2013 3 次提交
    • A
      Keyspace events: it is now possible to select subclasses of events. · b9bc4f91
      antirez 提交于
      When keyspace events are enabled, the overhead is not sever but
      noticeable, so this commit introduces the ability to select subclasses
      of events in order to avoid to generate events the user is not
      interested in.
      
      The events can be selected using redis.conf or CONFIG SET / GET.
      b9bc4f91
    • A
      Fix decrRefCount() prototype from void to robj pointer. · 2825f21f
      antirez 提交于
      decrRefCount used to get its argument as a void* pointer in order to be
      used as destructor where a 'void free_object(void*)' prototype is
      expected. However this made simpler to introduce bugs by freeing the
      wrong pointer. This commit fixes the argument type and introduces a new
      wrapper called decrRefCountVoid() that can be used when the void*
      argument is needed.
      2825f21f
    • A
      Keyspace events notification API. · 212edbc4
      antirez 提交于
      212edbc4
  19. 19 1月, 2013 1 次提交
    • G
      Fixed many typos. · 1caf0939
      guiquanz 提交于
      Conflicts fixed, mainly because 2.8 has no cluster support / files:
      	00-RELEASENOTES
      	src/cluster.c
      	src/crc16.c
      	src/redis-trib.rb
      	src/redis.h
      1caf0939
  20. 15 1月, 2013 1 次提交
    • A
      CLIENT GETNAME and CLIENT SETNAME introduced. · 786bd393
      antirez 提交于
      Sometimes it is much simpler to debug complex Redis installations if it
      is possible to assign clients a name that is displayed in the CLIENT
      LIST output.
      
      This is the case, for example, for "leaked" connections. The ability to
      provide a name to the client makes it quite trivial to understand what
      is the part of the code implementing the client not releasing the
      resources appropriately.
      
      Behavior:
      
          CLIENT SETNAME: set a name for the client, or remove the current
                          name if an empty name is set.
          CLIENT GETNAME: get the current name, or a nil.
          CLIENT LIST: now displays the client name if any.
      
      Thanks to Mark Gravell for pushing this idea forward.
      786bd393
  21. 15 12月, 2012 1 次提交
    • A
      serverCron() frequency is now a runtime parameter (was REDIS_HZ). · a6d117b6
      antirez 提交于
      REDIS_HZ is the frequency our serverCron() function is called with.
      A more frequent call to this function results into less latency when the
      server is trying to handle very expansive background operations like
      mass expires of a lot of keys at the same time.
      
      Redis 2.4 used to have an HZ of 10. This was good enough with almost
      every setup, but the incremental key expiration algorithm was working a
      bit better under *extreme* pressure when HZ was set to 100 for Redis
      2.6.
      
      However for most users a latency spike of 30 milliseconds when million
      of keys are expiring at the same time is acceptable, on the other hand a
      default HZ of 100 in Redis 2.6 was causing idle instances to use some
      CPU time compared to Redis 2.4. The CPU usage was in the order of 0.3%
      for an idle instance, however this is a shame as more energy is consumed
      by the server, if not important resources.
      
      This commit introduces HZ as a runtime parameter, that can be queried by
      INFO or CONFIG GET, and can be modified with CONFIG SET. At the same
      time the default frequency is set back to 10.
      
      In this way we default to a sane value of 10, but allows users to
      easily switch to values up to 500 for near real-time applications if
      needed and if they are willing to pay this small CPU usage penalty.
      a6d117b6
  22. 03 12月, 2012 1 次提交
    • A
      Blocking POP: use a dictionary to store keys clinet side. · 07a9f854
      antirez 提交于
      To store the keys we block for during a blocking pop operation, in the
      case the client is blocked for more data to arrive, we used a simple
      linear array of redis objects, in the blockingState structure:
      
          robj **keys;
          int count;
      
      However in order to fix issue #801 we also use a dictionary in order to
      avoid to end in the blocked clients queue for the same key multiple
      times with the same client.
      
      The dictionary was only temporary, just to avoid duplicates, but since
      we create / destroy it there is no point in doing this duplicated work,
      so this commit simply use a dictionary as the main structure to store
      the keys we are blocked for. So instead of the previous fields we now
      just have:
      
          dict *keys;
      
      This simplifies the code and reduces the work done by the server during
      a blocking POP operation.
      07a9f854