Skip to content

Conversation

@zeminzhou
Copy link
Contributor

@zeminzhou zeminzhou commented Jan 8, 2026

What problem does this PR solve?

Issue Number: close #65478

Problem Summary:

What changed and how does it work?

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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 8, 2026
@tiprow
Copy link

tiprow bot commented Jan 8, 2026

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

Details

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

/hold

need more discussion about the new config, and how it can be used


var (
globalMu sync.RWMutex
globalExternalStorage *externalStorage
Copy link
Contributor

Choose a reason for hiding this comment

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

this var can create when it's needed, don't use global var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are many places where storage is used, but creating it frequently is too cumbersome.

Copy link
Contributor

Choose a reason for hiding this comment

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

no need to be global, you can still create a local var that's reused

@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 Jan 8, 2026
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 76.36364% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.6529%. Comparing base (5da5f2a) to head (a37ba43).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #65477        +/-   ##
================================================
- Coverage   77.7956%   77.6529%   -0.1428%     
================================================
  Files          2000       1923        -77     
  Lines        545038     533274     -11764     
================================================
- Hits         424016     414103      -9913     
+ Misses       119360     119158       -202     
+ Partials       1662         13      -1649     
Flag Coverage Δ
integration 41.5024% <ø> (-6.6682%) ⬇️
unit 76.7343% <76.3636%> (+0.3056%) ⬆️

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

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8675% <ø> (-12.1040%) ⬇️
🚀 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.

@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 13, 2026
@zeminzhou zeminzhou force-pushed the new-external-storage branch 2 times, most recently from 88e480b to 92f4d33 Compare January 13, 2026 09:15
@zeminzhou
Copy link
Contributor Author

/test pull-integration-ddl-test

@tiprow
Copy link

tiprow bot commented Jan 21, 2026

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

Details

In response to this:

/test pull-integration-ddl-test

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.

@zeminzhou
Copy link
Contributor Author

/test pull-unit-test-next-gen

@tiprow
Copy link

tiprow bot commented Jan 21, 2026

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

Details

In response to this:

/test pull-unit-test-next-gen

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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 23, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the point to wrap on top of object storage again, why not use it directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two reasons:

This storage is used in many places, and creating it every time is too cumbersome.
We need to confirm the path at the beginning to prevent the path from changing during the process, causing inconsistencies between where files are written and where they are read.

Copy link
Contributor

Choose a reason for hiding this comment

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

if the URI is changed, the file store location should follow the change. keep using the old uri is not an expected behavior

and the uri will not be changed on the cloud, this can be controlled by us

Copy link
Contributor

Choose a reason for hiding this comment

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

This storage is used in many places, and creating it every time is too cumbersome.

you can write a method like this to encapsulate all the detail of storage creation

func newObjStore(ctx context.Context, uri string, opts *storeapi.Options) (storeapi.Storage, error) {
storeBackend, err := objstore.ParseBackend(uri, nil)
if err != nil {
return nil, err
}
store, err := objstore.New(ctx, storeBackend, opts)
if err != nil {
return nil, err
}
return store, nil
}

}
logutil.BgLogger().Info("initialize external storage", zap.String("path", path), zap.String("namespace", namespace))

err := external.CreateExternalStorage(path, namespace, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can create it on demand, no need to setup at tidb startup

@zeminzhou
Copy link
Contributor Author

/test all

Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
@zeminzhou zeminzhou force-pushed the new-external-storage branch from 9f2cd2d to 7018858 Compare January 27, 2026 02:08
Comment on lines 33 to 37
func init() {
if tempDir := config.GetGlobalConfig().TempDir; tempDir != "" {
_ = CreateExternalStorage(tempDir, "", nil)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This already has a default value at startup; the init function seems problematic. Value initialization should be placed in a unified location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! thanks

@hawkingrei
Copy link
Member

/lgtm cancel

@ti-chi-bot ti-chi-bot bot removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 27, 2026
@hawkingrei hawkingrei self-requested a review January 27, 2026 08:50
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Copy link
Contributor

Choose a reason for hiding this comment

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

if you insist to use this wrapper, please move it to where it's used, AKA, planner

and external is not a good term to describe what it does, maybe extstore, and then the files under it can also be renamed

Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added the sig/planner SIG: Planner label Jan 28, 2026
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 28, 2026
@D3Hunter D3Hunter changed the title *: introduce external storage planner: introduce external storage for plan replayer Jan 28, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, hawkingrei

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

The pull request process is described here

Details 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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 28, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 28, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-01-23 09:15:54.725314002 +0000 UTC m=+744582.339270858: ☑️ agreed by hawkingrei.
  • 2026-01-27 08:49:33.203881768 +0000 UTC m=+1088600.817838614: ✖️🔁 reset by hawkingrei.
  • 2026-01-28 04:35:01.49955795 +0000 UTC m=+1159729.113514816: ☑️ agreed by D3Hunter.
  • 2026-01-28 04:41:16.204010638 +0000 UTC m=+1160103.817967493: ☑️ agreed by hawkingrei.

Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
@hawkingrei
Copy link
Member

/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 Jan 28, 2026
@ti-chi-bot ti-chi-bot bot merged commit a919687 into pingcap:master Jan 28, 2026
31 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. sig/planner SIG: Planner 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.

support to store files generated by PLAN REPLAYER to object storage

3 participants