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] Limit the number of partitions initially opened by expression partition ingestion #47976

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

meegoo
Copy link
Contributor

@meegoo meegoo commented Jul 8, 2024

Why I'm doing:

Currently, when we ingest data, unless a partition is specified, information for all partitions is sent, causing the storage side to open delta writers for all partitions. When there are many partitions, this can consume a large amount of unnecessary memory, even though only a few partitions typically have data written to them.

What I'm doing:

This optimization controls the number of partitions sent, allowing the storage side to initially open fewer delta writers. Subsequently, using a mechanism similar to expression partitioning, it dynamically opens the required partitions based on the data during runtime. This approach can significantly reduce memory consumption.

Fixes #issue

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

@mergify mergify bot assigned meegoo Jul 8, 2024
@meegoo meegoo force-pushed the optimize_open_tablet branch 2 times, most recently from 1d0f825 to a50d1c7 Compare July 23, 2024 02:34
Copy link

sonarcloud bot commented Jul 23, 2024

Copy link

[FE Incremental Coverage Report]

pass : 10 / 11 (90.91%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/planner/OlapTableSink.java 9 10 90.00% [251]
🔵 com/starrocks/common/Config.java 1 1 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@meegoo meegoo enabled auto-merge (squash) July 23, 2024 07:57
@tracymacding
Copy link
Contributor

need backport to 3.3 & 3.2 & 3.1

* Used to limit num of partition for load open partition number
*/
@ConfField(mutable = true)
public static long max_load_initial_open_partition_number = 32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should some partitions initially opened for data loading in an expression partitioned table.

Copy link
Contributor Author

@meegoo meegoo Jul 25, 2024

Choose a reason for hiding this comment

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

For most scenarios, data is often only loaded into the nearest partition. Opening it in advance can avoid additional RPC requests at runtime.

@meegoo meegoo merged commit 92e29e1 into StarRocks:main Jul 31, 2024
71 checks passed
@meegoo
Copy link
Contributor Author

meegoo commented Nov 5, 2024

@mergify backport branch-3.3

Copy link
Contributor

mergify bot commented Nov 5, 2024

backport branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 5, 2024
…ession partition ingestion (#47976)

Signed-off-by: meegoo <[email protected]>
(cherry picked from commit 92e29e1)
wanpengfei-git pushed a commit that referenced this pull request Nov 5, 2024
…ession partition ingestion (backport #47976) (#52619)

Co-authored-by: meegoo <[email protected]>
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.

4 participants