You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
+++
title = "Raft共识协议的一些细节"
date = 2022-10-13
[taxonomies]
tags=["Raft","分布式"]
+++
Log compact机制
snapshot中需要对log进行compact,防止log过多对服务造成大量压力。
compact策略
- 执行snapshot时,删除上次snapshot之前的数据
- 执行snapshot时,固定保留最后n条entry
- leader计算近期(分钟级别)心跳中所有follower的next_index最小值,再保留前n条entry