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

[Enhancement] Optimize creating table using a shared initial tablet metadata between tablets in shared-data mode #45666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiangguangyxg
Copy link
Contributor

@xiangguangyxg xiangguangyxg commented May 15, 2024

Why I'm doing:

Creating table is very slow when there is many tablets in shared-data mode

What I'm doing:

Since the content stored in the tablet metadata of version 1 is the same for all tablets in the same partition,
we can let all tablets share the same tablet metadata of version 1. In this way, when creating a table, no matter how many tablets there are in a partition, only one tablet metadata needs to be written, making the time to create a table independent of the number of tablets, speeding up the creation of tables.

Add fe config lake_use_shared_tablet_initial_metadata to control this optimization.

Fixes https://github.com/StarRocks/StarRocksTest/issues/7246

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@xiangguangyxg xiangguangyxg force-pushed the create_table_no_meta branch 2 times, most recently from 03b803f to a6e517f Compare May 15, 2024 08:58
@sduzh sduzh self-requested a review May 15, 2024 09:05
@xiangguangyxg xiangguangyxg marked this pull request as draft May 17, 2024 02:18
@xiangguangyxg xiangguangyxg force-pushed the create_table_no_meta branch 6 times, most recently from 5e031fc to 16f7d08 Compare May 20, 2024 08:00
@xiangguangyxg xiangguangyxg marked this pull request as ready for review May 20, 2024 08:00
@xiangguangyxg xiangguangyxg requested review from a team as code owners May 20, 2024 08:00
@xiangguangyxg xiangguangyxg force-pushed the create_table_no_meta branch 2 times, most recently from 646d718 to 6d7b1f2 Compare May 21, 2024 11:09
@xiangguangyxg xiangguangyxg requested a review from a team as a code owner May 21, 2024 11:09
@wanpengfei-git wanpengfei-git requested a review from a team May 21, 2024 11:10
@xiangguangyxg xiangguangyxg force-pushed the create_table_no_meta branch 6 times, most recently from b45e280 to 7e9c52a Compare May 23, 2024 07:41
Copy link

sonarcloud bot commented May 24, 2024

Copy link

[FE Incremental Coverage Report]

pass : 18 / 22 (81.82%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/alter/LakeTableSchemaChangeJob.java 2 4 50.00% [361, 362]
🔵 com/starrocks/server/LocalMetastore.java 3 5 60.00% [2106, 2229]
🔵 com/starrocks/common/util/concurrent/MarkedCountDownLatch.java 4 4 100.00% []
🔵 com/starrocks/common/Config.java 1 1 100.00% []
🔵 com/starrocks/task/CreateReplicaTask.java 7 7 100.00% []
🔵 com/starrocks/staros/StarMgrServer.java 1 1 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 41 / 47 (87.23%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/storage/task/engine_batch_load_task.cpp 0 1 00.00% [66]
🔵 be/src/storage/lake/vacuum.cpp 2 4 50.00% [586, 587]
🔵 be/src/storage/lake/metadata_iterator.cpp 4 6 66.67% [33, 34]
🔵 be/src/storage/lake/tablet_manager.cpp 25 26 96.15% [442]
🔵 be/src/service/service_be/lake_service.cpp 1 1 100.00% []
🔵 be/src/storage/lake/filenames.h 1 1 100.00% []
🔵 be/src/storage/lake/update_manager.cpp 1 1 100.00% []
🔵 be/src/storage/lake/metadata_iterator.h 2 2 100.00% []
🔵 be/src/storage/lake/transactions.cpp 3 3 100.00% []
🔵 be/src/storage/lake/location_provider.h 2 2 100.00% []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants