-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](fe) modify tablet and replica to reduce memory #59759
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
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 refactors the Tablet and Replica class hierarchy to reduce memory usage by removing unnecessary inheritance and implementing lazy initialization. The main optimization is removing MetaObject inheritance from Tablet, which eliminates unused fields for CloudTablet instances.
Changes:
- Removed
MetaObjectinheritance fromTabletclass and movedlastCheckTimefield toLocalTabletwhere it's actually used - Changed
Replicafields fromLongwrapper to primitivelongtypes to reduce memory overhead - Implemented lazy initialization for
CloudReplica.memClusterToBackendsmap to avoid allocating memory when not needed
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ConsistencyChecker.java | Added type-specific TABLET_COMPARATOR to replace generic MetaObject comparator, improving type safety |
| CloudReplica.java | Changed memClusterToBackends to use lazy initialization with double-checked locking pattern and made hashReplicaToBes private |
| Tablet.java | Removed MetaObject inheritance and added default implementations for getLastCheckTime/setLastCheckTime methods |
| Replica.java | Changed localInvertedIndexSize and localSegmentSize from Long to long primitives |
| LocalTablet.java | Added lastCheckTime field and overridden methods to maintain consistency checking functionality for local tablets |
💡 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
|
run buildall |
TPC-H: Total hot run time: 32195 ms |
TPC-DS: Total hot run time: 174085 ms |
FE UT Coverage ReportIncrement line coverage |
|
run cloud_p0 |
FE Regression Coverage ReportIncrement line coverage |
dataroaring
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 at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
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
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)