Skip to content

mdl/sessionmanager: some refactor of MDL loop and move sessionmanager from util to session pkg#62671

Merged
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
D3Hunter:refactor-mdl-check
Jul 29, 2025
Merged

mdl/sessionmanager: some refactor of MDL loop and move sessionmanager from util to session pkg#62671
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
D3Hunter:refactor-mdl-check

Conversation

@D3Hunter

@D3Hunter D3Hunter commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #61702

Problem Summary:

What changed and how does it work?

as title

also abstract job2ver and job2ids into mdldef.JobMDL

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test. THIS PR ONLY RENAME AND MOVE FILES
    • I checked and no code files have been changed.

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.

None

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. sig/planner SIG: Planner labels Jul 29, 2025
@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

Comment thread pkg/session/session.go
Comment on lines -4900 to -4902
logutil.BgLogger().Info("old running transaction block DDL", zap.Int64("table ID", tblID.(int64)), zap.Int64("jobID", jobID), zap.Uint64("connection ID", sv.ConnectionID), zap.Duration("elapsed time", elapsedTime))
} else {
logutil.BgLogger().Debug("old running transaction block DDL", zap.Int64("table ID", tblID.(int64)), zap.Int64("jobID", jobID), zap.Uint64("connection ID", sv.ConnectionID), zap.Duration("elapsed time", elapsedTime))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

those 2 are the same except the log level

@D3Hunter D3Hunter changed the title mdl/sessionmanager: some refactor of MDL loop and move sessionmanager under session pkg mdl/sessionmanager: some refactor of MDL loop and move sessionmanager from util to session pkg Jul 29, 2025
@codecov

codecov Bot commented Jul 29, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.9250%. Comparing base (03e9041) to head (59c94c7).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #62671        +/-   ##
================================================
+ Coverage   72.8718%   74.9250%   +2.0531%     
================================================
  Files          1769       1816        +47     
  Lines        486067     494960      +8893     
================================================
+ Hits         354206     370849     +16643     
+ Misses       110207     101029      -9178     
- Partials      21654      23082      +1428     
Flag Coverage Δ
integration 48.8659% <66.6666%> (?)
unit 72.2672% <86.9047%> (+0.1072%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 63.5128% <ø> (+17.2168%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joechenrh joechenrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rest LGTM

Comment thread pkg/infoschema/issyncer/mdldef/mdl.go Outdated

// JobMDL is a DDL job's MDL info.
type JobMDL struct {
// the version we expect current instance have loaded

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it better to comment as

Suggested change
// the version we expect current instance have loaded
// the version of the this job

// See the License for the specific language governing permissions and
// limitations under the License.

package mdldef

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this package only store one structJobMDL? Will we move the code related to mdl into this package later?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if we put in issyncer, there will be import cycle, so that's the only reason it have a separate pkg

i will write a comment about it.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 29, 2025
@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 29, 2025
@ti-chi-bot

ti-chi-bot Bot commented Jul 29, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-07-29 06:02:15.073870943 +0000 UTC m=+58100.726622581: ☑️ agreed by joechenrh.
  • 2025-07-29 06:43:35.59659755 +0000 UTC m=+60581.249349178: ☑️ agreed by GMHDBJD.

@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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-sigs/prow repository.

@ti-chi-bot

ti-chi-bot Bot commented Jul 29, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, hawkingrei, joechenrh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Jul 29, 2025
@hawkingrei

Copy link
Copy Markdown
Contributor

/retest

3 similar comments
@hawkingrei

Copy link
Copy Markdown
Contributor

/retest

@hawkingrei

Copy link
Copy Markdown
Contributor

/retest

@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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-sigs/prow repository.

@hawkingrei

Copy link
Copy Markdown
Contributor

/retest

@pingcap pingcap deleted a comment from ti-chi-bot Bot Jul 29, 2025
@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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-sigs/prow repository.

@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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-sigs/prow repository.

@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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-sigs/prow repository.

@ti-chi-bot

ti-chi-bot Bot commented Jul 29, 2025

Copy link
Copy Markdown

@D3Hunter: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
non-block/pull-mysql-test-next-gen 59c94c7 link false /test pull-mysql-test-next-gen
non-block/pull-integration-e2e-test-next-gen 59c94c7 link false /test pull-integration-e2e-test-next-gen

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot Bot merged commit 102ffec into pingcap:master Jul 29, 2025
33 of 38 checks passed
@D3Hunter D3Hunter deleted the refactor-mdl-check branch July 29, 2025 13:10
JaySon-Huang pushed a commit to JaySon-Huang/tidb that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants