计算机与现代化 ›› 2023, Vol. 0 ›› Issue (09): 77-81.doi: 10.3969/j.issn.1006-2475.2023.09.012

• 算法设计与分析 • 上一篇    下一篇

基于概率模型的Raft协议形式化验证

  

  1. (华南师范大学计算机学院,广东 广州 510631)
  • 出版日期:2023-09-28 发布日期:2023-10-10
  • 作者简介:管金平(1997—),男,湖南衡阳人,硕士研究生,研究方向:模型检测,协议验证,E-mail: dubulingbo@163.com; 通信作者:杨晋吉(1968—),男,教授,博士,研究方向:模型检测,协议验证,E-mail: yangjj@scnu.edu.cn; 杨成龙(1996—),男,硕士研究生,研究方向:模型检测协议验证。
  • 基金资助:
    广东省自然科学基金资助项目(2020A1515010445)

Formal Verification of Raft Protocol Based on Probabilistic Model

  1. (School of Computer Science, South China Normal University, Guangzhou 510631, China)
  • Online:2023-09-28 Published:2023-10-10

摘要: 共识协议作为分布式系统的关键要素和核心组件,用于解决分布式场景下可能出现故障的节点间保证同一数据一致的问题,其准确性和高效性直接决定了系统的性能。Raft共识协议是目前分布式系统中常见且有效的算法。本文首先使用概率模型检测方法对Raft共识协议进行形式化建模,然后利用概率模型检测的属性规约技术对它的相关属性进行描述,最后通过模型检测工具验证并分析Raft共识协议的一致性和高效性。实验结果表明,Raft共识协议满足一致性,但是在领导者选举阶段,当跟随者维护的最新日志序号的差值范围增加时,选举回合数也会增多,使得整个服务周期选举时间增加,从而影响协议的执行效率。

关键词: 分布式系统, Raft共识协议, 概率模型检测, 形式化验证, 属性规约

Abstract:  Consensus protocol is important element and core component of distributed system, it is dedicated to solve the problem of ensuring the same data consistency among nodes that may fail in a distributed scenario, and its accuracy and efficiency directly determine the performance of the system. Raft consensus protocol is common and effective consensus algorithm in current distributed systems. This paper firstly models the Raft consensus protocol formally using a probabilistic model detection method, then describes its relevant properties using property spcification technique of probabilistic model checking, and finally verifies and analyses the consistency and efficiency of the Raft consensus protocol. The experimental results show that it satisfies consistency, but the number of election rounds increases during the leader election phase when the difference range of the latest log serial numbers maintained by followers increases, resulting in the election time increase throughout the service cycle, thus affecting the execution efficiency of Raft.

Key words: distributed system, Raft consensus protocol, probabilistic model checking, formal verification, property specification

中图分类号: