Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 小表缓存租约内写操作的疑问
【TiDB Usage Environment】Production, Testing, Research
【TiDB Version】
【Encountered Problem】
In v6, for small table caching, if the lease time is within 5 seconds, write operations on the table cannot be performed. So, do my write operations have to wait until the lease expires, or are they temporarily written elsewhere?
【Reproduction Path】What operations were performed that led to the problem
【Problem Phenomenon and Impact】
【Attachments】
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.
When a write operation arrives, if the lease has not expired, the write operation will be blocked, with the maximum blocking duration being tidb_table_cache_lease (resulting in write performance jitter).
Then it should be waiting within the lease.
It needs to be less than 64m, with very small additions, deletions, and modifications, mainly used for queries; it exists in the form of a lease, blocking writes during the lease period, and read and write performance will decline after the lease expires. Modifying DDL requires closing the cache first; if modifications are few or almost none, you can increase tidb_table_cache_lease to maintain stable read performance. These were the notes I took at the time.
Yes, just wait until the lease expires.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.