Chronicle队列硬掉电恢复

Chronicle queue hard power failure recovery

写入 Chronicle Queue 时,默认写入不会刷新到磁盘,所以我相信 linux 内核脏页缓存中的任何内容都会丢失。在发生电源故障时确保恢复的最佳方法是什么?电池支持的 raid 阵列以及写入时强制刷新是否是一个好方法?或者在假设安全记录写入之前,使用来自第二台机器的 ack 的复制更好?这些方法中的哪一个具有最好的性能?理论上,如果在同一电网上,停电可能会影响两台机器....

anything that is in the linux kernel dirty page cache is lost.

What's the best approach to get guaranteed recovery in the event of power failure?

将数据复制到第二台或第三台机器。这样即使无法恢复整个 machine/data 中心,您也可以继续操作而不会丢失数据。

Would a battery backed raid array along with enforced flush on write be a good approach?

你必须相信硬件的可靠性,这是 Chronicle 无法保证的,我们的许多客户以前都被烧毁过。

Or is it better to use replication with an ack from the second machine before assuming the write is safely recorded?

这取决于您的要求。这是我们认为的最佳做法,尽管许多客户认为他们不需要此选项。

另一种方法是将数据复制到辅助机器并让辅助机器处理数据。这可以将引入的网络延迟减半。

Which of these approaches would have the best performance?

最好的表现是假设在发生故障时将使用手动过程并愿意接受小的损失。在这种情况下,您尽快处理所有事情。

注意:有一些替代方案。

  • 您可以只等待关键消息的确认,其他消息类型可以立即处理。
  • 您可以允许 window 如果未确认的消息不超过 N 条,您可以在其中处理消息。

Theoretically the power failure could affect both machines if on the same power grid....

这就是 2+1 复制可能是一种选择的地方。一台附近的备份服务器,用于在机架或机架的一部分发生故障时恢复正常运行。一个异地备份,复制速度较慢,但​​失败的可能性也很小。