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

parser, ddl: update the DDL job's Location structure #31199

Merged
merged 15 commits into from
Jan 3, 2022

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Dec 30, 2021

What problem does this PR solve?

Issue Number: close #31212

Problem Summary:
The Location in the job is empty after decoding.

What is changed and how it works?

Because the Location object's fields are all lowercase, there are no useful fields after json decoding. So, use Name and Offset instead of Location to represent timezone.

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

None

@zimulala zimulala added the type/bugfix This PR fixes a bug. label Dec 30, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 30, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • wjhuang2016

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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 30, 2021
Copy link
Contributor

@AilinKid AilinKid 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 Dec 31, 2021
@@ -211,7 +211,13 @@ type DDLReorgMeta struct {
SQLMode mysql.SQLMode `json:"sql_mode"`
Warnings map[errors.ErrorID]*terror.Error `json:"warnings"`
WarningsCount map[errors.ErrorID]int64 `json:"warnings_count"`
Location *time.Location `json:"time_location"`
Location *TimeZone `json:"time_zone"`
Copy link
Member

Choose a reason for hiding this comment

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

Would it break the compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I looked at the original PR that added this field that is not on the branch yet.

Copy link
Member

Choose a reason for hiding this comment

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

Which PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR:#29664

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

Need an issue

@@ -211,7 +211,13 @@ type DDLReorgMeta struct {
SQLMode mysql.SQLMode `json:"sql_mode"`
Warnings map[errors.ErrorID]*terror.Error `json:"warnings"`
WarningsCount map[errors.ErrorID]int64 `json:"warnings_count"`
Location *time.Location `json:"time_location"`
Location *TimeZone `json:"time_zone"`
Copy link
Member

Choose a reason for hiding this comment

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

Where do you set it at?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will set it in the next PR(There are a lot of problems involved in this PR, so I will fix this problem first
).

Copy link
Member

Choose a reason for hiding this comment

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

But I don't know what you want to fix and don't know if it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It describes the problems we need to deal with: “The Location in the job is empty after decoding”. It was also written in the original PR of worker to be dealt with.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the problem from the user's perspective.
“The Location in the job is empty after decoding”, Sounds like a problem, but what would happen? I'm still confused.
Besides, why it's empty after decoding? And Why using Name and Offset can fix it?

Copy link
Contributor Author

@zimulala zimulala Dec 31, 2021

Choose a reason for hiding this comment

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

Because the Location object's fields are all lowercase, there are no useful fields after decoding. I'll add this to the description.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I get it. Please add an issue for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wjhuang2016 Done.

@zimulala
Copy link
Contributor Author

CI failed for:

[2021-12-31T03:36:23.943Z] FAIL: update_test.go:1446: testStatsSuite.TestLogDetailedInfo
[2021-12-31T03:36:23.943Z] 
[2021-12-31T03:36:23.943Z] update_test.go:1507:
[2021-12-31T03:36:23.943Z]     c.Assert(s.hook.results, Equals, t.result)
[2021-12-31T03:36:23.943Z] ... obtained string = ""
[2021-12-31T03:36:23.943Z] ... expected string = "[stats-feedback] test.t, column=a, rangeStr=range: [-inf,8), actual: 8, expected: 8, buckets: {num: 8 lower_bound: 0 upper_bound: 7 repeats: 1 ndv: 0, num: 8 lower_bound: 8 upper_bound: 15 repeats: 1 ndv: 0}[stats-feedback] test.t, column=a, rangeStr=range: [8,15), actual: 8, expected: 7, buckets: {num: 8 lower_bound: 8 upper_bound: 15 repeats: 1 ndv: 0}"

@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 Dec 31, 2021
@zimulala
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 00b5d10

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 31, 2021
@zimulala
Copy link
Contributor Author

/run-check_dev
/run-mysql-test
/run-unit-test

@zimulala
Copy link
Contributor Author

/run-check_dev_2

@zimulala
Copy link
Contributor Author

/run-unit-test

@zhouqiang-cl
Copy link
Contributor

/merge

@zhouqiang-cl
Copy link
Contributor

/run-unit-tests

@zhouqiang-cl
Copy link
Contributor

/merge

@zimulala
Copy link
Contributor Author

/run-mysql-test

@sre-bot
Copy link
Contributor

sre-bot commented Dec 31, 2021

@zimulala
Copy link
Contributor Author

/run-unit-test

@zhouqiang-cl
Copy link
Contributor

/merge

@hawkingrei
Copy link
Member

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit e50e03c into pingcap:master Jan 3, 2022
@zimulala zimulala added the needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. label Jan 4, 2022
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jan 4, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.4 in PR #31263

@zimulala zimulala deleted the zimuxia/job-tz branch January 4, 2022 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note-none Denotes a PR that doesn't merit a release note. 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. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Location in the DDL job is empty after decoding.
8 participants