-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
schema cache: record the ddl timestamp and associate schema cache with the timestamp for stale read #42083
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Hi @hihihuhu. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@xhebox could you help to take a look when you have a chance? thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename loadschema(startTS uint64)
to loadschema(timestamp uint64)
. This function will accept a timestamp that starts with the desired schema and schemadiff/metadata. It does not mean that startTS
is the timestamp set by updateSchemaVersion
.
b16e8f5
to
8219173
Compare
thanks! i updated to store startTs in schemadiff and use it as the timestamp of a schema version, i haven't tested it yet but want to get your opinion first to see if this is what you expect? |
/ok-to-test |
/test all |
/merge |
@hihihuhu Please fix it.
|
/retest |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: dab3f0b
|
@xhebox consider this is a fix of performance issue, is it possible to merge this into release-6.5? thanks! |
I think 'no'. We only pick fixes of bugs. |
* cache schema version by timestamp * fix test * avoid recursive locking * address comment * optimize the code * fix 40740 * use the commit ts of the shcema diff as the timestamp of the schema * address comment * address comment * address comment * fix CI Signed-off-by: xhe <[email protected]> * fix CI Signed-off-by: xhe <[email protected]> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <[email protected]> Co-authored-by: xhe <[email protected]> Co-authored-by: CbcWestwolf <[email protected]>
This reverts commit a85b8ed.
This reverts commit a85b8ed.
* cache schema version by timestamp * fix test * avoid recursive locking * address comment * optimize the code * fix 40740 * use the commit ts of the shcema diff as the timestamp of the schema * address comment * address comment * address comment * fix CI Signed-off-by: xhe <[email protected]> * fix CI Signed-off-by: xhe <[email protected]> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <[email protected]> Co-authored-by: xhe <[email protected]> Co-authored-by: CbcWestwolf <[email protected]> fix wrong timestamp in schema cache address comment format
…h the timestamp for stale read (pingcap#42083) close pingcap#40740
* cache schema version by timestamp * fix test * avoid recursive locking * address comment * optimize the code * fix 40740 * use the commit ts of the shcema diff as the timestamp of the schema * address comment * address comment * address comment * fix CI Signed-off-by: xhe <[email protected]> * fix CI Signed-off-by: xhe <[email protected]> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <[email protected]> Co-authored-by: xhe <[email protected]> Co-authored-by: CbcWestwolf <[email protected]> fix wrong timestamp in schema cache address comment format Co-authored-by: Chen Ding <[email protected]>
What problem does this PR solve?
Issue Number: close #40740
Problem Summary:
What is changed and how it works?
when handle ddl, record the start ts of the transaction as the timestamp of the schema change. then when populate the schema cache, associate each schema version with a timestamp, and search the schema by timestamp for stale read.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.