-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](cloud) modify primary cluster bes to be in CloudReplica to reduce memory #59932
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes memory usage in CloudReplica by changing the storage of primary cluster backend IDs from a List to a single Long value. The refactoring reflects the reality that each replica is mapped to only one backend per cluster, despite the previous data structure suggesting multiple backends.
Changes:
- Refactored CloudReplica to use a single Long instead of List for primary cluster backend mapping
- Made Replica class abstract with abstract methods for getBackendId() and checkVersionCatchUp()
- Moved method implementations from Replica to LocalReplica to support the abstract class pattern
- Added migration logic via GsonPostProcessable interface to ensure backward compatibility during deserialization
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CloudReplica.java | Replaced primaryClusterToBackends (Map<String, List>) with primaryClusterToBackend (Map<String, Long>) to reduce memory; added gsonPostProcess migration logic; updated all usages |
| Replica.java | Converted to abstract class; made getBackendId() and checkVersionCatchUp() abstract methods |
| LocalReplica.java | Implemented checkVersionCatchUp() abstract method with the original logic from Replica class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java
Show resolved
Hide resolved
|
run buildall |
TPC-H: Total hot run time: 31453 ms |
TPC-DS: Total hot run time: 173602 ms |
ClickBench: Total hot run time: 26.74 s |
FE UT Coverage ReportIncrement line coverage |
| = new ConcurrentHashMap<String, List<Long>>(); | ||
| private ConcurrentHashMap<String, List<Long>> primaryClusterToBackends = null; | ||
| @SerializedName(value = "be") | ||
| private ConcurrentHashMap<String, Long> primaryClusterToBackend = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of value has to be Long or long works too.
|
run cloud_p0 |
FE Regression Coverage ReportIncrement line coverage |
deardeng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by anyone and no changes requested. |
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)