Clickhouse RepicateMergeTree Insert 副本协同流程
2021-06-28 23:10:07 1 举报
Clickhouse RepicateMergeTree Insert流程
作者其他创作
大纲/内容
1、选择一个远端的副本,下载数据 副本选择算法: ①、从/replicas节点找到所有副本 ②、选择其中log_pointer最大,同时/queue中任务最少的副本2、向远端副本发送下载请求Fetch part 202106_0_0_0 from replicas/chuanmei-backup1.jd.163.org3、如果下载失败,则尝试n次max_fetch_partition_retries_count=n
replicate_tb_1
返回分区数据Sending part 202106_0_0_0
1、由insert的副本发送日志2、推送操作日志:log/log-0000000001Entry对象:format version: 4create_time: 2021-06-27 20:59:11source replica: chuanmei-backup1.jd.163.orgblock_id: 20210627_10257022201049994224_23.....type:getpartition_name:20210627_281944_281944_0
Create table
Insert value
distribute log
create local data
202106_0_0_0
tmp_fetch 202106_0_0_0
response log
1、本地新建分区202106_0_0_02、写入block_id/blocks/20210627_10257022201049994224_2370951077480815403
CK_Node2
rename
1、初始化节点/clickhouse/tables/shard01/table_replicate_tb_1_local2、注册副本节点/replicas/chuanmei-backup1.jd.163.org3、监听/log节点4、选举,第一个将会是主副本/leader_election/leader_election-0000000000
download data
Zookeeper
接收到服务调用?endpoint=DataPartsExchange
CK_Node1
1、注册副本节点/replicas/chuanmei-backup2.jd.163.org2、监听/log节点3、选举/leader_election/leader_election-0000000001
1、监听到新的操作日志,log/log-00000000012、拉起日志对象Entry3、创建task任务,并放入执行队列/replicas/chuanmei-backup2.jd.163.org/queue/4、基于/queue/队列,执行任务
0 条评论
下一页