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. DetailsReviewer 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. DetailsInstructions 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! |
xhebox
left a comment
There was a problem hiding this comment.
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. DetailsCommit 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 <xw897002528@gmail.com> * fix CI Signed-off-by: xhe <xw897002528@gmail.com> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <xw897002528@gmail.com> Co-authored-by: xhe <xw897002528@gmail.com> Co-authored-by: CbcWestwolf <1004626265@qq.com>
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 <xw897002528@gmail.com> * fix CI Signed-off-by: xhe <xw897002528@gmail.com> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <xw897002528@gmail.com> Co-authored-by: xhe <xw897002528@gmail.com> Co-authored-by: CbcWestwolf <1004626265@qq.com> 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 <xw897002528@gmail.com> * fix CI Signed-off-by: xhe <xw897002528@gmail.com> * Update meta/meta.go * Update domain/domain.go * fix test --------- Signed-off-by: xhe <xw897002528@gmail.com> Co-authored-by: xhe <xw897002528@gmail.com> Co-authored-by: CbcWestwolf <1004626265@qq.com> fix wrong timestamp in schema cache address comment format Co-authored-by: Chen Ding <dingc05@gmail.com>
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.