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

keyspace: Asynchronously pre-allocate keyspaces #9019

Merged
merged 5 commits into from
Apr 8, 2025

Conversation

pingyu
Copy link
Contributor

@pingyu pingyu commented Jan 24, 2025

What problem does this PR solve?

Issue Number: Close #9022

What is changed and how does it work?

keyspace: Asynchronously pre-allocate keyspaces to improve startup performance (mainly for test).

Please note that this PR introduce some changes, including:

  • The rule of wait split region,
  • The time when keyspaces are created,
  • And the keyspace ids are not determined.

So this PR modify some unit test cases to meet the changes.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

keyspace: Asynchronously pre-allocate keyspaces to improve startup performance (mainly for test).

* keyspace: Async create pre-alloc keyspaces

Signed-off-by: Ping Yu <[email protected]>

* fix ut

Signed-off-by: Ping Yu <[email protected]>

* fix fmt

Signed-off-by: Ping Yu <[email protected]>

* create parallel; fix ut

Signed-off-by: Ping Yu <[email protected]>

* fix lint

Signed-off-by: Ping Yu <[email protected]>

* fix lint

Signed-off-by: Ping Yu <[email protected]>

* fix lint

Signed-off-by: Ping Yu <[email protected]>

* fix ut; set fast-fail to false

Signed-off-by: Ping Yu <[email protected]>

* fix ut

Signed-off-by: Ping Yu <[email protected]>

* fix ut

Signed-off-by: Ping Yu <[email protected]>

* fix data race

Signed-off-by: Ping Yu <[email protected]>

* increase concurrency

Signed-off-by: Ping Yu <[email protected]>

* wait keyspaces created

Signed-off-by: Ping Yu <[email protected]>

* add comments

Signed-off-by: Ping Yu <[email protected]>

* polish

Signed-off-by: Ping Yu <[email protected]>

* more wait keyspaces

Signed-off-by: Ping Yu <[email protected]>

* improve wait keyspaces

Signed-off-by: Ping Yu <[email protected]>

* fix TestKeyspace

Signed-off-by: Ping Yu <[email protected]>

* fix not determined keyspace id

Signed-off-by: Ping Yu <[email protected]>

---------

Signed-off-by: Ping Yu <[email protected]>
Signed-off-by: Ping Yu <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 24, 2025
Signed-off-by: Ping Yu <[email protected]>
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 47.82609% with 12 lines in your changes missing coverage. Please review.

Project coverage is 75.74%. Comparing base (9092ccc) to head (afcd7a9).
Report is 1 commits behind head on master.

❌ Your patch status has failed because the patch coverage (47.82%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9019      +/-   ##
==========================================
+ Coverage   75.72%   75.74%   +0.01%     
==========================================
  Files         477      477              
  Lines       73437    73438       +1     
==========================================
+ Hits        55612    55623      +11     
+ Misses      14342    14334       -8     
+ Partials     3483     3481       -2     
Flag Coverage Δ
unittests 75.74% <47.82%> (+0.01%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pingyu pingyu changed the title keyspace: Async pre alloc keyspaces keyspace: Asynchronously pre alloc keyspaces Jan 26, 2025
@pingyu
Copy link
Contributor Author

pingyu commented Jan 26, 2025

/retest

@pingyu pingyu changed the title keyspace: Asynchronously pre alloc keyspaces keyspace: Asynchronously pre allocate keyspaces Jan 26, 2025
@pingyu pingyu changed the title keyspace: Asynchronously pre allocate keyspaces keyspace: Asynchronously pre-allocate keyspaces Jan 26, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 5, 2025

@AmoebaProtozoa: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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 Apr 8, 2025
Copy link
Contributor

ti-chi-bot bot commented Apr 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AmoebaProtozoa, nolouch, rleungx

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 Apr 8, 2025
Copy link
Contributor

ti-chi-bot bot commented Apr 8, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-08 09:04:50.432484698 +0000 UTC m=+2160784.116720794: ☑️ agreed by nolouch.
  • 2025-04-08 09:27:38.462945804 +0000 UTC m=+2162152.147181899: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot bot merged commit 5b6d489 into tikv:master Apr 8, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

keyspace: Asynchronously pre allocate keyspaces on start up
4 participants