Last week, we landed 26 PRs in the TiDB repositories and 15 PRs in the TiKV repositories.
TiDB
TiKV
delete_file_in_range
from RocksDB to destroy Regions quickly to avoid blocking Raft storage threads.Select Where
and the aggregation operations.prewrite
to fix a transaction bug.--log-file
flag to redirect log to the log file.Placement Driver
join
scenarios.Use sysbench to benchmark leader lease read and previous Raft quorum read in 3-node TiKV.
# Prepare data
sysbench --test=./lua-tests/db/oltp.lua --mysql-host=${host} --mysql-port=${port} \
--mysql-user=${user} --mysql-password=${password} --oltp-tables-count=$1 \
--oltp-table-size=5120000 --rand-init=on prepare
# Run benchmark
sysbench --test=./lua-tests/db/insert.lua --mysql-host=${host} --mysql-port=${port} \
--mysql-user=${user} --mysql-password=${password} --oltp-tables-count=1 \
--oltp-table-size= 5120000 --num-threads=${threads} --report-interval=60 \
--max-requests=1280000 --percentile=99 run
|Threads|Leader lease read qps|Leader lease read avg/.99 latency|Raft quorum read qps|Raft quorum read/.99 latency| |—|—|—|—|—|—| |32|2296|13.93⁄15.28|1315|24.33⁄94| |64|2199|29.1⁄145|1325|48.29⁄473| |128|1854|69⁄931|1290|99⁄697|
As we can see, the qps is increased by about 70%, and the latency is decreased by about 40%.
# Prepare data
sysbench --test=./lua-tests/db/oltp.lua --mysql-host=${host} --mysql-port=${port} \
--mysql-user=${user} --mysql-password=${password} --oltp-tables-count=1 \
--oltp-table-size=5120000 --rand-init=on prepare
# Run benchmark
sysbench --test=./lua-tests/db/select.lua --mysql-host=${host} --mysql-port=${port} \
--mysql-user=${user} --mysql-password=${password} --oltp-tables-count=1 \
--oltp-table-size=5120000 --num-threads=${threads} --report-interval=60 \
--max-requests=1280000 --percentile=99 run
|Threads|Leader lease read qps|Leader lease read avg/.99 latency|Raft quorum read qps|Raft quorum read/.99 latency| |—|—|—|—|—|—| |32|21010|1.52⁄7.53|12221|2.62⁄6.69| |64|25948|2.47⁄10.20|12637|5.06/11.62| |128|27283|4.69⁄13.68|11069|11.56⁄35.88|
As we can see, the qps is increased by about 130%, and the latency is decreased by about 50%.