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

*: support metadata lock #37393

Merged
merged 45 commits into from
Sep 18, 2022
Merged

*: support metadata lock #37393

merged 45 commits into from
Sep 18, 2022

Conversation

wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Aug 25, 2022

What problem does this PR solve?

Issue Number: ref #37275

Problem Summary:

This PR supports metadata lock.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

support metadata lock

@wjhuang2016 wjhuang2016 requested a review from a team as a code owner August 25, 2022 11:29
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tangenta
  • xiongjiwei

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 release-note-none Denotes a PR that doesn't merit a release note. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 25, 2022
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 25, 2022

@wjhuang2016 wjhuang2016 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 26, 2022
@wjhuang2016
Copy link
Member Author

/run-unit-test

@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 29, 2022
@Benjamin2037 Benjamin2037 self-requested a review September 1, 2022 06:01
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 1, 2022
Makefile Outdated
@@ -405,10 +405,6 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare
--build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \
Copy link
Member Author

Choose a reason for hiding this comment

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

Recover it after finishing the review.

@@ -1020,6 +1023,7 @@ const (
DefEnableTiDBGCAwareMemoryTrack = true
DefTiDBDefaultStrMatchSelectivity = 0.8
DefTiDBEnableTmpStorageOnOOM = true
DefTiDBEnableMDL = true
Copy link
Member Author

Choose a reason for hiding this comment

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

Set it to false after finishing the review.

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
ddl/db_test.go Outdated Show resolved Hide resolved
ddl/job_table.go Outdated Show resolved Hide resolved
ddl/job_table_test.go Outdated Show resolved Hide resolved
ddl/mdl_test.go Outdated Show resolved Hide resolved
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
session/bootstrap.go Outdated Show resolved Hide resolved
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
planner/core/preprocess.go Show resolved Hide resolved
sessiontxn/isolation/base.go Outdated Show resolved Hide resolved
domain/domain.go Outdated Show resolved Hide resolved
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
domain/domain.go Outdated
@@ -624,7 +624,7 @@ func (do *Domain) refreshMDLCheckTableInfo() {
}
defer do.sysSessionPool.Put(se)
exec := se.(sqlexec.RestrictedSQLExecutor)
rows, _, err := exec.ExecRestrictedSQL(kv.WithInternalSourceType(context.Background(), kv.InternalTxnTelemetry), nil, "select job_id, version, table_ids from mysql.tidb_mdl_info")
rows, _, err := exec.ExecRestrictedSQL(kv.WithInternalSourceType(context.Background(), kv.InternalTxnTelemetry), nil, fmt.Sprintf("select job_id, version, table_ids from mysql.tidb_mdl_info where version <= %d", do.InfoSchema().SchemaMetaVersion()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why here add <= condition? As I understand do.InfoSchema().SchemaMetaVersion() is max ver, right? then there is not biger ver in ddl jobs.

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
@wjhuang2016
Copy link
Member Author

/run-unit-test

@wjhuang2016
Copy link
Member Author

/run-all-tests

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133
Copy link
Member

bb7133 commented Sep 18, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 4822e8c

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 18, 2022
@ti-chi-bot ti-chi-bot merged commit c4638b7 into pingcap:master Sep 18, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Sep 18, 2022

TiDB MergeCI notify

✅ Well Done! New fixed [1] after this pr merged.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/common-test 🔴 failed 1, success 10, total 11 52 min Existing failure
idc-jenkins-ci-tidb/integration-ddl-test ✅ all 6 tests passed 22 min Fixed
idc-jenkins-ci/integration-cdc-test 🟢 all 37 tests passed 24 min Existing passed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 17 tests passed 8 min 31 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 2 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 4 min 9 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 4 min 9 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 2 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 2 min 23 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ 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.

8 participants