Skip to content

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Aug 8, 2025

What problem does this PR solve?

Issue Number: close #62904

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

intermediate files of importing using global sort, and they are successfully cleanup after it.

➜  minio bin/mc ls -r minio/mybucket/gsort
[2025-08-11 12:34:35 CST]   467B STANDARD 2/4/meta.json
[2025-08-11 12:34:34 CST]   194B STANDARD 2/plan/encode/1/meta.json
[2025-08-11 12:34:36 CST]   521B STANDARD 2/plan/ingest/1/meta.json
[2025-08-11 12:34:35 CST]    82B STANDARD p01001100/2/4/data/f3af2ec6-b252-4221-af32-42c5bf12c8cb_stat/0
[2025-08-11 12:34:35 CST]   294B STANDARD p11010101/2/4/data/f3af2ec6-b252-4221-af32-42c5bf12c8cb/0
  • 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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 8, 2025
Copy link

tiprow bot commented Aug 8, 2025

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.

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 75.71429% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.0238%. Comparing base (857a162) to head (ebba60f).
⚠️ Report is 19 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #62905        +/-   ##
================================================
+ Coverage   72.8039%   75.0238%   +2.2199%     
================================================
  Files          1793       1842        +49     
  Lines        487640     501678     +14038     
================================================
+ Hits         355021     376378     +21357     
+ Misses       111000     102170      -8830     
- Partials      21619      23130      +1511     
Flag Coverage Δ
integration 49.1362% <0.0000%> (?)
unit 72.4572% <75.7142%> (+0.2742%) ⬆️

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

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

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 11, 2025

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

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 11, 2025

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

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 11, 2025

@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 sig/planner SIG: Planner label Aug 11, 2025
@D3Hunter D3Hunter changed the title [WIP]globalsort: use partitioned prefix to store intermediate files globalsort: use partitioned prefix to store intermediate files Aug 11, 2025
@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 Aug 11, 2025
@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 11, 2025

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

Copy link
Contributor

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

return filepath.Join(partitionPrefix, prefix)
}

func isValidPartition(in []byte) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can use regexp like ^p[01]{8}$?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the partition prefix have fixed length 1+8, i think direct check is fine, and it's faster

BenchmarkCheck/validPartition
BenchmarkCheck/validPartition-10         	95861958	        11.21 ns/op
BenchmarkCheck/validPartitionRegex
BenchmarkCheck/validPartitionRegex-10    	 7832720	       152.7 ns/op
func validPartition(str string) bool {
	if len(str) != 9 {
		return false
	}
	b := []byte(str)
	if b[0] != 'p' {
		return false
	}
	for i := 1; i < 9; i++ {
		if b[i] != '0' && b[i] != '1' {
			return false
		}
	}
	return true
}

var re = regexp.MustCompile(`^p[01]{8}$`)

func validPartitionRegex(str string) bool {
	return re.MatchString(str)
}

func BenchmarkCheck(b *testing.B) {
	b.Run("validPartition", func(b *testing.B) {
		for range b.N {
			validPartition("p00000000")
		}
	})
	b.Run("validPartitionRegex", func(b *testing.B) {
		for range b.N {
			validPartitionRegex("p00000000")
		}
	})
}

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 12, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 12, 2025
Copy link

ti-chi-bot bot commented Aug 12, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-08-12 02:36:16.070097487 +0000 UTC m=+321375.104680725: ☑️ agreed by joechenrh.
  • 2025-08-12 04:41:40.934135277 +0000 UTC m=+328899.968718515: ☑️ agreed by GMHDBJD.

Copy link

ti-chi-bot bot commented Aug 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, hawkingrei, joechenrh

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 Aug 12, 2025
@hawkingrei
Copy link
Member

/retest

1 similar comment
@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 12, 2025

@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 merged commit b529ae5 into pingcap:master Aug 12, 2025
44 of 56 checks passed
@D3Hunter D3Hunter deleted the partitioned-prefix-gsort branch August 12, 2025 07:09
@D3Hunter
Copy link
Contributor Author

/cherry-pick release-nextgen-20250815

@ti-chi-bot
Copy link
Member

@D3Hunter: new pull request created to branch release-nextgen-20250815: #62963.

In response to this:

/cherry-pick release-nextgen-20250815

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 ti-community-infra/tichi repository.

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. sig/planner SIG: Planner 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.

globalsort: use partitioned prefix to store intermediate files
5 participants