基于高并发的分布式系统幂等设计

2022,30(3):234-238
王磊, 孟利民
浙江工业大学 信息工程学院
摘要:随着数字生活不断发展,分布式系统被广泛用来解决高并发等一系列问题。为了保证数据的准确性和一致性,分布式系统需要做幂等控制。通过分析对比各服务端幂等设计方法在高并发场景下的性能表现,提出一种改进的分布式锁设计方法。该方法主要解决由于集群服务主节点宕机可能造成分布式锁失效的问题,通过探讨RedLock算法方案及争论,提出对高并发请求二次拦截的理论,并将失效的锁通过消息队列服务进行通知,实现锁失效问题的排查以及服务监测治理。经实验测试表明,该方法实现了对失效锁的拦截,在高并发场景下有良好的性能表现,为分布式系统幂等设计提供了可行性方案。
关键词:分布式系统;高并发;数据一致性;幂等性;分布式锁

IDEMPOTENT DESISN OF DISTRIBUTED SYSTEMS BASED ON HIGH CONCURRENCY

孟利民
Abstract:With the development of Digital life, the distributed systems are widely used to solve a series of problems such as high concurrency. In order to ensure the accuracy and consistency of data, distributed systems need to design idempotent control. By analyzing and comparing the performance of each idempotent design method in high concurrency scenarios, an improved distributed lock design method is proposed. This method mainly solves the problem that the distributed lock may fail due to the downtime of the cluster service master node, by discussing the RedLock algorithm scheme and controversy, by discussing the RedLock algorithm scheme and controversy, propose the theory of secondary interception of high concurrent requests, and notify the invalid lock through the message queue service, realize lock failure troubleshooting and service monitoring and management. Experimental tests show that this method achieves the interception of invalid locks, has good performance in high concurrency scenarios, and provides a feasible solution for the idempotent design of distributed systems.
Key words:distributed systems; high concurrency; data consistency; idempotence; distributed lock
收稿日期:2021-09-14
基金项目:国家自然科学(61871349),浙江省自然科学(LQ19F010013)
     下载PDF全文