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

ddl : add admin check table / checksum table compatibility for cache table #29096

Merged
merged 7 commits into from
Oct 26, 2021

Conversation

JayLZhou
Copy link
Contributor

@JayLZhou JayLZhou commented Oct 26, 2021

What problem does this PR solve?

Issue Number: #29124

Problem Summary:See Optimizing hotspot small tables #25293

What is changed and how it works?

add admin checksum table compatibility and admin check table for cache table
A cache table should support admin check / checksum
so the following operations are allowed
create table t1 (id int)
alter table t1 cache
admin checksum table t1
admin check table t1

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 26, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • djshow832
  • tiancaiamao

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 added the release-note-none Denotes a PR that doesn't merit a release note. label Oct 26, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 26, 2021
@JayLZhou
Copy link
Contributor Author

./rebuild

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

Are you sure we need to forbid it? It sounds unreasonable to users. Are there any methods to implement it? @tiancaiamao

@JayLZhou
Copy link
Contributor Author

JayLZhou commented Oct 26, 2021

Are you sure we need to forbid it? It sounds unreasonable to users. Are there any methods to implement it? @tiancaiamao

sorry. I will turn it into a test cache table supported admin check table / checksum pr. delete invalid modify. and add new test. sorry its my mistake

@tiancaiamao
Copy link
Contributor

Please update the PR title and the description @jayl-zxl

@JayLZhou
Copy link
Contributor Author

Please update the PR title and the description @jayl-zxl

okay。

@tiancaiamao
Copy link
Contributor

/run-check_dev_2

Comment on lines 137 to 142
err := tk.ExecToErr("admin check table cache_admin_test;")
c.Assert(err, IsNil)
err = tk.ExecToErr("admin check index cache_admin_test c1;")
c.Assert(err, IsNil)
err = tk.ExecToErr("admin check index cache_admin_test c2;")
c.Assert(err, IsNil)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just the same with mustExec. I mean to use tk.MustQuery("admin check table cache_admin_test").Check(testkit.Rows("......"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh. i understand now !

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I found that admin check table will report ERROR 1105 if the data is inconsistent, so MustExec is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thks

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 26, 2021
errno/errname.go Outdated
@@ -1060,7 +1060,7 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{
ErrPlacementPolicyNotExists: mysql.Message("Unknown placement policy '%-.192s'", nil),
ErrPlacementPolicyWithDirectOption: mysql.Message("Placement policy '%s' can't co-exist with direct placement options", nil),
ErrPlacementPolicyInUse: mysql.Message("Placement policy '%-.192s' is still in use", nil),

ErrOptOnCacheTable: mysql.Message("`%s` is unsupported on cache tables.", nil),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why `%s` here when all other places use '%s'?

errors.toml Outdated
@@ -1486,6 +1486,11 @@ error = '''
invalid as of timestamp: %s
'''

["planner:8242"]
error = '''
`%s` is unsupported on cache tables.
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update when ErrOptOnCacheTable is changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. i have been updated

@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 26, 2021
@JayLZhou
Copy link
Contributor Author

JayLZhou commented Oct 26, 2021

/run-check_dev_2

@tiancaiamao
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 783265a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 26, 2021
@ti-chi-bot ti-chi-bot merged commit 7b4ca57 into pingcap:master Oct 26, 2021
@tiancaiamao
Copy link
Contributor

close #29124

@tiancaiamao tiancaiamao mentioned this pull request Nov 1, 2021
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants