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: decouple job seq number from job history & reset its allocator on owner change #54774

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Jul 19, 2024

What problem does this PR solve?

Issue Number: ref #54436

Problem Summary:

What changed and how does it work?

as title

  • currently, SeqNum is used to identify the order of moving the job into DDL history, it's not the order of the job execution. for jobs with dependency, or if they are run in the same session, their SeqNum will be in increasing order. when using fast create table, there might duplicate seq_num as any TiDB can execute the DDL in this case.
  • after this PR, the SeqNum will always start from 1 when DDL owner not changed, and for jobs with dependency, or if they are run in the same session, their SeqNum will be in increasing order is still maintained. on owner change, new owner will reset and start it from 1 again. as previous semantic forces 'moving jobs into DDL history' part to be serial, it's more complex and has very limited usage scenario, it only used in test right now as far as we know
  • the speed of general DDL is not affected by this PR after test, maybe the bottleneck has transfered to job scheduler part after all the optimization we have done.

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

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 D3Hunter mentioned this pull request Jul 19, 2024
54 tasks
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.6868%. Comparing base (d7edc1e) to head (3ed5017).
Report is 28 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54774         +/-   ##
=================================================
- Coverage   74.6604%   56.6868%   -17.9737%     
=================================================
  Files          1552       1681        +129     
  Lines        362946     618149     +255203     
=================================================
+ Hits         270977     350409      +79432     
- Misses        72336     244322     +171986     
- Partials      19633      23418       +3785     
Flag Coverage Δ
integration 37.2586% <80.0000%> (?)
unit 72.3078% <100.0000%> (-1.2742%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (-2.2339%) ⬇️
parser ∅ <ø> (∅)
br 52.5950% <ø> (+4.9277%) ⬆️

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jul 19, 2024

@D3Hunter: 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 added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 22, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 23, 2024
Copy link

ti-chi-bot bot commented Jul 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-22 04:29:38.623364372 +0000 UTC m=+846600.614305835: ☑️ agreed by wjhuang2016.
  • 2024-07-23 03:35:27.49498601 +0000 UTC m=+929749.485927480: ☑️ agreed by lance6716.

@D3Hunter
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Jul 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 23, 2024
@ti-chi-bot ti-chi-bot bot merged commit cdd7c9e into pingcap:master Jul 23, 2024
23 checks passed
@D3Hunter D3Hunter deleted the weak-seqnum branch July 23, 2024 06:15
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants