论文部分内容阅读
State machine replication has been widely used in modern cluster-based database systems.Most commonly de-ployed configurations adopt the Raft-like consensus protocol,which has a single strong leader which replicates the log to other followers.Since the followers can handle read requests and many real workloads are usually read-intensive,the re-covery speed of a crashed follower may significantly impact on the throughput.Different from traditional database recov-ery,the recovering follower needs to repair its local log first.Original Raft protocol takes many network round trips to do log comparison between leader and the crashed follower.To reduce network round trips,an optimization method is to trun-cate the follower's uncertain log entries behind the latest local commit point,and then to directly fetch all committed log en-tries from the leader in one round trip.However,if the commit point is not persisted,the recovering follower has to get the whole log from the leader.In this paper,we propose an ac-curate and efficient log repair(AELR)algorithm for follower recovery.AELR is more robust and resilient to follower fail-ure,and it only needs one network round trip to fetch the least number of log entries for follower recovery.This approach is implemented in the open source database system OceanBase.We experimentally show that the system adopting AELR has a good performance in terms of recovery time.