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/ingest: refactor checkpoint manager #54747

Merged
merged 8 commits into from
Jul 24, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Jul 19, 2024

What problem does this PR solve?

Issue Number: ref #54436

Problem Summary:

What changed and how does it work?

  • Move FinishAndUnregisterEngines() out of AddIndexIngestPipeline. Thus, we put Register() and Unregister() to the same code level.
  • Add an option to FinishAndUnregisterEngines() to control the behavior of "clean up local path data" and "check duplicated entry" in different scenarios.
  • Refine logs.
  • Remove BackendCtx.SetDone() and BackendCtx.Done(), use adjustStartKey to skip imported data.
  • Simplify checkpoint manager logic. Now we use importedKeyLowWatermark to determine startKey in next round(see getCheckpointReorgHandle).
  • Add integration tests for checkpoint manager.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 19, 2024
Copy link

tiprow bot commented Jul 19, 2024

Hi @tangenta. 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.

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.

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 73.91304% with 30 lines in your changes missing coverage. Please review.

Project coverage is 56.5653%. Comparing base (e53bfc4) to head (7b3bcb9).
Report is 34 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54747         +/-   ##
=================================================
- Coverage   72.7192%   56.5653%   -16.1540%     
=================================================
  Files          1555       1681        +126     
  Lines        437547     621807     +184260     
=================================================
+ Hits         318181     351727      +33546     
- Misses        99734     246413     +146679     
- Partials      19632      23667       +4035     
Flag Coverage Δ
integration 37.6283% <71.3043%> (?)

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.1440% <ø> (+6.2960%) ⬆️

@tangenta
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 19, 2024
@tangenta
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2024
Comment on lines -974 to -978
bc, err = ingest.LitBackCtxMgr.Register(ctx, job.ID, hasUnique, nil, discovery, job.ReorgMeta.ResourceGroupName)
if err != nil {
ver, err = convertAddIdxJob2RollbackJob(d, t, job, tbl.Meta(), allIndexInfos, err)
return false, ver, errors.Trace(err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be registered in runAddIndexInLocalIngestMode.

@tangenta tangenta changed the title ddl/ingest: remove unnecessary fields of checkpoint manager ddl/ingest: refactor checkpoint manager Jul 19, 2024
Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

7 / 17 files viewed

pkg/ddl/ingest/integration_test.go Show resolved Hide resolved
Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

pkg/ddl/ingest/engine_mgr.go Outdated Show resolved Hide resolved
pkg/ddl/ingest/engine_mgr.go Outdated Show resolved Hide resolved
@D3Hunter D3Hunter mentioned this pull request Jul 23, 2024
54 tasks
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 24, 2024
pkg/ddl/job_table.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 24, 2024
Copy link

ti-chi-bot bot commented Jul 24, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-24 03:51:13.931262748 +0000 UTC m=+1017095.922204217: ☑️ agreed by D3Hunter.
  • 2024-07-24 05:29:35.919453023 +0000 UTC m=+1022997.910394494: ☑️ agreed by lance6716.

@tangenta
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Jul 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, lance6716, tangenta

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

The pull request process is described here

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 24, 2024
@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jul 24, 2024

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

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 e6e8f7f into pingcap:master Jul 24, 2024
21 checks passed
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants