gpt4 book ai didi

transactions - 是否可以通过机器边界(通过 tcp-ip)进行交易?

转载 作者:可可西里 更新时间:2023-11-01 02:45:52 26 4
gpt4 key购买 nike

理论上,是否可以定义一个协议(protocol),其中一台机器对另一台机器(或多台)进行一些远程调用,并且在过程的任何部分,如果任何机器(或操作)发生故障,或者通信滴,一切都回滚了? (就像数据库一样)

我问这个,因为在硬件层面上,人们总是说没有原子处理器操作(测试和设置)就不能进行原子操作(事务的一个非常重要的组成部分)。

但既然现在我们谈论的是多台机器,这就不行了。

作为一个例子,这将是多么棘手:假设我有一个协议(protocol)可以在远程机器上发出命令,并得到响应。可能是调用了该方法,但在传输响应期间,连接中断了。也很可能是执行操作的机器认为一切正常,但接收机器从未得到答案。

添加 Ack 没有帮助,因为 ack 也可能在传输过程中丢失。

有兴趣阅读其他人的想法(并了解 27 年前的某个教授可能已经想出了一个坚如磐石的解决方案)。

R

最佳答案

是的,这个问题已经(或多或少)解决了:)

您正在寻找的是 Two-Phase Commit protocol .

In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of an atomic commitment protocol. It is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction on whether to commit or abort (roll back) the transaction. The protocol achieves its goal even in many cases of system failure (involving either process, network node, communication, etc. failures), and is thus widely utilized.

关于transactions - 是否可以通过机器边界(通过 tcp-ip)进行交易?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1825732/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com