1. 03 2月, 2014 5 次提交
    • A
      Scripting: expire keys in scripts only at first access. · b089ba98
      antirez 提交于
      Keys expiring in the middle of the execution of Lua scripts are to
      create inconsistencies in masters and / or AOF files. See the following
      example:
      
          if redis.call("exists",KEYS[1]) == 1
          then
              redis.call("incr","mycounter")
          end
      
          if redis.call("exists",KEYS[1]) == 1
          then
              return redis.call("incr","mycounter")
          end
      
      The script executes two times the same *if key exists then incrementcounter*
      logic. However the two executions will work differently in the master and
      the slaves, provided some unlucky timing happens.
      
      In the master the first time the key may still exist, while the second time
      the key may no longer exist. This will result in the key incremented just one
      time. However as a side effect the master will generate a synthetic
      `DEL` command in the replication channel in order to force the slaves to
      expire the key (given that key expiration is master-driven).
      
      When the same script will run in the slave, the key will no longer be
      there, so the script will not increment the key.
      
      The key idea used to implement the expire-at-first-lookup semantics was
      provided by Marc Gravell.
      b089ba98
    • A
      Allow CONFIG and SHUTDOWN while in stale-slave state. · b770079f
      antirez 提交于
      b770079f
    • A
      Scripting: use mstime() and mstime_t for lua_time_start. · 89884e8f
      antirez 提交于
      server.lua_time_start is expressed in milliseconds. Use mstime_t instead
      of long long, and populate it with mstime() instead of ustime()/1000.
      
      Functionally identical but more natural.
      89884e8f
    • S
      Merge pull request #1534 from gdi2290/patch-1 · b0335287
      Salvatore Sanfilippo 提交于
      update copyright year
      b0335287
    • P
      update copyright year · 79270cae
      PatrickJS 提交于
      79270cae
  2. 31 1月, 2014 10 次提交
  3. 30 1月, 2014 4 次提交
  4. 29 1月, 2014 7 次提交
  5. 28 1月, 2014 4 次提交
  6. 25 1月, 2014 1 次提交
  7. 24 1月, 2014 1 次提交
  8. 23 1月, 2014 3 次提交
  9. 22 1月, 2014 3 次提交
  10. 20 1月, 2014 2 次提交
    • A
      Cluster: master nodes wait before rejoining the cluster after reboot. · 80e80668
      antirez 提交于
      One of the simple heuristics used by Redis Cluster in order to avoid
      losing data in the typical failure modes created by the asynchronous
      replication with the slaves (a master is unable, when accepting a
      write, to immediately tell if it should be really accepted or refused
      because of a configuration change), is to wait some time before to
      rejoin the cluster after being partitioned away from the majority of
      instances.
      
      A similar condition happens when a master is restarted. It does not know
      if it was already failed over, nor if all the clients have already an
      updated configuration about the cluster map, so it is possible that
      clients will try to write to stale masters that were restarted.
      
      In a similar way this commit changes masters behavior so they wait
      2000 milliseconds before accepting writes after a reboot. There is
      nothing special about 2 seconds if not to be a value supposedly larger
      a few orders of magnitude compared to the cluster bus communication
      latencies.
      80e80668
    • A
      Cluster: debug printf statemets removed. · e6970e20
      antirez 提交于
      These were committed for error after being inserted in order to fix an
      issue.
      e6970e20