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

lightning, ddl: set TS to engineMeta after ResetEngineSkipAllocTS #57998

Merged
merged 11 commits into from
Dec 5, 2024

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Dec 5, 2024

What problem does this PR solve?

Issue Number: close #57980

Problem Summary:

What changed and how does it work?

Previously, after reset engine we set the TS to EngineConfig. But engineMeta is the place that really take effect. The conversion from EngineConfig to engineMeta happens when 1) engine is opened, or 2) external engine is closed normally. In disk-quota triggered import, above conversion does not happen

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 5, 2024
Copy link

tiprow bot commented Dec 5, 2024

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

Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 17.24138% with 24 lines in your changes missing coverage. Please review.

Project coverage is 74.8889%. Comparing base (12b9421) to head (d3ab1bd).
Report is 7 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57998        +/-   ##
================================================
+ Coverage   73.1719%   74.8889%   +1.7170%     
================================================
  Files          1674       1719        +45     
  Lines        461065     471668     +10603     
================================================
+ Hits         337370     353227     +15857     
+ Misses       102942      96307      -6635     
- Partials      20753      22134      +1381     
Flag Coverage Δ
integration 49.1257% <3.4482%> (?)
unit 72.3556% <18.5185%> (+0.0528%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.5389% <ø> (+15.5615%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 5, 2024
@@ -436,6 +436,10 @@ func (local *Backend) doWrite(ctx context.Context, j *regionJob) error {
allPeers = append(allPeers, peer)
}
dataCommitTS := j.ingestData.GetTS()
if dataCommitTS == 0 {
intest.Assert(false, "data commitTS is 0")
Copy link
Contributor

@D3Hunter D3Hunter Dec 5, 2024

Choose a reason for hiding this comment

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

Suggested change
intest.Assert(false, "data commitTS is 0")

we have returned error below

Copy link
Contributor Author

@lance6716 lance6716 Dec 5, 2024

Choose a reason for hiding this comment

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

I added it because DDL can retry the whole ingest task. Without this line, the newly added unit test can pass, because when the second task has zero TS causes error, DDL will retry and continues from checkpoint.

Copy link
Contributor

Choose a reason for hiding this comment

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

DDL can retry the whole ingest task.

shouldn't this be a fatal error?

pkg/lightning/backend/local/region_job.go Show resolved Hide resolved
pkg/lightning/backend/local/local.go Outdated Show resolved Hide resolved
pkg/lightning/backend/backend.go Show resolved Hide resolved
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
@lance6716
Copy link
Contributor Author

/hold

checking tests

@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 Dec 5, 2024
Copy link

ti-chi-bot bot commented Dec 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, 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 lgtm approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 5, 2024
Copy link

ti-chi-bot bot commented Dec 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-05 06:06:34.170631853 +0000 UTC m=+1307781.790286370: ☑️ agreed by tangenta.
  • 2024-12-05 07:28:55.377618288 +0000 UTC m=+1312722.997272803: ☑️ agreed by D3Hunter.

@lance6716
Copy link
Contributor Author

/unhold

checked that without the code part changes, the new test TestAddIndexDiskQuotaTS will cause TiKV panic

@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 Dec 5, 2024
@lance6716
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Dec 5, 2024

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

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot bot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 5, 2024
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 5, 2024
Signed-off-by: lance6716 <[email protected]>
@@ -448,6 +448,27 @@ func TestAddIndexMockFlushError(t *testing.T) {
require.True(t, strings.Contains(jobTp, "ingest"), jobTp)
}

func TestAddIndexDiskQuotaTS(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know add-index with DXF shouldn't have such issue, but can you add a case to cover it too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I can add one test for DXF enabled. But we should leave more test improvements in future in a separate PR. Like iterate all variables combinations like {DXF = on/off, disk quota = on/off, ...} and provide a helper function to prepare environment, and run the testing logic will all combinations.

@D3Hunter
Copy link
Contributor

D3Hunter commented Dec 5, 2024

/hold

I add a new comment, unhold as you wish

@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 Dec 5, 2024
Signed-off-by: lance6716 <[email protected]>
@lance6716
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 Dec 5, 2024
@ti-chi-bot ti-chi-bot bot merged commit 098213a into pingcap:master Dec 5, 2024
25 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Dec 6, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #58032.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 6, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 6, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #58034.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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.

non-DXF ADD INDEX of large table (trigger import due to disk quota) will write KV with TS = 0
4 participants