Skip to content

domain: decouple info schema syncer#61794

Merged
ti-chi-bot[bot] merged 8 commits into
pingcap:masterfrom
D3Hunter:abstract-infoschema
Jun 19, 2025
Merged

domain: decouple info schema syncer#61794
ti-chi-bot[bot] merged 8 commits into
pingcap:masterfrom
D3Hunter:abstract-infoschema

Conversation

@D3Hunter

@D3Hunter D3Hunter commented Jun 18, 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?

in nextgen, we need to access system tables of SYSTEM keyspace from user keyspace, and need to load its schema to make sure we can use correct row ID allocator when do insert. this PR is the first part to impl it.
most part are moving and abstracting code, see comments for where logic are change

  • move schema validator into a separate pkg
  • decouple info schema syncer from domain, and split the info schema loader from syncer.
  • is in the code is the abbr for info schema

Check List

Tests

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

run with real-tikv, and upgrade from older version, both success

  • No need to test
    • 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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 18, 2025
@tiprow

tiprow Bot commented Jun 18, 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.

@codecov

codecov Bot commented Jun 18, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.63542% with 118 lines in your changes missing coverage. Please review.

Project coverage is 75.2905%. Comparing base (6a12f31) to head (c8e7b75).
Report is 17 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61794        +/-   ##
================================================
+ Coverage   73.0660%   75.2905%   +2.2245%     
================================================
  Files          1730       1781        +51     
  Lines        481492     493403     +11911     
================================================
+ Hits         351807     371486     +19679     
+ Misses       108156      98923      -9233     
- Partials      21529      22994      +1465     
Flag Coverage Δ
integration 49.1916% <55.8593%> (?)
unit 72.6353% <84.2242%> (+0.3346%) ⬆️

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

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 62.8979% <100.0000%> (+16.2107%) ⬆️
🚀 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.

Comment thread pkg/domain/domain_test.go
}
}

func TestDeferFn(t *testing.T) {

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.

moved to pkg/infoschema/issyncer/

var tblIDs []int64
var actionTypes []uint64
if change != nil {
tblIDs = change.PhyTblIDS
actionTypes = change.ActionTypes
}
for idx, ac := range actionTypes {

@D3Hunter D3Hunter Jun 18, 2025

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.

moved to where Update is called to decouple it from infoSyncer, see issyncer.Syncer.postReload

logutil.BgLogger().Error("domain is closed, exit info schema sync loop")
return
}
s.schemaValidator.Restart(s.InfoSchema().SchemaMetaVersion())

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.

we are passing the schema version to decouple validator from infoschema syncer

@D3Hunter D3Hunter changed the title [WIP]domain: decouple info schema syncer domain: decouple info schema syncer Jun 18, 2025
@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2025
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 19, 2025
@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 19, 2025
@ti-chi-bot

ti-chi-bot Bot commented Jun 19, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-06-19 03:01:36.341146851 +0000 UTC m=+327149.064325828: ☑️ agreed by tangenta.
  • 2025-06-19 07:49:26.678058721 +0000 UTC m=+344419.401237699: ☑️ agreed by tiancaiamao.

@ti-chi-bot

ti-chi-bot Bot commented Jun 19, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leavrth, tangenta, tiancaiamao

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 Jun 19, 2025
@D3Hunter

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Jun 19, 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 Jun 19, 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 Jun 19, 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 merged commit cc70f14 into pingcap:master Jun 19, 2025
45 of 51 checks passed
@D3Hunter D3Hunter deleted the abstract-infoschema branch June 19, 2025 11:49
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. 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