Skip to content

Commit

Permalink
[FLINK-18422][docs] Update Prefer tag in documentation 'Fault Toleran…
Browse files Browse the repository at this point in the history
…ce training lesson'

This closes apache#12778
  • Loading branch information
RocMarshal committed Jul 6, 2020
1 parent f9a7dd9 commit c14f9d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/learn-flink/fault_tolerance.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ checkpoint, it has all of the sources record their offsets and insert numbered _
into their streams. These barriers flow through the job graph, indicating the part of the stream
before and after each checkpoint.

<img src="{{ site.baseurl }}/fig/stream_barriers.svg" alt="Checkpoint barriers are inserted into the streams" class="center" width="80%" />
<img src="{% link /fig/stream_barriers.svg %}" alt="Checkpoint barriers are inserted into the streams" class="center" width="80%" />

Checkpoint _n_ will contain the state of each operator that resulted from having consumed **every
event before checkpoint barrier _n_, and none of the events after it**.
Expand All @@ -149,7 +149,7 @@ with two input streams (such as a `CoProcessFunction`) perform _barrier alignmen
snapshot will reflect the state resulting from consuming events from both input streams up to (but
not past) both barriers.

<img src="{{ site.baseurl }}/fig/stream_aligning.svg" alt="Barrier alignment" class="center" width="100%" />
<img src="{% link /fig/stream_aligning.svg %}" alt="Barrier alignment" class="center" width="100%" />

Flink's state backends use a copy-on-write mechanism to allow stream processing to continue
unimpeded while older versions of the state are being asynchronously snapshotted. Only when the
Expand Down
4 changes: 2 additions & 2 deletions docs/learn-flink/fault_tolerance.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ Flink 使用 [Chandy-Lamport algorithm](https://en.wikipedia.org/wiki/Chandy-Lam

当 checkpoint coordinator(job manager 的一部分)指示 task manager 开始 checkpoint 时,它会让所有 sources 记录它们的偏移量,并将编号的 _checkpoint barriers_ 插入到它们的流中。这些 barriers 流经 job graph,标注每个 checkpoint 前后的流部分。

<img src="{% link fig/stream_barriers.svg %}" alt="Checkpoint barriers are inserted into the streams" class="center" width="80%" />
<img src="{% link /fig/stream_barriers.svg %}" alt="Checkpoint barriers are inserted into the streams" class="center" width="80%" />

Checkpoint _n_ 将包含每个 operator 的 state,这些 state 是对应的 operator 消费了**严格在 checkpoint barrier _n_ 之前的所有事件,并且不包含在此(checkpoint barrier _n_)后的任何事件**后而生成的状态。

当 job graph 中的每个 operator 接收到 barriers 时,它就会记录下其状态。拥有两个输入流的 Operators(例如 `CoProcessFunction`)会执行 _barrier 对齐(barrier alignment)_ 以便当前快照能够包含消费两个输入流 barrier 之前(但不超过)的所有 events 而产生的状态。

<img src="{% link fig/stream_aligning.svg %}" alt="Barrier alignment" class="center" width="100%" />
<img src="{% link /fig/stream_aligning.svg %}" alt="Barrier alignment" class="center" width="100%" />

Flink 的 state backends 利用写时复制(copy-on-write)机制允许当异步生成旧版本的状态快照时,能够不受影响地继续流处理。只有当快照被持久保存后,这些旧版本的状态才会被当做垃圾回收。

Expand Down

0 comments on commit c14f9d2

Please sign in to comment.