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

BR: support restore compacted logs with checkpoint #57532

Merged
merged 12 commits into from
Dec 2, 2024

Conversation

3pointer
Copy link
Contributor

@3pointer 3pointer commented Nov 20, 2024

What problem does this PR solve?

Issue Number: close #57535

Problem Summary:

To support checkpoint and make switch-mode more robust.

What changed and how does it work?

This PR add a checkpoint logic for restore compacted logs and improve the code of switch mode.

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

Copy link

ti-chi-bot bot commented Nov 20, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 20, 2024
Copy link

tiprow bot commented Nov 20, 2024

Hi @3pointer. 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.

@3pointer 3pointer changed the title Feat/compacted logs 3rd BR: support restore compacted logs with checkpoint Nov 20, 2024
@3pointer 3pointer force-pushed the feat/compacted_logs_3rd branch 2 times, most recently from cccdb24 to f345758 Compare November 20, 2024 04:26
@3pointer 3pointer marked this pull request as ready for review November 27, 2024 05:17
@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 Nov 27, 2024
@3pointer 3pointer requested review from Leavrth and YuJuncen November 27, 2024 05:18
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 67.18750% with 42 lines in your changes missing coverage. Please review.

Project coverage is 74.7434%. Comparing base (6434ca4) to head (23134ac).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57532        +/-   ##
================================================
+ Coverage   72.8734%   74.7434%   +1.8699%     
================================================
  Files          1677       1722        +45     
  Lines        464634     472823      +8189     
================================================
+ Hits         338595     353404     +14809     
+ Misses       105152      97184      -7968     
- Partials      20887      22235      +1348     
Flag Coverage Δ
integration 49.2156% <44.5312%> (?)
unit 72.2752% <53.9062%> (+0.0002%) ⬆️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 61.1905% <67.1875%> (+15.4737%) ⬆️

Copy link
Contributor

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

SnapshotRestoreCheckpointDatabaseName string = "__TiDB_BR_Temporary_Snapshot_Restore_Checkpoint"
LogRestoreCheckpointDatabaseName string = "__TiDB_BR_Temporary_Log_Restore_Checkpoint"
SnapshotRestoreCheckpointDatabaseName string = "__TiDB_BR_Temporary_Snapshot_Restore_Checkpoint"
CompactedRestoreCheckpointDatabaseName string = "__TiDB_BR_Temporary_Compacted_Restore_Checkpoint"
Copy link
Contributor

Choose a reason for hiding this comment

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

As there are more source of SSTs than compacting SST in PiTR, perhaps name it "SST_in_PiTR_Restore_Chcekpoint"?

Copy link
Contributor Author

@3pointer 3pointer Dec 2, 2024

Choose a reason for hiding this comment

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

I feel like CustomSSTRestoreCheckpoint sounds better, WDYT?

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 28, 2024
err := s.WalkDir(ctx, walkOpt, func(path string, size int64) error {
metaBytes, err := s.ReadFile(ctx, path)
Copy link
Contributor

Choose a reason for hiding this comment

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

check whether ectx is canceled here because the error is occurred in ApplyOnErrorGroup won't stop WalkDir.

Copy link

ti-chi-bot bot commented Dec 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leavrth, YuJuncen

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 and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 2, 2024
Copy link

ti-chi-bot bot commented Dec 2, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-28 08:54:15.367866782 +0000 UTC m=+713042.987521298: ☑️ agreed by YuJuncen.
  • 2024-12-02 07:38:53.379629085 +0000 UTC m=+1054120.999283600: ☑️ agreed by Leavrth.

Copy link

tiprow bot commented Dec 2, 2024

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

Test name Commit Details Required Rerun command
fast_test_tiprow 04d6077 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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.

@3pointer
Copy link
Contributor Author

3pointer commented Dec 2, 2024

/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 Dec 2, 2024
@3pointer
Copy link
Contributor Author

3pointer commented Dec 2, 2024

/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 2, 2024
@ti-chi-bot ti-chi-bot bot merged commit b5b8109 into pingcap:master Dec 2, 2024
29 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.

Implement checkpoint for compacted log files restoration
3 participants