板条箱写入行为

Crate write behaviour

我对 crate 写入行为有疑问。

来自板条箱文档

One reason is that replicas are written synchronously. Thus making a write task wait for the replicas to be written somewhere in a data center hundreds of miles away can lead to noticeable latency and cause the cluster to slow down.

如果我有一个由三个节点组成的集群,如果一个节点发生故障,当我插入一些数据时会有什么行为?它会失败还是 crate 会在启动时与关闭的节点同步数据?

问候 阿尔宾

如这里所写:https://crate.io/docs/en/latest/storage_consistency.html?highlight=quorum

Write operations are handled differently than reads. Such operations are synchronous over all active replicas with the following flow:

The primary shard and the active replicas are looked up in the cluster state for the given operation. The primary shard and a quorum of the configured replicas need to be available for this step to succeed.

...

默认的法定人数是:

int( (primary + number_of_replicas) / 2 ) + 1

所以只要达到法定人数就不会失败。 在故障节点将再次正常运行后,如果副本尚未在另一个 运行 节点上创建,crate 将负责在该节点上再次创建副本。