1. 27 Feb, 2013 2 commits
    • Stam He's avatar
      add a check for aeCreateTimeEvent · e431a976
      Stam He authored
      1) Add a check for aeCreateTimeEvent in function initServer.
      e431a976
    • Stam He's avatar
      Set proctitle: avoid the use of __attribute__((constructor)). · 9c8be6ca
      Stam He authored
      This cased a segfault in some Linux system and was GCC-specific.
      
      Commit modified by @antirez:
      
      1) Stripped away the part to set the proc title via config for now.
      2) Handle initialization of setproctitle only when the replacement
         is used.
      3) Don't require GCC now that the attribute constructor is no
         longer used.
      9c8be6ca
  2. 26 Feb, 2013 1 commit
    • antirez's avatar
      Set process name in ps output to make operations safer. · 6356cf68
      antirez authored
      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.
      6356cf68
  3. 25 Feb, 2013 2 commits
  4. 20 Feb, 2013 1 commit
  5. 15 Feb, 2013 1 commit
  6. 14 Feb, 2013 1 commit
  7. 12 Feb, 2013 5 commits
  8. 08 Feb, 2013 1 commit
  9. 07 Feb, 2013 1 commit
  10. 05 Feb, 2013 2 commits
    • antirez's avatar
      b70b459b
    • charsyam's avatar
      Turn off TCP_NODELAY on the slave socket after SYNC. · c85647f3
      charsyam authored
      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.
      c85647f3
  11. 28 Jan, 2013 4 commits
  12. 19 Jan, 2013 4 commits
    • antirez's avatar
      Whitelist SIGUSR1 to avoid auto-triggering errors. · 79a0ef62
      antirez authored
      This commit fixes issue #875 that was caused by the following events:
      
      1) There is an active child doing BGSAVE.
      2) flushall is called (or any other condition that makes Redis killing
      the saving child process).
      3) An error is sensed by Redis as the child exited with an error (killed
      by a singal), that stops accepting write commands until a BGSAVE happens
      to be executed with success.
      
      Whitelisting SIGUSR1 and making sure Redis always uses this signal in
      order to kill its own children fixes the issue.
      79a0ef62
    • antirez's avatar
      Clear server.shutdown_asap on failed shutdown. · ab247fc1
      antirez authored
      When a SIGTERM is received Redis schedules a shutdown. However if it
      fails to perform the shutdown it must be clear the shutdown_asap flag
      otehrwise it will try again and again possibly making the server
      unusable.
      ab247fc1
    • antirez's avatar
      Slowlog: don't log EXEC but just the executed commands. · 08d200ba
      antirez authored
      The Redis Slow Log always used to log the slow commands executed inside
      a MULTI/EXEC block. However also EXEC was logged at the end, which is
      perfectly useless.
      
      Now EXEC is no longer logged and a test was added to test this behavior.
      
      This fixes issue #759.
      08d200ba
    • guiquanz's avatar
      Fixed many typos. · 9d09ce39
      guiquanz authored
      9d09ce39
  13. 16 Jan, 2013 1 commit
  14. 10 Jan, 2013 1 commit
  15. 14 Dec, 2012 1 commit
    • antirez's avatar
      serverCron() frequency is now a runtime parameter (was REDIS_HZ). · f1481d4a
      antirez authored
      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.
      f1481d4a
  16. 29 Nov, 2012 1 commit
    • antirez's avatar
      Introduced the Build ID in INFO and --version output. · 2f62c966
      antirez authored
      The idea is to be able to identify a build in a unique way, so for
      instance after a bug report we can recognize that the build is the one
      of a popular Linux distribution and perform the debugging in the same
      environment.
      2f62c966
  17. 22 Nov, 2012 2 commits
    • antirez's avatar
      EVALSHA is now case insensitive. · 95f68f7b
      antirez authored
      EVALSHA used to crash if the SHA1 was not lowercase (Issue #783).
      Fixed using a case insensitive dictionary type for the sha -> script
      map used for replication of scripts.
      95f68f7b
    • antirez's avatar
      Safer handling of MULTI/EXEC on errors. · 3d139127
      antirez authored
      After the transcation starts with a MULIT, the previous behavior was to
      return an error on problems such as maxmemory limit reached. But still
      to execute the transaction with the subset of queued commands on EXEC.
      
      While it is true that the client was able to check for errors
      distinguish QUEUED by an error reply, MULTI/EXEC in most client
      implementations uses pipelining for speed, so all the commands and EXEC
      are sent without caring about replies.
      
      With this change:
      
      1) EXEC fails if at least one command was not queued because of an
      error. The EXECABORT error is used.
      2) A generic error is always reported on EXEC.
      3) The client DISCARDs the MULTI state after a failed EXEC, otherwise
      pipelining multiple transactions would be basically impossible:
      After a failed EXEC the next transaction would be simply queued as
      the tail of the previous transaction.
      3d139127
  18. 12 Nov, 2012 1 commit
  19. 11 Nov, 2012 1 commit
    • antirez's avatar
      MIGRATE TCP connections caching. · e23d281e
      antirez authored
      By caching TCP connections used by MIGRATE to chat with other Redis
      instances a 5x performance improvement was measured with
      redis-benchmark against small keys.
      
      This can dramatically speedup cluster resharding and other processes
      where an high load of MIGRATE commands are used.
      e23d281e
  20. 08 Nov, 2012 1 commit
  21. 07 Nov, 2012 2 commits
    • antirez's avatar
      COPY and REPLACE options for MIGRATE. · 1237d71c
      antirez authored
      With COPY now MIGRATE does not remove the key from the source instance.
      With REPLACE it uses RESTORE REPLACE on the target host so that even if
      the key already eixsts in the target instance it will be overwritten.
      
      The options can be used together.
      1237d71c
    • antirez's avatar
      REPLACE option for RESTORE. · e5b5763f
      antirez authored
      The REPLACE option deletes an existing key with the same name (if any)
      and materializes the new one. The default behavior without RESTORE is to
      return an error if a key already exists.
      e5b5763f
  22. 06 Nov, 2012 1 commit
    • antirez's avatar
      Type mismatch errors are now prefixed with WRONGTYPE. · c4b0b685
      antirez authored
      So instead to reply with a generic error like:
      
      -ERR ... wrong kind of value ...
      
      now it replies with:
      
      -WRONGTYPE ... wrong kind of value ...
      
      This makes this particular error easy to check without resorting to
      (fragile) pattern matching of the error string (however the error string
      used to be consistent already).
      
      Client libraries should return a specific exeption type for this error.
      
      Most of the commit is about fixing unit tests.
      c4b0b685
  23. 01 Nov, 2012 2 commits
    • antirez's avatar
      More robust handling of AOF rewrite child. · 05d8e2c9
      antirez authored
      After the wait3() syscall we used to do something like that:
      
          if (pid == server.rdb_child_pid) {
              backgroundSaveDoneHandler(exitcode,bysignal);
          } else {
              ....
          }
      
      So the AOF rewrite was handled in the else branch without actually
      checking if the pid really matches. This commit makes the check explicit
      and logs at WARNING level if the pid returned by wait3() does not match
      neither the RDB or AOF rewrite child.
      05d8e2c9
    • Yecheng Fu's avatar
      fix typo in comments (redis.c, networking.c) · f0266532
      Yecheng Fu authored
      f0266532
  24. 22 Oct, 2012 1 commit