1. 12 5月, 2014 1 次提交
  2. 25 3月, 2014 1 次提交
    • M
      Fix data loss when save AOF/RDB with no free space · 88c6c669
      Matt Stancliff 提交于
      Previously, the (!fp) would only catch lack of free space
      under OS X.  Linux waits to discover it can't write until
      it actually writes contents to disk.
      
      (fwrite() returns success even if the underlying file
      has no free space to write into.  All the errors
      only show up at flush/sync/close time.)
      
      Fixes antirez/redis#1604
      88c6c669
  3. 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
  4. 11 12月, 2013 2 次提交
    • 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
      Don't send more than 1 newline/sec while loading RDB. · 303cc97f
      antirez 提交于
      303cc97f
  5. 10 12月, 2013 1 次提交
    • A
      Slaves heartbeat while loading RDB files. · 75bf5a4a
      antirez 提交于
      Starting with Redis 2.8 masters are able to detect timed out slaves,
      while before 2.8 only slaves were able to detect a timed out master.
      
      Now that timeout detection is bi-directional the following problem
      happens as described "in the field" by issue #1449:
      
      1) Master and slave setup with big dataset.
      2) Slave performs the first synchronization, or a full sync
         after a failed partial resync.
      3) Master sends the RDB payload to the slave.
      4) Slave loads this payload.
      5) Master detects the slave as timed out since does not receive back the
         REPLCONF ACK acknowledges.
      
      Here the problem is that the master has no way to know how much the
      slave will take to load the RDB file in memory. The obvious solution is
      to use a greater replication timeout setting, but this is a shame since
      for the 0.1% of operation time we are forced to use a timeout that is
      not what is suited for 99.9% of operation time.
      
      This commit tries to fix this problem with a solution that is a bit of
      an hack, but that modifies little of the replication internals, in order
      to be back ported to 2.8 safely.
      
      During the RDB loading time, we send the master newlines to avoid
      being sensed as timed out. This is the same that the master already does
      while saving the RDB file to still signal its presence to the slave.
      
      The single newline is used because:
      
      1) It can't desync the protocol, as it is only transmitted all or
      nothing.
      2) It can be safely sent while we don't have a client structure for the
      master or in similar situations just with write(2).
      75bf5a4a
  6. 05 12月, 2013 1 次提交
  7. 08 11月, 2013 1 次提交
  8. 27 8月, 2013 1 次提交
  9. 20 8月, 2013 1 次提交
  10. 16 7月, 2013 1 次提交
  11. 08 7月, 2013 1 次提交
  12. 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
  13. 13 3月, 2013 2 次提交
  14. 27 2月, 2013 1 次提交
  15. 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
  16. 19 1月, 2013 2 次提交
    • A
      Whitelist SIGUSR1 to avoid auto-triggering errors. · 39f0a33f
      antirez 提交于
      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.
      39f0a33f
    • 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
  17. 19 11月, 2012 1 次提交
    • A
      Children creating AOF or RDB files now report memory used by COW. · c342b075
      antirez 提交于
      Finally Redis is able to report the amount of memory used by
      copy-on-write while saving an RDB or writing an AOF file in background.
      
      Note that this information is currently only logged (at NOTICE level)
      and not shown in INFO because this is less trivial (but surely doable
      with some minor form of interprocess communication).
      
      The reason we can't capture this information on the parent before we
      call wait3() is that the Linux kernel will release the child memory
      ASAP, and only retain the minimal state for the process that is useful
      to report the child termination to the parent.
      
      The COW size is obtained by summing all the Private_Dirty fields found
      in the "smap" file inside the proc filesystem for the process.
      
      All this is Linux specific and is not available on other systems.
      c342b075
  18. 09 11月, 2012 1 次提交
  19. 31 10月, 2012 1 次提交
  20. 27 9月, 2012 1 次提交
  21. 02 6月, 2012 1 次提交
    • A
      RDB type loading functions clarified in comments. · ebdcd723
      antirez 提交于
      Improved comments to make clear that rdbLoadType() just loads a
      general TYPE in the context of RDB that can be an object type or an
      expire type, end-of-file, and so forth.
      
      While rdbLoadObjectType() enforces that the type is a valid Object Type
      otherwise it returns -1.
      ebdcd723
  22. 25 5月, 2012 1 次提交
    • A
      Four new persistence fields in INFO. A few renamed. · 6b4d92e2
      antirez 提交于
      The 'persistence' section of INFO output now contains additional four
      fields related to RDB and AOF persistence:
      
       rdb_last_bgsave_time_sec       Duration of latest BGSAVE in sec.
       rdb_current_bgsave_time_sec    Duration of current BGSAVE in sec.
       aof_last_rewrite_time_sec      Duration of latest AOF rewrite in sec.
       aof_current_rewrite_time_sec   Duration of current AOF rewrite in sec.
      
      The 'current' fields are set to -1 if a BGSAVE / AOF rewrite is not in
      progress. The 'last' fileds are set to -1 if no previous BGSAVE / AOF
      rewrites were performed.
      
      Additionally a few fields in the persistence section were renamed for
      consistency:
      
       changes_since_last_save -> rdb_changes_since_last_save
       bgsave_in_progress -> rdb_bgsave_in_progress
       last_save_time -> rdb_last_save_time
       last_bgsave_status -> rdb_last_bgsave_status
       bgrewriteaof_in_progress -> aof_rewrite_in_progress
       bgrewriteaof_scheduled -> aof_rewrite_scheduled
      
      After the renaming, fields in the persistence section start with rdb_ or
      aof_ prefix depending on the persistence method they describe.
      The field 'loading' and related fields are not prefixed because they are
      unique for both the persistence methods.
      6b4d92e2
  23. 25 4月, 2012 1 次提交
  24. 10 4月, 2012 4 次提交
  25. 08 4月, 2012 1 次提交
  26. 07 4月, 2012 1 次提交
  27. 02 4月, 2012 1 次提交
  28. 24 3月, 2012 1 次提交
  29. 13 3月, 2012 2 次提交
  30. 10 3月, 2012 1 次提交
  31. 07 3月, 2012 1 次提交
    • A
      Refuse writes if can't persist on disk. · c25e7eaf
      antirez 提交于
      Redis now refuses accepting write queries if RDB persistence is
      configured, but RDB snapshots can't be generated for some reason.
      The status of the latest background save operation is now exposed
      in the INFO output as well. This fixes issue #90.
      c25e7eaf
  32. 17 2月, 2012 1 次提交
    • P
      Don't expire keys when loading an RDB after a SYNC · cb598cdd
      Pieter Noordhuis 提交于
      The cron is responsible for expiring keys. When keys are expired at
      load time, it is possible that the snapshot of a master node gets
      modified. This can in turn lead to inconsistencies in the data set.
      
      A more concrete example of this behavior follows. A user reported a
      slave that would show an monotonically increase input buffer length,
      shortly after completing a SYNC. Also, `INFO` output showed a single
      blocked client, which could only be the master link. Investigation
      showed that indeed the `BRPOP` command was fed by the master. This
      command can only end up in the stream of write operations when it did
      NOT block, and effectively executed `RPOP`. However, when the key
      involved in the `BRPOP` is expired BEFORE the command is executed, the
      client executing it will block. The client in this case, is the master
      link.
      cb598cdd
  33. 26 1月, 2012 1 次提交