1. 10 10月, 2018 2 次提交
  2. 29 5月, 2018 1 次提交
    • A
      Don't expire keys while loading RDB from AOF preamble. · 01407a3a
      antirez 提交于
      The AOF tail of a combined RDB+AOF is based on the premise of applying
      the AOF commands to the exact state that there was in the server while
      the RDB was persisted. By expiring keys while loading the RDB file, we
      change the state, so applying the AOF tail later may change the state.
      
      Test case:
      
      * Time1: SET a 10
      * Time2: EXPIREAT a $time5
      * Time3: INCR a
      * Time4: PERSIT A. Start bgrewiteaof with RDB preamble. The value of a is 11 without expire time.
      * Time5: Restart redis from the RDB+AOF: consistency violation.
      
      Thanks to @soloestoy for providing the patch.
      Thanks to @trevor211 for the original issue report and the initial fix.
      
      Check issue #4950 for more info.
      01407a3a
  3. 13 2月, 2018 2 次提交
    • A
      Make it explicit with a comment why we kill the old AOF rewrite. · f1705801
      antirez 提交于
      See #3858.
      f1705801
    • G
      rewriteAppendOnlyFileBackground() failure fix · 0c030dea
      Guy Benoish 提交于
      It is possible to do BGREWRITEAOF even if appendonly=no. This is by design.
      stopAppendonly() didn't turn off aof_rewrite_scheduled (it can be turned on
      again by BGREWRITEAOF even while appendonly is off anyway).
      After configuring `appendonly yes` it will see that the state is AOF_OFF,
      there's no RDB fork, so it will do rewriteAppendOnlyFileBackground() which
      will fail since the aof_child_pid is set (was scheduled and started by cron).
      
      Solution:
      stopAppendonly() will turn off the schedule flag (regardless of who asked for it).
      startAppendonly() will terminate any existing fork and start a new one (so it is the most recent).
      0c030dea
  4. 18 1月, 2018 1 次提交
  5. 10 1月, 2018 4 次提交
  6. 06 7月, 2017 1 次提交
  7. 22 6月, 2017 2 次提交
  8. 20 4月, 2017 1 次提交
  9. 20 2月, 2017 1 次提交
  10. 09 11月, 2016 1 次提交
    • A
      PSYNC2: different improvements to Redis replication. · 2669fb83
      antirez 提交于
      The gist of the changes is that now, partial resynchronizations between
      slaves and masters (without the need of a full resync with RDB transfer
      and so forth), work in a number of cases when it was impossible
      in the past. For instance:
      
      1. When a slave is promoted to mastrer, the slaves of the old master can
      partially resynchronize with the new master.
      
      2. Chained slalves (slaves of slaves) can be moved to replicate to other
      slaves or the master itsef, without requiring a full resync.
      
      3. The master itself, after being turned into a slave, is able to
      partially resynchronize with the new master, when it joins replication
      again.
      
      In order to obtain this, the following main changes were operated:
      
      * Slaves also take a replication backlog, not just masters.
      
      * Same stream replication for all the slaves and sub slaves. The
      replication stream is identical from the top level master to its slaves
      and is also the same from the slaves to their sub-slaves and so forth.
      This means that if a slave is later promoted to master, it has the
      same replication backlong, and can partially resynchronize with its
      slaves (that were previously slaves of the old master).
      
      * A given replication history is no longer identified by the `runid` of
      a Redis node. There is instead a `replication ID` which changes every
      time the instance has a new history no longer coherent with the past
      one. So, for example, slaves publish the same replication history of
      their master, however when they are turned into masters, they publish
      a new replication ID, but still remember the old ID, so that they are
      able to partially resynchronize with slaves of the old master (up to a
      given offset).
      
      * The replication protocol was slightly modified so that a new extended
      +CONTINUE reply from the master is able to inform the slave of a
      replication ID change.
      
      * REPLCONF CAPA is used in order to notify masters that a slave is able
      to understand the new +CONTINUE reply.
      
      * The RDB file was extended with an auxiliary field that is able to
      select a given DB after loading in the slave, so that the slave can
      continue receiving the replication stream from the point it was
      disconnected without requiring the master to insert "SELECT" statements.
      This is useful in order to guarantee the "same stream" property, because
      the slave must be able to accumulate an identical backlog.
      
      * Slave pings to sub-slaves are now sent in a special form, when the
      top-level master is disconnected, in order to don't interfer with the
      replication stream. We just use out of band "\n" bytes as in other parts
      of the Redis protocol.
      
      An old design document is available here:
      
      https://gist.github.com/antirez/ae068f95c0d084891305
      
      However the implementation is not identical to the description because
      during the work to implement it, different changes were needed in order
      to make things working well.
      2669fb83
  11. 06 10月, 2016 1 次提交
    • A
      Module: Ability to get context from IO context. · 152c1b68
      antirez 提交于
      It was noted by @dvirsky that it is not possible to use string functions
      when writing the AOF file. This sometimes is critical since the command
      rewriting may need to be built in the context of the AOF callback, and
      without access to the context, and the limited types that the AOF
      production functions will accept, this can be an issue.
      
      Moreover there are other needs that we can't anticipate regarding the
      ability to use Redis Modules APIs using the context in order to build
      representations to emit AOF / RDB.
      
      Because of this a new API was added that allows the user to get a
      temporary context from the IO context. The context is auto released
      if obtained when the RDB / AOF callback returns.
      
      Calling multiple time the function to get the context, always returns
      the same one, since it is invalid to have more than a single context.
      152c1b68
  12. 19 9月, 2016 2 次提交
  13. 11 8月, 2016 1 次提交
  14. 09 8月, 2016 2 次提交
  15. 22 7月, 2016 1 次提交
    • A
      Avoid simultaneous RDB and AOF child process. · 0a628e51
      antirez 提交于
      This patch, written in collaboration with Oran Agra (@oranagra) is a companion
      to 780a8b1d. Together the two patches should avoid that the AOF and RDB saving
      processes can be spawned at the same time. Previously conditions that
      could lead to two saving processes at the same time were:
      
      1. When AOF is enabled via CONFIG SET and an RDB saving process is
         already active.
      
      2. When the SYNC command decides to start an RDB saving process ASAP in
         order to serve a new slave that cannot partially resynchronize (but
         only if we have a disk target for replication, for diskless
         replication there is not such a problem).
      
      Condition "1" is not very severe but "2" can happen often and is
      definitely good at degrading Redis performances in an unexpected way.
      
      The two commits have the effect of always spawning RDB savings for
      replication in replicationCron() instead of attempting to start an RDB
      save synchronously. Moreover when a BGSAVE or AOF rewrite must be
      performed, they are instead just postponed using flags that will try to
      perform such operations ASAP.
      
      Finally the BGSAVE command was modified in order to accept a SCHEDULE
      option so that if an AOF rewrite is in progress, when this option is
      given, the command no longer returns an error, but instead schedules an
      RDB rewrite operation for when it will be possible to start it.
      0a628e51
  16. 04 6月, 2016 1 次提交
  17. 25 4月, 2016 1 次提交
  18. 15 2月, 2016 1 次提交
  19. 17 11月, 2015 1 次提交
  20. 13 11月, 2015 1 次提交
  21. 01 10月, 2015 2 次提交
  22. 27 7月, 2015 3 次提交
  23. 26 7月, 2015 5 次提交
  24. 17 7月, 2015 1 次提交
  25. 21 1月, 2015 1 次提交
    • A
      AOF rewrite: set iterator var to NULL when freed. · 4433f5a7
      antirez 提交于
      The cleanup code expects that if 'di' is not NULL, it is a valid
      iterator that should be freed.
      
      The result of this bug was a crash of the AOF rewriting process if an
      error occurred after the DBs data are written and the iterator is no
      longer valid.
      4433f5a7