摘要
一致性问题是分布式领域中的经典问题.在保证可用性和分区容错性的前提下,如何在尽可能短的时间内达到最终一致性仍然是一个挑战性的课题.文中主要针对Raft算法中的事务磁盘持久化和日志的网络同步部分,在复制状态机中的日志模块中增加了内存缓冲池,当一段时间内通信正常,未出错的情况下,将Raft算法中节点日志的更新方式由单次同步改进为批量异步.在持久化部分,采用文件如果超出设定的大小则调用fsync方法写入磁盘.最后,通过实验验证了改进后的Raft算法比原始的Raft算法选举Leader节点的效率高.因此,文中方法提高了Leader节点的选举效率,进而缩短了集群出现故障后恢复服务的时间.
Consistency is the classical problem in the field of the distributed systems.Under the premise of ensuring the availability and partition tolerance,how to achieve the eventual consistency as fast as possible is still a challenging task.This paper focuses on the persistency of transaction and the log synchronization on the network of the Raft algorithm.We add the buffer pool in the log module of the replicated state machine.If the communication between the nodes is normal and without failure for a period of time,Raft algorithm will change the updating mode from one item per time with synchronization to multiple items per time with asynchronization.In the persistence part,if the size of the file surpasses what we defined,the algorithm will call fsync function to write the file onto the disk.The experimental result proves that the improved algorithm has higher efficiency of selecting the Leader node than the original algorithm.Therefore,the proposed method in this paper improves the efficiency of selecting the Leader node and reduces the recovery time if some fault takes place in the cluster.
作者
陈陆
黄树成
徐克辉
CHEN Lu;HUANG Shucheng;XU Kehui(School of Computer Science,Jiangsu University of Science and Technology,Zhenjiang 212003,China;No.724 Research Institute of CSIC,Nanjing 211153,China)
出处
《江苏科技大学学报(自然科学版)》
CAS
2018年第4期559-563,共5页
Journal of Jiangsu University of Science and Technology:Natural Science Edition
基金
国家自然科学基金资助项目(61572498)