Skip to content

Conversation

@mymeiyi
Copy link
Contributor

@mymeiyi mymeiyi commented Jan 12, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Copilot AI review requested due to automatic review settings January 12, 2026 07:05
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link

Copilot AI left a 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 MetaObject inheritance from Tablet class and moved lastCheckTime field to LocalTablet where it's actually used
  • Changed Replica fields from Long wrapper to primitive long types to reduce memory overhead
  • Implemented lazy initialization for CloudReplica.memClusterToBackends map 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.

@mymeiyi
Copy link
Contributor Author

mymeiyi commented Jan 12, 2026

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 32195 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 27fce5701e2f1c56351b1e76119ab5b7fffc58ff, data reload: false

------ Round 1 ----------------------------------
q1	17623	4242	4071	4071
q2	2104	354	248	248
q3	10132	1320	707	707
q4	10201	822	335	335
q5	7513	1946	1971	1946
q6	195	172	139	139
q7	950	779	698	698
q8	9272	1365	1249	1249
q9	4985	4620	4583	4583
q10	6818	1818	1408	1408
q11	511	304	268	268
q12	712	732	605	605
q13	17775	3889	3059	3059
q14	291	301	301	301
q15	591	508	507	507
q16	675	687	619	619
q17	674	798	506	506
q18	6766	6331	6839	6331
q19	1288	1001	645	645
q20	460	391	284	284
q21	3334	2640	2656	2640
q22	1157	1115	1046	1046
Total cold run time: 104027 ms
Total hot run time: 32195 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4504	4215	4243	4215
q2	330	412	312	312
q3	2309	2873	2361	2361
q4	1477	1908	1453	1453
q5	4693	4225	4338	4225
q6	212	188	127	127
q7	1987	1935	1800	1800
q8	2514	2437	2394	2394
q9	7455	7191	7298	7191
q10	2563	2605	2354	2354
q11	570	473	444	444
q12	689	805	675	675
q13	3702	4036	3438	3438
q14	287	316	305	305
q15	532	505	497	497
q16	636	730	607	607
q17	1147	1246	1382	1246
q18	7260	7289	7199	7199
q19	866	807	798	798
q20	1925	1949	1842	1842
q21	4552	4239	4078	4078
q22	1053	1025	991	991
Total cold run time: 51263 ms
Total hot run time: 48552 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174085 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 27fce5701e2f1c56351b1e76119ab5b7fffc58ff, data reload: false

query5	4973	590	428	428
query6	340	242	229	229
query7	4217	472	261	261
query8	331	255	245	245
query9	8777	2649	2662	2649
query10	530	378	323	323
query11	15281	15262	14983	14983
query12	195	121	116	116
query13	1274	495	376	376
query14	6708	3002	2745	2745
query14_1	2663	2652	2645	2645
query15	204	196	171	171
query16	1026	480	467	467
query17	1080	685	584	584
query18	2708	442	346	346
query19	229	223	199	199
query20	127	121	119	119
query21	222	143	127	127
query22	3932	4157	4228	4157
query23	16081	15607	15418	15418
query23_1	15418	15513	15728	15513
query24	7446	1634	1204	1204
query24_1	1218	1176	1200	1176
query25	571	497	429	429
query26	1255	273	155	155
query27	2740	463	294	294
query28	4451	2200	2152	2152
query29	799	569	481	481
query30	317	246	216	216
query31	798	650	576	576
query32	79	69	71	69
query33	546	337	299	299
query34	936	900	516	516
query35	732	819	689	689
query36	900	862	804	804
query37	121	91	72	72
query38	2758	2699	2745	2699
query39	787	747	728	728
query39_1	724	726	707	707
query40	225	130	117	117
query41	68	66	65	65
query42	106	106	103	103
query43	486	463	428	428
query44	1325	733	726	726
query45	193	183	177	177
query46	849	968	592	592
query47	1427	1530	1405	1405
query48	328	329	242	242
query49	599	416	334	334
query50	641	285	200	200
query51	3835	3760	3781	3760
query52	104	110	103	103
query53	299	328	270	270
query54	287	264	249	249
query55	77	77	76	76
query56	284	282	296	282
query57	1047	1026	968	968
query58	264	259	253	253
query59	2114	2203	2147	2147
query60	326	369	298	298
query61	163	157	154	154
query62	388	367	341	341
query63	297	268	267	267
query64	4834	1286	997	997
query65	3818	3809	3765	3765
query66	1383	421	295	295
query67	15357	15213	15627	15213
query68	6474	988	720	720
query69	503	339	305	305
query70	1070	1012	928	928
query71	382	296	283	283
query72	6131	3495	3444	3444
query73	761	738	303	303
query74	8917	8870	8600	8600
query75	2802	2805	2427	2427
query76	3469	1060	645	645
query77	531	400	267	267
query78	9763	10079	9064	9064
query79	1044	935	619	619
query80	1370	615	492	492
query81	562	268	243	243
query82	429	141	109	109
query83	269	257	245	245
query84	257	122	105	105
query85	925	511	468	468
query86	380	316	290	290
query87	2908	2805	2728	2728
query88	3285	2265	2324	2265
query89	416	359	330	330
query90	1912	163	150	150
query91	175	167	143	143
query92	71	73	65	65
query93	1050	908	547	547
query94	657	285	278	278
query95	574	388	317	317
query96	590	479	208	208
query97	2347	2363	2293	2293
query98	220	199	198	198
query99	608	606	517	517
Total cold run time: 255048 ms
Total hot run time: 174085 ms

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 16.67% (3/18) 🎉
Increment coverage report
Complete coverage report

@mymeiyi
Copy link
Contributor Author

mymeiyi commented Jan 12, 2026

run cloud_p0

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 22.22% (4/18) 🎉
Increment coverage report
Complete coverage report

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 12, 2026
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@deardeng deardeng left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 92346ee into apache:master Jan 13, 2026
28 of 29 checks passed
zzzxl1993 pushed a commit to zzzxl1993/doris that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants