1. 27 8月, 2013 1 次提交
  2. 12 8月, 2013 2 次提交
    • A
      Use precomptued objects for bulk and mbulk prefixes. · 73989307
      antirez 提交于
      73989307
    • A
      Replication: better way to send a preamble before RDB payload. · 89ffba91
      antirez 提交于
      During the replication full resynchronization process, the RDB file is
      transfered from the master to the slave. However there is a short
      preamble to send, that is currently just the bulk payload length of the
      file in the usual Redis form $..length..<CR><LF>.
      
      This preamble used to be sent with a direct write call, assuming that
      there was alway room in the socket output buffer to hold the few bytes
      needed, however this does not scale in case we'll need to send more
      stuff, and is not very robust code in general.
      
      This commit introduces a more general mechanism to send a preamble up to
      2GB in size (the max length of an sds string) in a non blocking way.
      89ffba91
  3. 24 7月, 2013 2 次提交
  4. 23 7月, 2013 2 次提交
    • A
      getStringObjectSdsUsedMemory() function added. · ec7f480e
      antirez 提交于
      Now that EMBSTR encoding exists we calculate the amount of memory used
      by the SDS part of a Redis String object in two different ways:
      
      1) For raw string object, the size of the allocation is considered.
      2) For embstr objects, the length of the string itself is used.
      
      The new function takes care of this logic.
      ec7f480e
    • A
      Fix setDeferredMultiBulkLength() c->reply_bytes handling with EMBSTR · dbaa5b0b
      antirez 提交于
      This function missed proper handling of reply_bytes when gluing to the
      previous object was used. The issue was introduced with the EMBSTR new
      string object encoding.
      
      This fixes issue #1208.
      dbaa5b0b
  5. 22 7月, 2013 2 次提交
    • A
      Fixed a possible bug in client->reply_bytes computation. · 7ed76528
      antirez 提交于
      7ed76528
    • A
      Introduction of a new string encoding: EMBSTR · 894eba07
      antirez 提交于
      Previously two string encodings were used for string objects:
      
      1) REDIS_ENCODING_RAW: a string object with obj->ptr pointing to an sds
      stirng.
      
      2) REDIS_ENCODING_INT: a string object where the obj->ptr void pointer
      is casted to a long.
      
      This commit introduces a experimental new encoding called
      REDIS_ENCODING_EMBSTR that implements an object represented by an sds
      string that is not modifiable but allocated in the same memory chunk as
      the robj structure itself.
      
      The chunk looks like the following:
      
      +--------------+-----------+------------+--------+----+
      | robj data... | robj->ptr | sds header | string | \0 |
      +--------------+-----+-----+------------+--------+----+
                           |                       ^
                           +-----------------------+
      
      The robj->ptr points to the contiguous sds string data, so the object
      can be manipulated with the same functions used to manipulate plan
      string objects, however we need just on malloc and one free in order to
      allocate or release this kind of objects. Moreover it has better cache
      locality.
      
      This new allocation strategy should benefit both the memory usage and
      the performances. A performance gain between 60 and 70% was observed
      during micro-benchmarks, however there is more work to do to evaluate
      the performance impact and the memory usage behavior.
      894eba07
  6. 17 7月, 2013 1 次提交
  7. 09 7月, 2013 4 次提交
  8. 08 7月, 2013 4 次提交
    • G
      Mark places that might want changing for IPv6. · ca78446c
      Geoff Garside 提交于
      Any places which I feel might want to be updated to work differently
      with IPv6 have been marked with a comment starting "IPV6:".
      
      Currently the only comments address places where an IP address is
      combined with a port using the standard : separated form. These may want
      to be changed when printing IPv6 addresses to wrap the address in []
      such as
      
      	[2001:db8::c0:ffee]:6379
      
      instead of
      
      	2001:db8::c0:ffee:6379
      
      as the latter format is a technically valid IPv6 address and it is hard
      to distinguish the IPv6 address component from the port unless you know
      the port is supposed to be there.
      ca78446c
    • G
      Expand ip char buffers which are too small for v6. · 96b02dc0
      Geoff Garside 提交于
      Increase the size of character buffers being used to store printable IP
      addresses so that they can safely store IPv6 addresses.
      96b02dc0
    • G
      Mark ip string buffers which could be reduced. · f7d9a92d
      Geoff Garside 提交于
      In two places buffers have been created with a size of 128 bytes which
      could be reduced to INET6_ADDRSTRLEN to still hold a full IP address.
      These places have been marked as they are presently big enough to handle
      the needs of storing a printable IPv6 address.
      f7d9a92d
    • G
      Update anetTcpAccept & anetPeerToString calls. · f5494a42
      Geoff Garside 提交于
      Add the additional ip buffer length argument to function calls of
      anetTcpAccept and anetPeerToString in network.c and cluster.c
      f5494a42
  9. 30 5月, 2013 1 次提交
  10. 27 5月, 2013 2 次提交
    • A
      Replication: send REPLCONF ACK to master. · 0292c5f7
      antirez 提交于
      0292c5f7
    • A
      REPLCONF ACK command. · 6b4635f4
      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.
      6b4635f4
  11. 25 5月, 2013 3 次提交
  12. 06 3月, 2013 1 次提交
    • A
      API to lookup commands with their original name. · 7b190a08
      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.
      7b190a08
  13. 21 2月, 2013 1 次提交
  14. 12 2月, 2013 1 次提交
  15. 08 2月, 2013 1 次提交
  16. 05 2月, 2013 1 次提交
  17. 28 1月, 2013 1 次提交
    • A
      Fix decrRefCount() prototype from void to robj pointer. · 8766e810
      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.
      8766e810
  18. 19 1月, 2013 3 次提交
  19. 15 1月, 2013 2 次提交
    • A
      Typo fixed, ASCI -> ASCII. · 9b89ab06
      antirez 提交于
      9b89ab06
    • A
      CLIENT GETNAME and CLIENT SETNAME introduced. · 1971740f
      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.
      1971740f
  20. 03 1月, 2013 1 次提交
  21. 03 12月, 2012 2 次提交
    • A
      Memory leak fixed: release client's bpop->keys dictionary. · ab2924cf
      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.
      ab2924cf
    • A
      Blocking POP: use a dictionary to store keys clinet side. · 2f87cf8b
      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.
      2f87cf8b
  22. 09 11月, 2012 1 次提交
  23. 02 11月, 2012 1 次提交