Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cached-tables: add description about mysql.table_cache_meta table #10310

Merged
merged 4 commits into from
Dec 21, 2022

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Jun 29, 2022

First-time contributors' checklist

What is changed, added or deleted? (Required)

Close #10087

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v6.2 (TiDB 6.2 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 29, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Oreoxmt
  • tangenta

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot requested a review from TomShawn June 29, 2022 08:10
@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 29, 2022
@Oreoxmt Oreoxmt added area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. translation/doing This PR’s assignee is translating this PR. type/enhancement The issue or PR belongs to an enhancement. labels Jun 29, 2022
@ti-chi-bot ti-chi-bot removed the missing-translation-status This PR does not have translation status info. label Jun 29, 2022
@tangenta
Copy link
Contributor

We may need to update https://docs.pingcap.com/zh/tidb/dev/mysql-schema as well.

cached-tables.md Outdated
@@ -177,6 +177,22 @@ SELECT * FROM users;
>
> 缓存表的写入延时高是受到实现的限制。存在多个 TiDB 实例时,一个 TiDB 实例并不知道其它的 TiDB 实例是否缓存了数据,如果该实例直接修改了表数据,而其它 TiDB 实例依然读取旧的缓存数据,就会读到错误的结果。为了保证数据正确性,缓存表的实现使用了一套基于 lease 的复杂机制:读操作在缓存数据同时,还会对于缓存设置一个有效期,也就是 lease。在 lease 过期之前,无法对数据执行修改操作。因为修改操作必须等待 lease 过期,所以会出现写入延迟。

缓存表相关的元信息存储在 `mysql.table_cache_meta` 表中。这张表记录了所有缓存表的 `tid`,当前状态 `lock_type`,以及 `lease` 相关的信息。这张表仅供 TiDB 内部使用,用户修改可能导致不可预期的错误。
Copy link
Collaborator

@Oreoxmt Oreoxmt Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
缓存表相关的元信息存储在 `mysql.table_cache_meta` 表中。这张表记录了所有缓存表的 `tid`,当前状态 `lock_type`,以及 `lease` 相关的信息。这张表仅供 TiDB 内部使用,用户修改可能导致不可预期的错误。
缓存表相关的元信息存储在 `mysql.table_cache_meta` 表中。这张表记录了所有缓存表的 `tid`,当前状态 `lock_type`,以及 `lease` 相关的信息。
> **注意:**
>
> 这张表仅供 TiDB 内部使用,用户修改可能导致不可预期的错误。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not tell this to the user?

cached-tables.md Outdated Show resolved Hide resolved
@TomShawn TomShawn added the ONCALL Relates to documentation oncall. label Jun 29, 2022
tiancaiamao and others added 2 commits June 30, 2022 14:55
Co-authored-by: tangenta <tangenta@126.com>
Copy link
Collaborator

@Oreoxmt Oreoxmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 9, 2022
@Oreoxmt Oreoxmt requested a review from tangenta October 13, 2022 03:00
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 13, 2022
cached-tables.md Outdated Show resolved Hide resolved
@TomShawn
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 63809b8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 21, 2022
@ti-chi-bot ti-chi-bot merged commit 686178a into pingcap:master Dec 21, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.2: #12343.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.3: #12344.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.4: #12345.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. ONCALL Relates to documentation oncall. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suggest add info about table mysql.table_cache_meta
5 participants