m, basically the assumption is that our sample is representative of the whole key space, and we continue to expire until the percentage of keys that are likely to be expired is under 25%
这个概率算法是不重要的,主体上就是假设我们的样品代表了整个key空间,并且继续使key过期,直到有25%以上的key过期,然后开始第一步。
This means that at any given moment the maximum amount of keys already expired that are using memory is at max equal to max amount of write operations per second divided by 4.
意思是任何时刻,给出已经过期的最大数量key,这些过期key使用的最大内存等于每秒最大数量写操作除以4倍。
How expires are handled in the replication link and AOF file
在AOF文件和复制连接中过期是如何处理的
In order to obtain a correct behavior without sacrificing consistency, when a key expires, a DEL operation is synthesized in both the AOF file and gains all the attached slaves. This way the expiration process is centralized in the master instance, and there is no chance of consistency errors.
为了获得不牺牲一致性的正确做法,当一个key过期时,DEL操作将在AOF文件和所有的 slaves中同步。这种方式中,过期在master实例集中处理,并且避免产生改变一致性错误。
However while the slaves connected to a master will not expire keys independently (but will wait for the DEL coming from the master), they'll still take the full state of the expires existing in the dataset, so when a slave is elected to a master it will be able to expire the keys independently, fully acting as a master.
然而,当slaves连接到master上时,就不会独立地使key过期(但是会等待master DEL的到来),他们将使用所有在数据设置中有过期状态的key,因此当一个slave被推选成为master时,它将开始独立地去过期key,充当maste的角色。