{"id":100000,"date":"2020-04-27T14:47:20","date_gmt":"2020-04-27T06:47:20","guid":{"rendered":"http:\/\/4563.org\/?p=100000"},"modified":"2020-04-27T14:47:20","modified_gmt":"2020-04-27T06:47:20","slug":"tikv-%e6%ba%90%e7%a0%81%e8%a7%a3%e6%9e%90%e7%b3%bb%e5%88%97%e6%96%87%e7%ab%a0%ef%bc%88%e5%8d%81%e4%b8%83%ef%bc%89raftstore-%e6%a6%82%e8%a7%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=100000","title":{"rendered":"TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09raftstore \u6982\u89c8"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09raftstore \u6982\u89c8               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PingCAP <\/span>  <span><i><\/i> 77<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7b2c\u4e00\u4f5c\u8005\uff1a\u674e\u5efa\u4fca\uff0c\u7b2c\u4e8c\u4f5c\u8005\uff1a\u6768\u54f2\u8f69\uff0c\u738b\u806a<\/p>\n<p>TiKV \u4f5c\u4e3a\u4e00\u4e2a\u5206\u5e03\u5f0f KV \u6570\u636e\u5e93\uff0c\u4f7f\u7528 Raft \u7b97\u6cd5\u6765\u63d0\u4f9b\u5f3a\u4e00\u81f4\u6027\u3002Raft \u7b97\u6cd5\u63d0\u4f9b\u4e86\u5355\u4e00 group \u7684\u4e00\u81f4\u6027\uff0c\u4f46\u662f\u5355\u4e00 group \u65e0\u6cd5\u6269\u5c55\u548c\u5747\u8861\u3002\u56e0\u6b64\uff0cTiKV \u91c7\u7528\u4e86 MultiRaft \u7684\u65b9\u5f0f\u57fa\u4e8e Raft \u7b97\u6cd5\u63d0\u4f9b\u80fd\u517c\u987e\u4e00\u81f4\u6027\u3001\u6269\u5c55\u5747\u8861\u7684 KV \u50a8\u5b58\u3002\u4e0b\u6587\u4ee5 3.0 \u7248\u672c\u4ee3\u7801\u4e3a\u4f8b\uff0c\u8bb2\u8ff0 raftstore \u6e90\u7801\u4e2d\u7684\u5173\u952e\u5b9a\u4e49\u548c\u8bbe\u8ba1\u3002<\/p>\n<h2>MultiRaft<\/h2>\n<p>MultiRaft \u987e\u540d\u601d\u4e49\u5c31\u662f\u591a\u4e2a Raft group\u3002\u6570\u636e\u7ec4\u7ec7\u4e0a\uff0cTiKV \u5c06\u6570\u636e\u6309\u8303\u56f4\u5212\u5206\u6210\u591a\u4e2a\u5206\u7247\uff0c\u8fd9\u4e9b\u5206\u7247\u79f0\u4e4b\u4e3a region\u3002\u6bcf\u4e2a region \u7531\u4e00\u4e2a Raft group \u6765\u7ba1\u7406\u3002Raft group \u548c region \u662f\u4e00\u5bf9\u4e00\u7684\u5173\u7cfb\u3002\u7531\u4e0b\u65b9\u793a\u610f\u56fe\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a Raft group \u7ba1\u7406\u7684\u591a\u4e2a\u526f\u672c\u5206\u522b\u843d\u5728\u4e0d\u540c\u7684\u673a\u5668\u4e0a\uff0c\u4e00\u4e2a\u673a\u5668\u7684\u6570\u636e\u5305\u542b\u4e86\u591a\u4e2a\u4e0d\u540c region \u7684\u526f\u672c\u3002\u901a\u8fc7\u8fd9\u79cd\u7ec4\u7ec7\u65b9\u5f0f\uff0c\u6211\u4eec\u8ba9 Raft group \u5e76\u884c\u8d77\u6765\uff0c\u4ece\u800c\u5b9e\u73b0\u6269\u5c55\u548c\u5747\u8861\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7bf3f639d2.jpg\" alt=\"TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09raftstore \u6982\u89c8\" \/><\/p>\n<h2>Batch System<\/h2>\n<p>Batch System \u662f raftstore \u5904\u7406\u7684\u57fa\u77f3\uff0c\u662f\u4e00\u5957\u7528\u6765\u5e76\u53d1\u9a71\u52a8\u72b6\u6001\u673a\u7684\u673a\u5236\u3002\u72b6\u6001\u673a\u7684\u6838\u5fc3\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code>pub trait Fsm {     type Message: Send;       fn is_stopped(&amp;self) -&gt; bool; } <\/code><\/pre>\n<p>\u72b6\u6001\u673a\u901a\u8fc7 PollHandler \u6765\u9a71\u52a8\uff0c\u5176\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code>pub trait PollHandler&lt;N, C&gt; {     fn begin(&amp;mut self, batch_size: usize);     fn handle_control(&amp;mut self, control: &amp;mut C) -&gt; Option&lt;usize&gt;;     fn handle_normal(&amp;mut self, normal: &amp;mut N) -&gt; Option&lt;usize&gt;;     fn end(&amp;mut self, batch: &amp;mut [Box&lt;N&gt;]);     fn pause(&amp;mut self) {} } <\/code><\/pre>\n<p>\u5927\u4f53\u6765\u770b\uff0c\u72b6\u6001\u673a\u5206\u6210\u4e24\u79cd\uff0cnormal \u548c control\u3002\u5bf9\u4e8e\u6bcf\u4e00\u4e2a Batch System\uff0c\u53ea\u6709\u4e00\u4e2a control \u72b6\u6001\u673a\uff0c\u8d1f\u8d23\u7ba1\u7406\u548c\u5904\u7406\u4e00\u4e9b\u9700\u8981\u5168\u5c40\u89c6\u91ce\u7684\u4efb\u52a1\u3002\u5176\u4ed6 normal \u72b6\u6001\u673a\u8d1f\u8d23\u5904\u7406\u5176\u81ea\u8eab\u76f8\u5173\u7684\u4efb\u52a1\u3002\u6bcf\u4e2a\u72b6\u6001\u673a\u90fd\u6709\u5176\u7ed1\u5b9a\u7684\u6d88\u606f\u548c\u6d88\u606f\u961f\u5217\u3002PollHandler \u8d1f\u8d23\u9a71\u52a8\u72b6\u6001\u673a\uff0c\u5904\u7406\u81ea\u8eab\u961f\u5217\u4e2d\u7684\u6d88\u606f\u3002Batch System \u7684\u804c\u8d23\u5c31\u662f\u68c0\u6d4b\u54ea\u4e9b\u72b6\u6001\u673a\u9700\u8981\u9a71\u52a8\uff0c\u7136\u540e\u8c03\u7528 PollHandler \u53bb\u6d88\u8d39\u6d88\u606f\u3002\u6d88\u8d39\u6d88\u606f\u4f1a\u4ea7\u751f\u526f\u4f5c\u7528\uff0c\u800c\u8fd9\u4e9b\u526f\u4f5c\u7528\u6216\u8981\u843d\u76d8\uff0c\u6216\u8981\u7f51\u7edc\u4ea4\u4e92\u3002PollHandler \u5728\u4e00\u4e2a\u6279\u6b21\u4e2d\u53ef\u4ee5\u5904\u7406\u591a\u4e2a normal \u72b6\u6001\u673a\uff0c\u8fd9\u4e9b\u72b6\u6001\u673a\u5728\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165 end \u65b9\u6cd5\u65f6\u88ab\u547d\u540d\u4e3a batch\uff0c\u610f\u601d\u5c31\u662f\u526f\u4f5c\u7528\u4f1a\u88ab\u805a\u5408\uff0c\u4e00\u6279\u6279\u5730\u5904\u7406\u3002\u5177\u4f53\u5b9e\u73b0\u7ec6\u8282\uff0c\u540e\u9762\u7684\u6e90\u7801\u9605\u8bfb\u7ae0\u8282\u4f1a\u63d0\u5230\uff0c\u8fd9\u91cc\u5c31\u5148\u4e0d\u5c55\u5f00\u3002<\/p>\n<h2>RaftBatchSystem \u548c ApplyBatchSystem<\/h2>\n<p>\u5728 raftstore \u91cc\uff0c\u4e00\u5171\u6709\u4e24\u4e2a Batch System\u3002\u5206\u522b\u662f RaftBatchSystem \u548c ApplyBatchSystem\u3002RaftBatchSystem \u7528\u4e8e\u9a71\u52a8 Raft \u72b6\u6001\u673a\uff0c\u5305\u62ec\u65e5\u5fd7\u7684\u5206\u53d1\u3001\u843d\u76d8\u3001\u72b6\u6001\u8dc3\u8fc1\u7b49\u3002\u5f53\u65e5\u5fd7\u88ab\u63d0\u4ea4\u4ee5\u540e\u4f1a\u53d1\u5f80 ApplyBatchSystem \u8fdb\u884c\u5904\u7406\u3002ApplyBatchSystem \u5c06\u65e5\u5fd7\u89e3\u6790\u5e76\u5e94\u7528\u5230\u5e95\u5c42 KV \u6570\u636e\u5e93\u4e2d\uff0c\u6267\u884c\u56de\u8c03\u51fd\u6570\u3002\u6240\u6709\u7684\u5199\u64cd\u4f5c\u90fd\u9075\u5faa\u7740\u8fd9\u4e2a\u6d41\u7a0b\u3002 \u5f53\u5ba2\u6237\u7aef\u53d1\u8d77\u4e00\u4e2a\u8bf7\u6c42\u65f6\uff0cRaftBatchSystem \u4f1a\u5c06\u5176\u5e8f\u5217\u5316\u6210\u65e5\u5fd7\uff0c\u5e76\u63d0\u4ea4\u7ed9 raft\u3002\u4e00\u4e2a\u7b80\u5316\u7684\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7bf458398c.jpg\" alt=\"TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09raftstore \u6982\u89c8\" \/><\/p>\n<p>\u4ece\u4ee3\u7801\u6765\u770b\uff0c\u5e8f\u5217\u5316\u53d1\u751f\u5728 propose \u8fc7\u7a0b\u4e2d\u3002<\/p>\n<pre><code>fn propose_normal(&amp;mut self, req: RaftCmdRequest) -&gt; Result&lt;()&gt; {     let ctx = match self.pre_propose(poll_ctx, &amp;mut req)?;     let data = req.write_to_bytes()?;     self.raft_group.propose(ctx.to_vec(), data)?;     Ok(()) } <\/code><\/pre>\n<p>\u800c propose \u7684\u526f\u4f5c\u7528\u540e\u7eed\u4f1a\u901a\u8fc7 Raft \u5e93\u7684 Ready \u673a\u5236\u641c\u96c6\uff0cbatch \u5904\u7406\u3002<\/p>\n<pre><code>if !self.raft_group.has_ready_since(Some(self.last_applying_idx)) {     return None; }   let mut ready = self.raft_group.ready_since(self.last_applying_idx); self.mut_store().handle_raft_ready(ctx, &amp;ready); if !self.is_applying_snapshot() &amp;&amp; !ready.committed_entries.is_empty() {     let apply = Apply::new(self.region_id, self.term(), mem::replace(&amp;mut ready.committed_entries, vec![]));     apply_router         .schedule_task(self.region_id, ApplyTask::apply(apply)); } self.raft_group.advance_append(ready); <\/code><\/pre>\n<p>\u5728 PeerStorage \u7684 handle_raft_ready \u65b9\u6cd5\u4e2d\uff0c\u4f1a\u5c06\u6536\u96c6\u5230 Ready \u4e2d\u7684 Raft \u65e5\u5fd7\u6536\u96c6\u5230\u4e00\u4e2a WriteBatch \u4e2d\uff0c\u6700\u7ec8\u5728 RaftPoller \u7684 end \u65b9\u6cd5\u4e2d\u6279\u91cf\u5199\u5165\u78c1\u76d8\u3002\u800c Ready \u4e2d\u6536\u96c6\u5230\u7684\u786e\u8ba4\u8fc7\u7684 Raft \u65e5\u5fd7\uff0c\u4f1a\u88ab <code>apply_router<\/code> \u53d1\u9001\u5230 apply \u7ebf\u7a0b\u4e2d\uff0c\u7531 ApplyBatchSystem \u6765\u5904\u7406\u3002\u5173\u4e8e\u4e00\u4e2a\u5199\u5165\u5728 Raftstore \u6a21\u5757\u4e2d\u4ece\u63d0\u4ea4\u5230\u786e\u8ba4\u7684\u6574\u6761\u94fe\u8def\uff0c\u5c06\u5728\u540e\u7eed\u7684\u7ae0\u8282\u4e2d\u66f4\u8be6\u7ec6\u5730\u63a2\u8ba8\uff0c\u8fd9\u91cc\u5c31\u4e0d\u4f5c\u5c55\u5f00\u4e86\u3002<\/p>\n<h2>Split \u548c Merge<\/h2>\n<p>TiKV \u7684\u6bcf\u4e00\u4e2a Raft group \u90fd\u662f\u4e00\u4e2a Region \u7684\u5197\u4f59\u590d\u5236\u96c6\uff0c\u800c Region \u6570\u636e\u4e0d\u65ad\u589e\u51cf\u65f6\uff0c\u5b83\u7684\u5927\u5c0f\u4e5f\u4f1a\u4e0d\u65ad\u53d1\u751f\u53d8\u5316\uff0c\u56e0\u6b64\u5fc5\u987b\u652f\u6301 Region \u7684\u5206\u88c2\u548c\u5408\u5e76\uff0c\u624d\u80fd\u786e\u4fdd TiKV \u80fd\u591f\u957f\u65f6\u95f4\u7a33\u5b9a\u8fd0\u884c\u3002Region Split \u4f1a\u5c06\u4e00\u6bb5\u5305\u542b\u5927\u91cf\u6570\u636e\u7684 range \u5207\u5272\u6210\u591a\u4e2a\u5c0f\u6bb5\uff0c\u5e76\u521b\u5efa\u65b0\u7684 Raft Group \u8fdb\u884c\u7ba1\u7406\uff0c\u5982\u5c06 [a, z) \u5207\u5272\u6210 [a, h), [h, x) \u548c [x, z)\uff0c\u5e76\u4ea7\u751f\u4e24\u4e2a\u65b0\u7684 Raft group\u3002Region Merge \u5219\u4f1a\u5c06 2 \u4e2a\u76f8\u90bb\u7684 Raft group \u5408\u5e76\u6210\u4e00\u4e2a\uff0c\u5982 [a, h) \u548c [h, x) \u5408\u5e76\u6210 [a, x \uff09\u3002\u8fd9\u4e9b\u903b\u8f91\u4e5f\u5728 Raftstore \u6a21\u5757\u4e2d\u5b9e\u73b0\u3002\u8fd9\u4e9b\u7279\u6b8a\u7ba1\u7406\u64cd\u4f5c\u4e5f\u4f5c\u4e3a\u4e00\u4e2a\u7279\u6b8a\u7684\u5199\u547d\u4ee4\u8d70\u4e00\u904d\u4e0a\u8282\u6240\u8ff0\u7684 Raft propose\/commit\/apply \u6d41\u7a0b\u3002\u4e3a\u4e86\u4fdd\u8bc1 split\/merge \u524d\u540e\u7684\u5199\u547d\u4ee4\u4e0d\u4f1a\u843d\u5728\u9519\u8bef\u7684\u8303\u56f4\uff0c\u6211\u4eec\u7ed9 region \u52a0\u4e86\u4e00\u4e2a\u7248\u672c\u7684\u6982\u5ff5\u3002\u6bcf split \u4e00\u6b21\uff0c\u7248\u672c\u52a0\u4e00\u3002\u5047\u8bbe region A \u5408\u5e76\u5230 region B\uff0c\u5219 B \u7684\u7248\u672c\u4e3a max(versionB, versionA + 1) + 1\u3002\u66f4\u591a\u7684\u7ec6\u8282\u5b9e\u73b0\u5305\u62ec\u5404\u79cd corner case \u7684\u5904\u7406\u5728\u540e\u7eed\u6587\u7ae0\u4e2d\u5c55\u5f00\u3002<\/p>\n<h2>LocalReader<\/h2>\n<p>\u5bf9\u4e8e\u8bfb\u64cd\u4f5c\uff0c\u5982\u679c\u548c\u5199\u64cd\u4f5c\u6df7\u5728\u4e00\u8d77\uff0c\u4f1a\u5e26\u6765\u4e0d\u5fc5\u8981\u7684\u5ef6\u8fdf\u548c\u6296\u52a8\u3002\u6240\u4ee5 TiKV \u5b9e\u73b0\u4e86\u4e00\u4e2a\u5355\u72ec\u7684\u7ec4\u4ef6\u6765\u5904\u7406\u3002Raft group \u7684 leader \u4f1a\u7ef4\u62a4\u4e00\u4e2a lease \u673a\u5236\uff0c\u5bf9\u4e8e\u5728 lease \u5185\u6536\u5230\u7684\u8bf7\u6c42\uff0c\u4f1a\u7acb\u523b\u8fdb\u884c\u8bfb\u64cd\u4f5c\uff1b lease \u5916\u7684\u8bf7\u6c42\uff0c\u4f1a\u89e6\u53d1 lease \u7eed\u671f\u3002\u7eed\u671f\u662f\u901a\u8fc7\u5fc3\u8df3\u5b8c\u6210\u7684\u3002\u4e5f\u5c31\u662f\u8bfb\u64cd\u4f5c\u4e0d\u4f1a\u89e6\u53d1\u5199\u76d8\u884c\u4e3a\u3002Lease \u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code>pub struct RemoteLease {     expired_time: Arc&lt;AtomicU64&gt;,     term: u64, }   pub struct Lease {     \/\/ A suspect timestamp is in the Either::Left(_),     \/\/ a valid timestamp is in the Either::Right(_).     bound: Option&lt;Either&lt;Timespec, Timespec&gt;&gt;,     max_lease: Duration,       max_drift: Duration,     last_update: Timespec,     remote: Option&lt;RemoteLease&gt;, } <\/code><\/pre>\n<p>RemoteLease \u662f\u8bfb\u884c\u4e3a\u53d1\u751f\u7ebf\u7a0b\u91cc\u6240\u6301\u6709\u7684 lease\uff0c\u5b83\u7684\u72b6\u6001\u7531 Lease \u6765\u7ef4\u62a4\u3002Lease \u81ea\u8eab\u7531 RaftBatchSystem \u6765\u5b9e\u9645\u7ef4\u62a4\u3002bound \u8bb0\u5f55\u7684\u662f lease \u7684\u5931\u6548\u65f6\u95f4\uff0cmax_drift \u8868\u793a\u5141\u8bb8\u7cbe\u5ea6\u8bef\u5dee\u3002<\/p>\n<h2>Coprocessor<\/h2>\n<p>\u867d\u7136\u8bfb\u5199\u5df2\u7ecf\u5305\u542b\u4e86\u7edd\u5927\u591a\u6570 KV \u64cd\u4f5c\uff0c\u4f46\u662f\u6211\u4eec\u4ecd\u7136\u9700\u8981\u4e00\u4e9b\u7279\u6b8a\u673a\u5236\u6765\u81ea\u5b9a\u4e49\u884c\u4e3a\u3002\u6bd4\u5982\u4e3a\u4e86\u4fdd\u8bc1\u4e8b\u52a1\u6b63\u786e\uff0cregion \u5206\u88c2\u4e0d\u5e94\u8be5\u5c06\u540c\u4e00\u4e2a key \u7684 MVCC \u6570\u636e\u62c6\u5206\u5230\u4e0d\u540c\u7684 region \u91cc\u3002\u8fd9\u4e9b\u884c\u4e3a\u7531 Coprocessor \u6765\u5b9e\u73b0\u3002TiKV \u4e2d\u4e00\u5171\u6709\u4e24\u79cd Coprocessor\u3002\u4e4b\u524d\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u7684 SQL \u4e0b\u63a8\u903b\u8f91\u5c5e\u4e8e Endpoint\uff0c\u8fd9\u91cc\u4e3b\u8981\u6d89\u53ca\u7684\u662f Observer\u3002Observer \u7684\u4f5c\u7528\u662f\u76d1\u542c KV \u5904\u7406\u8fc7\u7a0b\u4e2d\u7684\u5404\u79cd\u4e8b\u4ef6\uff0c\u5e76\u5728\u4e8b\u4ef6\u53d1\u751f\u65f6\u6267\u884c\u81ea\u5b9a\u4e49\u903b\u8f91\u3002Coprocessor \u7684\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code>pub trait Coprocessor {     fn start(&amp;self) {}     fn stop(&amp;self) {} } <\/code><\/pre>\n<p>\u76ee\u524d\u5df2\u7ecf\u5b9a\u4e49\u7684 Coprocessor \u5305\u62ec AdminObserver\u3001QueryObserver\u3001SplitCheckObserver\u3001RoleObserver\u3001RegionChangeObserver\u3002\u62ff QueryObserver \u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre><code>pub trait QueryObserver: Coprocessor {     \/\/\/ Hook to call before proposing write request.     \/\/\/     \/\/\/ We don't propose read request, hence there is no hook for it yet.     fn pre_propose_query(&amp;self, _: &amp;mut ObserverContext&lt;'_&gt;, _: &amp;mut Vec&lt;Request&gt;) -&gt; Result&lt;()&gt; {         Ok(())     }       \/\/\/ Hook to call before applying write request.     fn pre_apply_query(&amp;self, _: &amp;mut ObserverContext&lt;'_&gt;, _: &amp;[Request]) {}       \/\/\/ Hook to call after applying write request.     fn post_apply_query(&amp;self, _: &amp;mut ObserverContext&lt;'_&gt;, _: &amp;mut Vec&lt;Response&gt;) {} } <\/code><\/pre>\n<p>\u6b64 Observer \u76d1\u542c\u4e86 pre_propose\u3001pre_apply \u548c post_apply \u4e09\u4e2a\u4e8b\u4ef6\u3002ObserverContext \u91cc\u9762\u5305\u542b\u4e86 region \u4fe1\u606f\u4ee5\u53ca\u662f\u5426\u7ee7\u7eed\u5904\u7406\u7684\u6807\u8bb0\u3002\u5177\u4f53\u5b9e\u73b0\u7ec6\u8282\u7531\u540e\u7eed\u6587\u7ae0\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u4e0d\u5c55\u5f00\u4e86\u3002<\/p>\n<h2>\u5c0f\u7ed3<\/h2>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u9488\u5bf9 TiKV \u9879\u76ee\u4e2d src\/raftstore \u91cc\u6e90\u7801\u6d89\u53ca\u7684\u6982\u5ff5\u548c\u539f\u7406\u505a\u4e86\u4e00\u4e2a\u5927\u6982\u7684\u4ecb\u7ecd\u3002\u6df1\u5165\u89e3\u8bfb\u8bf7\u7559\u610f\u540e\u7eed\u7684\u7cfb\u5217\u6587\u7ae0\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3002<\/p>\n<p>\u539f\u6587\u9605\u8bfb\uff1ahttps:\/\/pingcap.com\/blog-cn\/tikv-source-code-reading-17\/<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7bf4a5bfc0.jpg\" alt=\"TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09raftstore \u6982\u89c8\" \/><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>TiKV \u6e90\u7801\u89e3\u6790\u7cfb\u5217\u6587\u7ae0\uff08\u5341\u4e03\uff09&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100000"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100000"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100000\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100000"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}