- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
Paxos 算法(http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf)中有一点我不明白。这是关于如何处理差距的问题,论文描述了以下两种方式:
The leader, as well as any other server that learns all the commands the leader knows, can now execute commands 1–135. However, it can’t execute commands 138–140, which it also knows, because commands 136 and 137 have yet to be chosen. The leader could take the next two commands requested by clients to be commands 136 and 137. Instead, we let it fill the gap immediately by proposing, as commands 136 and 137, a special “no- op” command that leaves the state unchanged. (It does this by executing phase 2 of instances 136 and 137 of the consensus algorithm.) Once these no-op commands have been chosen, commands 138–140 can be executed.
已经提到了第二个选项Why is it legit to use no-op to fill gaps between paxos events .
我的问题是关于第一个问题。在我看来,采取接下来的两个命令将违反一致性,因为稍后发生的实例可能具有较小的序列号。那为什么它仍然是合法的呢?
最佳答案
由于所有客户端都看到相同的一致结果,因此不存在违反一致性的情况。所以不存在违反算法不变量的情况。
如果您考虑所有命令都来自单个客户端的场景,那么与客户端发送值的顺序相比,这将是重新排序。如果单个客户端是多线程的,并且如果它流式传输多个并发请求,则重新排序可能是无害的(或无害,取决于应用程序语义)。如果您认为领导者使用 noop,那么它实际上只是丢弃一些消息,这些消息可能对客户端无害,这取决于它流式传输的值的顺序。这取决于应用程序。
如果您考虑所有值都来自不同客户端的情况,那么情况就自然得多。在不利条件下,会发生一些重新排序。然而,在正常运行下不会发生这种情况。重新排序看起来就像一些值“比正常情况下花费更长的时间”被领导者修复,而其他客户发布的后来值“运行得更快”。
关于algorithm - 为什么使用接下来的两个命令来填补 paxos 事件之间的空白是合法的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47013036/
这个问题困扰了我一段时间,因为我一直在寻找一种有效的方法。基本上,我有一个数据框,每行都有一个来自实验的数据样本。我想这应该更多地被视为来自实验的日志文件,而不是用于分析的数据的最终版本。 我遇到的问
我有一个带有 IDENTITY 列的表 [Id] int IDENTITY(1, 1) NOT NULL 在添加/删除了一些行之后,我以 Id 值的差距结束: Id Name ---------
我有一个发票表,我在其中存储给定数据范围的发票(即 2012-01-01 到 2012-01-31 之间日期的发票 1)。现在有几天可能没有关联的发票,所以你会有 > ID | START_DATE
我正在查询 DATE 字段: SELECT DATE , FIELD2 , FIELD3 into Table_new FROM Table_old WHERE (crite
我有下表 data_users id | signed_up_at | product_id -------+---------------------------------
抱歉这个模糊的主题,但我想不出该放什么。 这是我的问题,我正在对一个表进行查询,该表返回与一天相关的项目计数。我想确保如果我对数据库进行查询,我总是会得到一定数量的行。例如,假设我有下表,其中包含人们
这个问题在这里已经有了答案: Why does CSS Grid layout add extra gaps between cells? (4 个答案) CSS-only masonry layo
给定数据框 df = pd.DataFrame(data=[[1,1,3],[1,2,6],[1,4,3],[2,2,6]],columns=['ID','Day','Value']) df Out[
我有以日期时间为索引的 Pandas DataFrame(从 .csv 加载).. 每天有/必须有一个条目。问题是我有差距,即有些日子我根本没有数据。在间隙中插入行(天)的最简单方法是什么?还有一种方
我只想用最简单的术语对 3D 数据集进行插值。线性插值,最近邻,这就足够了(这是开始一些算法,所以不需要准确估计)。 在新的 scipy 版本中,像 griddata 这样的东西会很有用,但目前我只有
我有一个类似于下面示例的多维数组,我想使用 Ruby 的 zip 方法将其组合在一起。当每个内部数组具有相同数量的元素时,我可以正常工作,但当它们的长度不同时,我会遇到问题。 在下面的示例中,第二组在
我有一个由日期和一些值组成的数组或对象: var flatData = [ { "date": "2012-05-26", "product": "apple" }, { "date
我有一个带有列 Age 的表格, Period和 Year .栏目Age总是从 0 开始并且没有固定的最大值(我在这个例子中使用了 'Age' 0 到 30,但范围也可以是 0 到 100 等),值
在 SQL Server 2014 中,我有一个如下所示的 Periods 表: | PeriodId | PeriodStart | PeriodEnd | -------------------
在 SQL Server 2014 中,我有一个如下所示的 Periods 表: | PeriodId | PeriodStart | PeriodEnd | -------------------
我正在尝试在 NVD3.js 中制作水平分组堆叠条形图。一切都很好,直到我的 JSON 数据出现“差距”,如下所示: [{ "key": "Education & news",
我想修改一个 pandas MultiIndex DataFrame,使每个索引组都包含指定范围之间的日期。我希望每个组用值 0(或 NaN)填写缺失的日期 2013-06-11 到 2013-12-
我是一名优秀的程序员,十分优秀!