Skip to content

Conversation

@Leavrth
Copy link
Contributor

@Leavrth Leavrth commented Oct 21, 2025

What problem does this PR solve?

Issue Number: close #64308

Problem Summary:
Ingest the overlapped SST files will cause a long tail in raftstore.

What changed and how does it work?

batch download the overlapped SST files and merge them into one SST file to be ingested.

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

Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
@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. and removed do-not-merge/needs-tests-checked labels Oct 21, 2025
@tiprow
Copy link

tiprow bot commented Oct 21, 2025

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

@Leavrth Leavrth added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 21, 2025
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 37.08791% with 229 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.6842%. Comparing base (749c973) to head (2101f05).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64068        +/-   ##
================================================
+ Coverage   72.7381%   74.6842%   +1.9460%     
================================================
  Files          1859       1862         +3     
  Lines        503905     508307      +4402     
================================================
+ Hits         366531     379625     +13094     
+ Misses       115136     105709      -9427     
- Partials      22238      22973       +735     
Flag Coverage Δ
integration 45.6238% <10.9890%> (?)
unit 72.6221% <29.3956%> (+0.3146%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 62.3471% <37.0879%> (+15.9617%) ⬆️
🚀 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.

@BornChanger BornChanger changed the title br: batch restore compated sst br: batch restore compacted sst Oct 21, 2025
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 21, 2025
Signed-off-by: Jianjun Liao <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 28, 2025
@Leavrth
Copy link
Contributor Author

Leavrth commented Nov 5, 2025

/retest

@tiprow
Copy link

tiprow bot commented Nov 5, 2025

@Leavrth: 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: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
if s.State != metapb.StoreState_Up {
continue
}
storeIDs = append(storeIDs, s.Id)
Copy link
Contributor

Choose a reason for hiding this comment

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

assert(len(storeIDs) > 0)


logutil.CL(ctx).Debug("scan regions", logutil.Key("start key", startKey), logutil.Key("end key", endKey), zap.Int("count", len(regionInfos)))
workerpoolsize := 1
if importer.mergeSst {
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks like a general optimization, not only for compacted sst files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but the number of regionInfos is usually 1 in the snapshot restore, which is not necessary.

}

mu.Lock()
sstMeta := req.Sst
Copy link
Contributor

Choose a reason for hiding this comment

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

Need handle req.Ssts 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.

For TiKV server, the input is req.Ssts and the output target is req.Sst. Therefore, just get the req.Sst to obtain the output of merged SST file.

Signed-off-by: Jianjun Liao <[email protected]>
@BornChanger
Copy link
Contributor

/retest

@tiprow
Copy link

tiprow bot commented Nov 6, 2025

@BornChanger: 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 Nov 6, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 6, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-11-06 07:49:26.078277758 +0000 UTC m=+342815.521307627: ☑️ agreed by 3pointer.
  • 2025-11-06 08:53:25.86086681 +0000 UTC m=+346655.303896699: ☑️ agreed by YuJuncen.

Signed-off-by: Jianjun Liao <[email protected]>
@BornChanger
Copy link
Contributor

/retest

@tiprow
Copy link

tiprow bot commented Nov 6, 2025

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

@BornChanger
Copy link
Contributor

/retest

@tiprow
Copy link

tiprow bot commented Nov 6, 2025

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

@purelind
Copy link
Contributor

purelind commented Nov 6, 2025

/test pull-error-log-review

@tiprow
Copy link

tiprow bot commented Nov 6, 2025

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

In response to this:

/test pull-error-log-review

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.

@Leavrth
Copy link
Contributor Author

Leavrth commented Nov 6, 2025

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Nov 6, 2025
@tiprow
Copy link

tiprow bot commented Nov 6, 2025

@purelind: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test pull-error-log-review

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.

@tiprow
Copy link

tiprow bot commented Nov 6, 2025

@purelind: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test pull-error-log-review

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.

@purelind
Copy link
Contributor

purelind commented Nov 6, 2025

/retest

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, bb7133, BornChanger, 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:
  • OWNERS [3pointer,BornChanger,YuJuncen,bb7133]
  • br/OWNERS [3pointer,BornChanger,YuJuncen]

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 Nov 6, 2025
@ti-chi-bot ti-chi-bot bot merged commit 552b369 into pingcap:master Nov 6, 2025
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm ok-to-test Indicates a PR is ready to be tested. 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.

Implement batch download to merge overlapped SST files into one SST file to be ingested

6 participants