当前位置:网站首页>Tidb 6.0: making Tso more efficient tidb Book rush
Tidb 6.0: making Tso more efficient tidb Book rush
2022-06-27 12:13:00 【InfoQ】
1. Preface
- TSO Distribution by PD Leader Nodes provide , A large number of requests will lead to Leader node CPU Increased utilization , Affect transaction latency .
- PD Follower The node is basically idle , The utilization rate of system resources is low .
- TiDB Cross data center access PD Leader when , Delays between data centers lead to increased transaction delays .
2. TSO

3. Follower Proxy

4. RC Read TSO Optimize
- Select Statement execution does not start from PD obtain TSO As for_update_ts, Instead, use the last valid TSO As for_update_ts( That is to say read_ts). If it is the first statement in the transaction, it is start_ts, Otherwise it's the last SQL Of for_update_ts.
- Build an execution plan and execute , Send to tikv Data read request for (pointget、coprocessor) Will take it RcReadCheckTS sign .
- The data read request uses the previously obtained read_ts Do consistent reading , And return the data to tidb server.
- TiKV It will check whether the returned data has an updated version , If there is an updated version, return WriteConflict error , Otherwise, the execution will normally end after the data is returned .
- If at this time tidb Not yet client Send data from PD Get the latest TSO As for_update_ts Re execute the entire query , Otherwise, you will ask client Returns an error .
5. Local TSO
- Local TSO
- Global TSO
- Global tso allocator Collect all local tso allocator Maximum local tso.
- From all local tso Choose one of the largest local tso As max_tso Send it to local allocator.
- If max_tso Bigger than your own is newer TSO by max_tso, Otherwise, success will be returned directly .
- PD、TiKV、TiDB server Both need to be set according to the actual deployment label, To ensure high availability of each DC Of PD Quantity shall >1.


- Open library or table level Placement Rules in SQL, Dispatch according to region and business relationship .
CREATE PLACEMENT POLICY dc1_leader LEADER_CONSTRAINTS="DC1" FOLLOWER_CONSTRAINTS="DC1,DC2,DC3" FOLLOWERS=2; Alter table new_order PARTITION p0 PLACEMENT POLICY dc1_leaders;- Set up PD Parameters enable-local-tso=on Use tiup reload restart PD Turn on Local TSO function . After enabling, you can use pd-ctl -u pd_ip:pd_port member in tso_allocator_leaders Item content view each center's local tso allocator leader.
6. test
6.1 Test environment

6.2 TSO Follower Proxy


6.3 RC Read TSO


6.4 Local TSO

7. summary
边栏推荐
- Dynamic programming [4] (counting class DP) example: integer partition
- Maximum path and problem (cherry picking problem)
- The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The labels parameter adds label information t
- 怎么找相同台词的影视片段?这8个电影搜索神器,一句台词找到对应片段
- AUTOCAD——三种修剪方式
- 自学ADT和OOP
- Building crud applications in golang
- alibaba jarslink
- 千万不要错过,新媒体运营15个宝藏公众号分享
- Safe landing practice of software supply chain under salesforce containerized ISV scenario
猜你喜欢

How to find the movie and TV clips with the same lines? These 8 movies search for artifact, and find the corresponding segment in one line

Research Report on the overall scale, major producers, major regions, products and application segments of swine vaccine in the global market in 2022

Excel中输入整数却总是显示小数,如何调整?

进程间通信详解

优博讯出席OpenHarmony技术日,全新打造下一代安全支付终端

Operators are also important if you want to learn the C language well

In 2021, the global professional liability insurance revenue was about USD 44740million, and it is expected to reach USD 55980million in 2028. From 2022 to 2028, the CAGR was 3.5%

JSP自定义标签

干货!零售业智能化管理会遇到哪些问题?看懂这篇文章就够了

c/s 架构
随机推荐
Jianmu continuous integration platform v2.5.0 release
Take stock of some easy-to-use and niche markdown editors
Interviewer: with the for loop, why do you need foreach?
dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
星际争霸的虫王IA退役2年搞AI,自叹不如了
56. Core principle of flutter - flutter startup process and rendering pipeline
Xuri 3sdb, installing the original ROS
Fork/Join 框架基本使用和原理
What is the TCP 3-time handshake process?
After Jerry's sleep, the regular wake-up system continues to run without resetting [chapter]
Peak store app imitation station development play mode explanation source code sharing
The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the AIC function is used to compare the AIC values of the two models (simple
Jerry's serial port communication serial port receiving IO needs to set digital function [chapter]
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
Interview shock 60: what will cause MySQL index invalidation?
Precautions for use of IO interface interrupt of Jerry [chapter]
alibaba jarslink
Summary of qstype class usage (II)
uni-app 使用escook/request-miniprogram插件发请求说明
Unity Shader学习(一)认识unity shader基本结构
