|
14 | 14 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
15 | 15 | <meta name="theme-color" content="#ffffff"> |
16 | 16 |
|
17 | | - <title>Flashback TiKV</title> |
| 17 | + <title>Flashback TiKV Chinese</title> |
18 | 18 | <style> |
19 | 19 | .main { |
20 | 20 | padding: 20px 10px; |
|
38 | 38 | } |
39 | 39 | </style> |
40 | 40 | <!-- Begin Jekyll SEO tag v2.8.0 --> |
41 | | -<title>Flashback TiKV</title> |
| 41 | +<title>Flashback TiKV Chinese</title> |
42 | 42 | <meta name="generator" content="Jekyll v4.3.2" /> |
43 | | -<meta property="og:title" content="Flashback TiKV" /> |
| 43 | +<meta property="og:title" content="Flashback TiKV Chinese" /> |
44 | 44 | <meta property="og:locale" content="en_US" /> |
45 | 45 | <link rel="canonical" href="http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html" /> |
46 | 46 | <meta property="og:url" content="http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html" /> |
47 | 47 | <meta property="og:type" content="article" /> |
48 | 48 | <meta property="article:published_time" content="2023-05-20T17:43:28+08:00" /> |
49 | 49 | <meta name="twitter:card" content="summary" /> |
50 | | -<meta property="twitter:title" content="Flashback TiKV" /> |
| 50 | +<meta property="twitter:title" content="Flashback TiKV Chinese" /> |
51 | 51 | <script type="application/ld+json"> |
52 | | -{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2023-05-20T17:43:28+08:00","datePublished":"2023-05-20T17:43:28+08:00","headline":"Flashback TiKV","mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html"},"url":"http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html"}</script> |
| 52 | +{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2023-05-20T17:43:28+08:00","datePublished":"2023-05-20T17:43:28+08:00","headline":"Flashback TiKV Chinese","mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html"},"url":"http://localhost:4000/distributed/2023/05/20/Flashback-in-TiKV.html"}</script> |
53 | 53 | <!-- End Jekyll SEO tag --> |
54 | 54 |
|
55 | 55 | </head> |
|
74 | 74 |
|
75 | 75 | <div class="snowframe"> |
76 | 76 |
|
77 | | - <h1>Flashback TiKV</h1> |
| 77 | + <h1>Flashback TiKV Chinese</h1> |
78 | 78 |
|
79 | 79 |
|
80 | 80 |
|
@@ -349,14 +349,14 @@ <h4 id="prepare-flashback">Prepare Flashback</h4> |
349 | 349 |
|
350 | 350 | <p>Admin request 通过 RaftStoreRouter 构成一条 RaftCommand 发送,会按照 Propose 流程,通过 pre_propose 的检查后到 PeerFsmDelegate.fsm.peer.propose 完成 Propose 一条 Raft Log。</p> |
351 | 351 |
|
352 | | -<p>之后PeerFsm会将 Proposal 以及已提交日志发送给对应的 ApplyFsm来到 apply 流程。</p> |
| 352 | +<p>之后 PeerFsm 会将 Proposal 以及已提交日志发送给对应的 ApplyFsm 来到 apply 流程。</p> |
353 | 353 |
|
354 | | -<p>ApplyFsm会针对这些日志进行(见 ApplyFsm::handle_apply):</p> |
| 354 | +<p>ApplyFsm 会针对这些日志进行(见 ApplyFsm::handle_apply):</p> |
355 | 355 |
|
356 | 356 | <ol> |
357 | 357 | <li>完成数据的持久化。</li> |
358 | 358 | <li>向 PeerFsm发送 ApplyRes,用于更新 PeerFsm中的 Region 状态。 |
359 | | - 在 exec_raft_cmd 会加上 check_flashback_state,进行 Flashback 持久态的判断。此处 region 将在下面的 exec 函数中设置上,由于为串行 apply,因此在下条 cmd 来之前,便会设置好 region 信息。</li> |
| 359 | + 在 exec_raft_cmd 会加上 check_flashback_state,进行 Flashback 持久态的判断。此处 region 将在下面的 exec 函数中设置上,由于为串行 apply,因此在下条 cmd 来之前,便会设置好 region 信息。</li> |
360 | 360 | </ol> |
361 | 361 |
|
362 | 362 | <div class="language-rust highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">check_flashback_state</span><span class="p">(</span><span class="k">self</span><span class="py">.region</span><span class="nf">.get_is_in_flashback</span><span class="p">());</span> |
@@ -429,7 +429,7 @@ <h4 id="停读">停读</h4> |
429 | 429 |
|
430 | 430 | <p>这样很自然地对于除 ReadLocal 和 StaleRead 外的 req,都可以做出以下隔断:</p> |
431 | 431 |
|
432 | | -<p>在进入 read 之前,判断一下 req 中是否有 Flashback 参数,便实现了在开启 Flashback 之后,只能让 Flashback 相关的读指令通行。</p> |
| 432 | +<p>在进入 read 之前,判断一下 req 中是否有 Flashback flag,便实现了在开启 Flashback 之后,只能让 Flashback 相关的读指令通行。</p> |
433 | 433 |
|
434 | 434 | <div class="language-rust highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">fn</span> <span class="nf">exec_snapshot</span><span class="p">()</span> <span class="p">{</span> |
435 | 435 | <span class="o">...</span> |
@@ -670,13 +670,19 @@ <h3 id="改进点">改进点</h3> |
670 | 670 |
|
671 | 671 | <h3 id="参考文档">参考文档</h3> |
672 | 672 |
|
673 | | -<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-read">TiKV 源码阅读三部曲(二)读流程 来阅读详细读过程</a> |
674 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-write">TiKV 源码阅读三部曲(三)写流程</a> |
675 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-7">TiKV 源码解析系列文章(七)gRPC Server 的初始化和启动流程</a> |
676 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-12/">TiKV 源码解析系列文章(十二)分布式事务</a> |
677 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-13">TiKV 源码解析系列文章(十三)MVCC 数据读取</a> |
678 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-17">TiKV 源码解析系列文章(十七)raftstore 概览</a> |
679 | | -<a href="https://cn.pingcap.com/blog/tikv-source-code-reading-18">TiKV 源码解析系列文章(十八)Raft Propose 的 Commit 和 Apply 情景分析</a></p> |
| 673 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-read">TiKV 源码阅读三部曲(二)读流程 来阅读详细读过程</a></p> |
| 674 | + |
| 675 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-write">TiKV 源码阅读三部曲(三)写流程</a></p> |
| 676 | + |
| 677 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-7">TiKV 源码解析系列文章(七)gRPC Server 的初始化和启动流程</a></p> |
| 678 | + |
| 679 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-12/">TiKV 源码解析系列文章(十二)分布式事务</a></p> |
| 680 | + |
| 681 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-13">TiKV 源码解析系列文章(十三)MVCC 数据读取</a></p> |
| 682 | + |
| 683 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-17">TiKV 源码解析系列文章(十七)raftstore 概览</a></p> |
| 684 | + |
| 685 | +<p><a href="https://cn.pingcap.com/blog/tikv-source-code-reading-18">TiKV 源码解析系列文章(十八)Raft Propose 的 Commit 和 Apply 情景分析</a></p> |
680 | 686 |
|
681 | 687 |
|
682 | 688 | </div> |
|
0 commit comments