1. 05 2月, 2013 1 次提交
  2. 28 1月, 2013 1 次提交
    • 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
  3. 19 1月, 2013 3 次提交
  4. 15 1月, 2013 2 次提交
    • A
      Typo fixed, ASCI -> ASCII. · f31d10b9
      antirez 提交于
      f31d10b9
    • 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
  5. 03 1月, 2013 1 次提交
  6. 03 12月, 2012 2 次提交
    • A
      Memory leak fixed: release client's bpop->keys dictionary. · 124cb6dd
      antirez 提交于
      Refactoring performed after issue #801 resolution (see commit
      2f87cf8b) introduced a memory leak that
      is fixed by this commit.
      
      I simply forgot to free the new allocated dictionary in the client
      structure trusting the output of "make test" on OSX.
      
      However due to changes in the "leaks" utility the test was no longer
      testing memory leaks. This problem was also fixed.
      
      Fortunately the CI test running at ci.redis.io spotted the bug in the
      valgrind run.
      
      The leak never ended into a stable release.
      124cb6dd
    • 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
  7. 09 11月, 2012 1 次提交
  8. 02 11月, 2012 2 次提交
  9. 07 7月, 2012 1 次提交
    • A
      REPLCONF internal command introduced. · dbd8c753
      antirez 提交于
      The REPLCONF command is an internal command (not designed to be directly
      used by normal clients) that allows a slave to set some replication
      related state in the master before issuing SYNC to start the
      replication.
      
      The initial motivation for this command, and the only reason currently
      it is used by the implementation, is to let the slave instance
      communicate its listening port to the slave, so that the master can
      show all the slaves with their listening ports in the "replication"
      section of the INFO output.
      
      This allows clients to auto discover and query all the slaves attached
      into a master.
      
      Currently only a single option of the REPLCONF command is supported, and
      it is called "listening-port", so the slave now starts the replication
      process with something like the following chat:
      
          REPLCONF listening-prot 6380
          SYNC
      
      Note that this works even if the master is an older version of Redis and
      does not understand REPLCONF, because the slave ignores the REPLCONF
      error.
      
      In the future REPLCONF can be used for partial replication and other
      replication related features where there is the need to exchange
      information between master and slave.
      
      NOTE: This commit also fixes a bug: the INFO outout already carried
      information about slaves, but the port was broken, and was obtained
      with getpeername(2), so it was actually just the ephemeral port used
      by the slave to connect to the master as a client.
      dbd8c753
  10. 15 6月, 2012 1 次提交
    • A
      Fix c->reply_bytes computation in setDeferredMultiBulkLength() · 6fe9c402
      antirez 提交于
      In order to implement reply buffer limits introduced in 2.6 and useful
      to close the connection under user-selected circumastances of big output
      buffers (for instance slow consumers in pub/sub, a blocked slave, and so
      forth) Redis takes a counter with the amount of used memory in objects
      inside the output list stored into c->reply.
      
      The computation was broken in the function setDeferredMultiBulkLength(),
      in the case the object was glued with the next one. This caused the
      c->reply_bytes field to go out of sync, be subtracted more than needed,
      and wrap back near to ULONG_MAX values.
      
      This commit fixes this bug and adds an assertion that is able to trap
      this class of problems.
      
      This problem was discovered looking at the INFO output of an unrelated
      issue (issue #547).
      6fe9c402
  11. 07 4月, 2012 1 次提交
  12. 29 3月, 2012 2 次提交
  13. 28 3月, 2012 1 次提交
  14. 14 3月, 2012 5 次提交
  15. 07 3月, 2012 1 次提交
  16. 16 2月, 2012 1 次提交
  17. 08 2月, 2012 1 次提交
  18. 07 2月, 2012 1 次提交
  19. 06 2月, 2012 1 次提交
  20. 04 2月, 2012 2 次提交
    • A
      This fixes issue #327, is a very complex fix (unfortunately), details: · f6b32c14
      antirez 提交于
      1) sendReplyToClient() now no longer stops transferring data to a single
      client in the case we are out of memory (maxmemory-wise).
      
      2) in processCommand() the idea of we being out of memory is no longer
      the naive zmalloc_used_memory() > server.maxmemory. To say if we can
      accept or not write queries is up to the return value of
      freeMemoryIfNeeded(), that has full control about that.
      
      3) freeMemoryIfNeeded() now does its math without considering output
      buffers size. But at the same time it can't let the output buffers to
      put us too much outside the max memory limit, so at the same time it
      makes sure there is enough effort into delivering the output buffers to
      the slaves, calling the write handler directly.
      
      This three changes are the result of many tests, I found (partially
      empirically) that is the best way to address the problem, but maybe
      we'll find better solutions in the future.
      f6b32c14
    • A
      Use less memory when emitting the protocol, by using more shared objects for... · 355f8591
      antirez 提交于
      Use less memory when emitting the protocol, by using more shared objects for commonly emitted parts of the protocol.
      355f8591
  21. 26 1月, 2012 1 次提交
  22. 24 1月, 2012 5 次提交
  23. 23 1月, 2012 1 次提交
  24. 17 1月, 2012 2 次提交