TiDB 8.1.2 Release Notes
Release date: December 26, 2024
TiDB version: 8.1.2
Quick access: Quick start | Production deployment
Compatibility changes
Add the TiKV configuration item
server.snap-min-ingest-size, which specifies the minimum threshold for whether TiKV adopts the ingest method when processing snapshots. The default value is2MiB.- When the snapshot size exceeds this threshold, TiKV adopts the ingest method, which imports SST files from the snapshot into RocksDB. This method is faster for large files.
- When the snapshot size does not exceed this threshold, TiKV adopts the direct write method, which writes each piece of data into RocksDB individually. This method is more efficient for small files.
Improvements
TiDB
TiKV
- Improve the speed of Region Merge in scenarios with empty tables and small Regions #17376 @LykxSassinator
- Optimize TiKV's
DiskFulldetection to make it compatible with RaftEngine'sspill-dirconfiguration, ensuring that this feature works consistently #17356 @LykxSassinator - Optimize the trigger mechanism of RocksDB compaction to accelerate disk space reclamation when handling a large number of DELETE versions #17269 @AndreMouche
- Support modifying the
import.num-threadsconfiguration item dynamically #17807 @RidRisR - Replace the Rusoto library with AWS Rust SDK to access external storage (such as Amazon S3) for backup and restore, which enhances compatibility with AWS features such as IMDSv2 and EKS Pod Identity #12371 @akoshchiy
TiFlash
- Improve the garbage collection speed of outdated data in the background for tables with clustered indexes #9529 @JaySon-Huang
- Mitigate the issue that TiFlash might panic due to updating certificates after TLS is enabled #8535 @windtalker
- Reduce the number of threads that TiFlash needs to create when processing disaggregated storage and compute requests, helping avoid crashes of TiFlash compute nodes when processing a large number of such requests #9334 @JinheLin
- Improve the cancel mechanism of the JOIN operator, so that the JOIN operator can respond to cancel requests in a timely manner #9430 @windtalker
- Optimize the execution efficiency of
LENGTH()andASCII()functions #9344 @xzhangxian1008 - Optimize the retry strategy for TiFlash compute nodes in the disaggregated storage and compute architecture to handle exceptions when downloading files from Amazon S3 #9695 @JinheLin
Tools
Backup & Restore (BR)
- Reduce unnecessary log printing during backup #55902 @Leavrth
- Disable the table-level checksum calculation (
--checksum=false) during full backups by default to improve backup performance #56373 @Tristan1900
TiCDC
- TiCDC supports querying the status of asynchronously executed DDL tasks after being granted the
SUPERprivilege, preventing execution errors caused by repeatedly executing DDL tasks on the same table #11521 @CharlesCheung96 - When the downstream is TiDB with the
SUPERpermission granted, TiCDC supports querying the execution status ofADD INDEX DDLfrom the downstream database to avoid data replication failure due to timeout in retrying executing the DDL statement in some cases #10682 @CharlesCheung96
- TiCDC supports querying the status of asynchronously executed DDL tasks after being granted the
Bug fixes
TiDB
- Fix the issue that existing TTL tasks are executed unexpectedly frequently in a cluster that is upgraded from v6.5 to v7.5 or later #56539 @lcwangchao
- Fix the issue that improper use of metadata locks might lead to writing anomalous data when using the plan cache under certain circumstances #53634 @zimulala
- Fix the issue that executing
IMPORT INTOis stuck when Global Sort is enabled and the Region size exceeds 96 MiB #55374 @lance6716 - Fix the issue that the upper bound and lower bound of the histogram are corrupted when
DUMP STATSis transforming statistics into JSON #56083 @hawkingrei - Fix the issue that execution plan bindings cannot be created for the multi-table
DELETEstatement with aliases #56726 @hawkingrei - Fix the issue of memory leaks in TTL tables #56934 @lcwangchao
- Fix the issue that partition pruning does not work when the partition expression is
EXTRACT(YEAR FROM col)#54210 @mjonss - Fix the issue that Plan Replayer might report an error when importing a table structure containing Placement Rules #54961 @hawkingrei
- Fix the issue that the query might get stuck when terminated because the memory usage exceeds the limit set by
tidb_mem_quota_query#55042 @yibin87 - Fix the issue that TiDB queries cannot be canceled during cop task construction #55957 @yibin87
- Fix the issue that reducing the value of
tidb_ttl_delete_worker_countduring TTL job execution makes the job fail to complete #55561 @lcwangchao - Fix the issue that the
CASTfunction does not support explicitly setting the character set #55677 @Defined2014 - Fix the issue that TTL tasks cannot be canceled when there is a write conflict #56422 @YangKeao
- Fix the data race issue in
IndexNestedLoopHashJoin#49692 @solotzg - Fix the issue that empty
groupOffsetinStreamAggExecmight cause TiDB to panic #53867 @xzhangxian1008 - Fix the issue that TiDB might hang or return incorrect results when executing a query containing a correlated subquery and CTE #55551 @guo-shaoge
- Fix the issue of data index inconsistency caused by retries during index addition #55808 @lance6716
- Fix the issue that an
out of rangeerror might occur when a small display width is specified for a column of the integer type #55837 @windtalker - Fix the issue that the
LOAD DATA ... REPLACE INTOoperation causes data inconsistency #56408 @fzzf678 - Fix the issue that
columnEvaluatorcannot identify the column references in the input chunk, which leads toruntime error: index out of rangewhen executing SQL statements #53713 @AilinKid - Fix the issue of illegal memory access that might occur when a Common Table Expression (CTE) has multiple data consumers and one consumer exits without reading any data #55881 @windtalker
- Fix the issue that when canceling a TTL task, the corresponding SQL is not killed forcibly #56511 @lcwangchao
- Fix the issue that TiDB panics when importing temporary tables using the
IMPORT INTOstatement #55970 @D3Hunter - Fix the issue that the optimizer incorrectly estimates the number of rows as 1 when accessing a unique index with the query condition
column IS NULL#56116 @hawkingrei - Fix the issue that the query latency of stale reads increases, caused by information schema cache misses #53428 @crazycs520
- Fix the issue that the
UPDATEstatement incorrectly updates values of theENUMtype #56832 @xhebox - Fix the issue that Plan Replayer might report an error when importing a table structure containing foreign keys #56456 @hawkingrei
- Fix the issue that TTL tasks are not canceled after the
tidb_ttl_job_enablevariable is disabled #57404 @YangKeao - Fix the issue that when an
UPDATEorDELETEstatement contains a recursive CTE, the statement might report an error or not take effect #55666 @time-and-fate - Fix the issue that the
SUB_PARTvalue in theINFORMATION_SCHEMA.STATISTICStable isNULL#55812 @Defined2014 - Fix the issue that the default timeout for querying the TiFlash system table is too short #57816 @JaySon-Huang
- Fix the issue that the value of the
default_collation_for_utf8mb4variable does not work for theSET NAMESstatement #56439 @Defined2014 - Fix the issue that TTL internal coroutine might panic when you manually delete a timer in the
mysql.tidb_timertable #57112 @lcwangchao - Fix the issue that enabling acceleration of
ADD INDEXandCREATE INDEXviatidb_ddl_enable_fast_reorgmight lead to theDuplicate entryerror #49233 @lance6716 - Fix the issue that the index timestamp is set to
0when adding indexes to large tables in a non-distributed manner #57980 @lance6716
TiKV
- Fix the issue that the configuration
resolved-ts.advance-ts-intervaldoes not take effect, causing the replication latency of TiCDC and Point-in-time recovery (PITR) to increase dramatically when TiKV restarts #17107 @MyonKeminta - Fix the issue that some tasks experience high tail latency when triggering resource control #17589 @glorv
- Fix the issue that merging Regions might cause TiKV to panic in rare cases #17840 @glorv
- Fix the issue that TiKV cannot report heartbeats to PD when the disk is stuck #17939 @LykxSassinator
- Fix the issue that when Raft and RocksDB are deployed on different disks, the slow disk detection does not work for the disk where RocksDB is located #17884 @LykxSassinator
- Fix the issue that TiKV might panic when a stale replica processes Raft snapshots, triggered by a slow split operation and immediate removal of the new replica #17469 @hbisheng
- Fix the issue that TiKV might panic when executing queries containing
RADIANS()orDEGREES()functions #17852 @gengliqi - Fix the issue that when a large number of transactions are queuing for lock release on the same key and the key is frequently updated, excessive pressure on deadlock detection might cause TiKV OOM issues #17394 @MyonKeminta
- Fix the issue that the leader could not be quickly elected after Region split #17602 @LykxSassinator
- Fix the panic issue that occurs when read threads access outdated indexes in the MemTable of the Raft Engine #17383 @LykxSassinator
- Fix the flow control issue that might occur after deleting large tables or partitions #17304 @Connor1996
- Fix the issue that the configuration
PD
- Fix the issue that the PD HTTP client retry logic might be ineffective #8499 @JmPotato
- Upgrade the version of Gin Web Framework from v1.9.1 to v1.10.0 to fix potential security vulnerabilities #8643 @JmPotato
- Fix the issue that PD cannot quickly re-elect a leader during etcd leader transition #8823 @rleungx
- Fix the issue that setting
replication.strictly-match-labeltotruecauses TiFlash to fail to start #8480 @rleungx - Fix the issue that
evict-leader-schedulerfails to work properly when it is repeatedly created with the same Store ID #8756 @okJiang - Fix the performance jitter issue caused by frequent creation of random number generator #8674 @rleungx
- Fix the memory leak issue in hotspot cache #8698 @lhy1024
- Fix the memory leak issue in label statistics #8700 @lhy1024
- Fix the issue that deleted resource groups still appear in the monitoring panel #8716 @AndreMouche
- Fix the issue that data race might occur in the scheduling server when a PD leader is switched in the microservice mode #8538 @lhy1024
- Fix the issue that when using a wrong parameter in
evict-leader-scheduler, PD does not report errors correctly and some schedulers are unavailable #8619 @rleungx - Fix the issue that the resource group selector does not take effect on any panel #56572 @glorv
TiFlash
- Fix the issue that TiFlash might panic due to spurious Region overlap check failures that occur when multiple Regions are concurrently applying snapshots #9329 @CalvinNeo
- Fix the issue that the
SUBSTRING()function returns incorrect results when the second parameter is negative #9604 @guo-shaoge - Fix the issue that some queries might report errors when late materialization is enabled #9472 @Lloyd-Pottiger
- Fix the issue that TiFlash fails to parse the table schema when the table contains Bit-type columns with a default value that contains invalid characters #9461 @Lloyd-Pottiger
- Fix the issue that some JSON functions unsupported by TiFlash are pushed down to TiFlash #9444 @windtalker
- Fix the issue that the sign in the result of the
CAST AS DECIMALfunction is incorrect in certain cases #9301 @guo-shaoge - Fix the issue that read snapshots of TiFlash write nodes are not released in a timely manner in the disaggregated storage and compute architecture #9298 @JinheLin
- Fix the issue that the
SUBSTRING()function does not support theposandlenarguments for certain integer types, causing query errors #9473 @gengliqi - Fix the issue that when using the
CAST()function to convert a string to a datetime with a time zone or invalid characters, the result is incorrect #8754 @solotzg - Fix the issue that
LPAD()andRPAD()functions return incorrect results in some cases #9465 @guo-shaoge - Fix the issue that querying new columns might return incorrect results under the disaggregated storage and compute architecture #9665 @zimulala
Tools
Backup & Restore (BR)
- Fix the issue that logs might print out encrypted information #57585 @kennytm
- Fix the issue that snapshot backups based on AWS EBS might fail during the preparation phase, causing the backup to get stuck #52049 @YuJuncen
- Fix the issue that the checkpoint path of backup and restore is incompatible with some external storage #55265 @Leavrth
- Fix potential security vulnerabilities by upgrading the
k8s.io/apilibrary version #57790 @BornChanger - Fix the issue that PITR tasks might return the
Information schema is out of dateerror when there are a large number of tables in the cluster but the actual data size is small #57743 @Tristan1900
TiCDC
- Fix the issue that the Resolved TS latency monitoring in the Puller module displays incorrect values #11561 @wlwilliamx
- Fix the issue that when
enable-table-across-nodesis enabled, some Span replication tasks for a table might be lost during Region splits #11675 @wk989898 - Fix the issue that the redo module fails to properly report errors #11744 @CharlesCheung96
- Fix the issue that TiCDC mistakenly discards DDL tasks when the schema versions of DDL tasks become non-incremental during TiDB DDL owner changes #11714 @wlwilliamx
- Fix the issue that the barrier-ts monitoring metric for changefeed checkpoints might be inaccurate #11553 @3AceShowHand
TiDB Data Migration (DM)