Questions about Write Operations within Small Table Cache Lease

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 小表缓存租约内写操作的疑问

| username: HACK

【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.

| username: ddhe9527 | Original post link

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).

| username: HACK | Original post link

Then it should be waiting within the lease.

| username: forever | Original post link

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. :blush:

| username: ShawnYan | Original post link

Yes, just wait until the lease expires.

| username: HACK | Original post link

:ok_hand:

| username: HACK | Original post link

:ok_hand::ok_hand::ok_hand:

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.