Skip to content

[fix](catalog) Refresh remote OLAP partitions on replica relocation#63894

Open
HonestManXin wants to merge 1 commit into
apache:masterfrom
HonestManXin:fix_doris_catalog
Open

[fix](catalog) Refresh remote OLAP partitions on replica relocation#63894
HonestManXin wants to merge 1 commit into
apache:masterfrom
HonestManXin:fix_doris_catalog

Conversation

@HonestManXin
Copy link
Copy Markdown
Contributor

Currently, the update of partitions only depends on the visible version and visible time. If a balance occurs, the version and time of the partition will not be updated, which means that the updated partition will not be retrieved from the remote FE. When executing a query, the tablet on the BE node may no longer exist, resulting in query errors.
To avoid this problem, a checksum will be calculated for the partition to determine whether the partition's metadata has changed.

@hello-stephen
Copy link
Copy Markdown
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?

@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking correctness issue in the remote OLAP metadata refresh path.

Critical checkpoint conclusions:

  • Goal and proof: The PR aims to refresh remote OLAP partition metadata when replica placement changes without visible-version changes. The checksum approach addresses the goal, but the new lock splitting can return inconsistent table/partition metadata; current tests only cover checksum ordering and do not cover RPC snapshot consistency or concurrent partition changes.
  • Scope: The change is focused, but the lock/lifecycle change is larger than a local checksum optimization because it changes the consistency contract of getOlapTableMeta.
  • Concurrency: This path does involve table metadata read/write concurrency. The previous implementation held the table read lock while serializing table meta and partition updates; the new implementation releases and reacquires it in batches, allowing DDL between phases and creating mixed snapshots.
  • Lifecycle/static initialization: No special lifecycle or cross-TU static initialization concern found.
  • Configuration: No new configuration items.
  • Compatibility: Thrift fields are optional and backward-compatible at the wire level; no incompatible storage format change found.
  • Parallel paths: The normal and temp partition paths were both updated.
  • Special conditions: The checksum comparison itself is deterministic by sorted index/tablet/replica IDs, but response construction must remain snapshot-consistent.
  • Test coverage: Added unit coverage validates checksum determinism, but it does not cover the end-to-end remote metadata RPC behavior or concurrent partition add/drop during refresh.
  • Test result correctness: No .out result changes.
  • Observability: Existing debug logging is sufficient for this change.
  • Transaction/persistence/data writes: No transaction or persistence path changes.
  • FE/BE variables: This is FE-to-FE thrift metadata; optional fields were added in the thrift definition.
  • Performance: Batching reduces lock hold time, but not at the cost of returning an inconsistent metadata snapshot.
  • User focus: No additional user-provided review focus was supplied.

Comment thread fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java Outdated
@hello-stephen
Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.06% (1854/2375)
Line Coverage 64.53% (33339/51663)
Region Coverage 65.20% (16524/25343)
Branch Coverage 55.73% (8836/15854)

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17657	4013	4028	4013
q2	q3	10787	1412	847	847
q4	4686	475	350	350
q5	7567	2253	2066	2066
q6	243	175	137	137
q7	975	778	632	632
q8	9411	1785	1584	1584
q9	5233	4935	4922	4922
q10	6387	2227	1878	1878
q11	441	278	255	255
q12	627	428	303	303
q13	18110	3398	2796	2796
q14	270	259	239	239
q15	q16	791	788	718	718
q17	880	841	921	841
q18	7073	5805	5564	5564
q19	1198	1185	1074	1074
q20	514	506	300	300
q21	5676	2797	2695	2695
q22	468	372	304	304
Total cold run time: 98994 ms
Total hot run time: 31518 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4825	4693	4779	4693
q2	q3	5004	5224	4623	4623
q4	2108	2197	1384	1384
q5	4765	4974	4725	4725
q6	230	177	128	128
q7	1833	1815	1576	1576
q8	2448	2080	2106	2080
q9	7890	7370	7340	7340
q10	4753	4661	4273	4273
q11	543	389	349	349
q12	717	737	525	525
q13	3016	3380	2782	2782
q14	277	276	252	252
q15	q16	686	694	617	617
q17	1275	1251	1241	1241
q18	7292	6754	6844	6754
q19	1129	1088	1110	1088
q20	2214	2208	1955	1955
q21	5241	4679	4450	4450
q22	513	476	404	404
Total cold run time: 56759 ms
Total hot run time: 51239 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 172969 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 6f1eefda2548a52ae5c14e6b50ba1d20d05c8eae, data reload: false

query5	4338	658	519	519
query6	336	220	204	204
query7	4221	587	339	339
query8	339	229	222	222
query9	8805	4127	4022	4022
query10	491	347	303	303
query11	5767	2546	2202	2202
query12	178	127	130	127
query13	1288	637	492	492
query14	6177	5520	5184	5184
query14_1	4478	4511	4479	4479
query15	218	208	185	185
query16	1050	469	447	447
query17	1159	748	616	616
query18	2580	506	361	361
query19	222	205	175	175
query20	141	137	135	135
query21	217	137	121	121
query22	13682	13603	13322	13322
query23	17456	16571	16292	16292
query23_1	16528	16475	16435	16435
query24	7451	1806	1346	1346
query24_1	1366	1341	1343	1341
query25	596	500	452	452
query26	1325	335	185	185
query27	2671	562	353	353
query28	4442	2049	2060	2049
query29	1024	671	540	540
query30	318	249	201	201
query31	1139	1093	978	978
query32	93	80	81	80
query33	569	355	336	336
query34	1178	1171	682	682
query35	806	791	711	711
query36	1427	1398	1258	1258
query37	157	103	87	87
query38	3205	3138	3087	3087
query39	944	916	904	904
query39_1	882	893	875	875
query40	232	149	125	125
query41	65	62	65	62
query42	123	107	113	107
query43	329	333	296	296
query44	
query45	217	210	197	197
query46	1123	1210	749	749
query47	2379	2376	2230	2230
query48	388	404	307	307
query49	632	523	379	379
query50	988	339	257	257
query51	4393	4368	4256	4256
query52	104	106	94	94
query53	261	282	217	217
query54	317	271	258	258
query55	95	93	86	86
query56	320	306	301	301
query57	1431	1422	1318	1318
query58	305	275	271	271
query59	1636	1667	1450	1450
query60	326	320	313	313
query61	159	153	160	153
query62	702	659	576	576
query63	247	207	216	207
query64	2436	779	638	638
query65	
query66	1674	476	372	372
query67	29150	29724	29633	29633
query68	
query69	475	347	312	312
query70	1031	1013	972	972
query71	324	271	272	271
query72	3057	2718	2409	2409
query73	839	760	417	417
query74	5147	4963	4815	4815
query75	2703	2624	2321	2321
query76	2275	1157	787	787
query77	406	415	347	347
query78	12535	12476	11789	11789
query79	1507	1082	755	755
query80	642	555	460	460
query81	469	281	245	245
query82	1371	163	125	125
query83	368	281	253	253
query84	271	143	135	135
query85	894	556	457	457
query86	405	346	323	323
query87	3452	3375	3254	3254
query88	3632	2776	2757	2757
query89	449	393	341	341
query90	1884	189	193	189
query91	184	172	139	139
query92	82	79	73	73
query93	1645	1431	895	895
query94	562	348	313	313
query95	708	402	443	402
query96	1085	817	335	335
query97	2752	2751	2591	2591
query98	239	221	222	221
query99	1157	1151	1021	1021
Total cold run time: 254948 ms
Total hot run time: 172969 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.81% (28115/38089)
Line Coverage 57.77% (305534/528917)
Region Coverage 54.79% (255138/465679)
Branch Coverage 56.42% (110477/195808)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/139) 🎉
Increment coverage report
Complete coverage report

@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking correctness gap in the new checksum protocol. The server-side mixed-snapshot concern already present in the existing review thread was not duplicated here.

Critical checkpoint conclusions:

  • Goal/test: the PR aims to refresh remote OLAP partition metadata when replica placement changes without a visible-version change. The new unit test covers checksum determinism, but it does not cover the end-to-end bootstrap path for already-cached remote partitions.
  • Scope: the change is focused and small, but the client request path misses a required fallback for caches created before checksums were stored.
  • Concurrency/lifecycle: the current head holds the table read lock while building table metadata and partition payloads, so I did not raise the already-known stale-snapshot issue again. No additional lock-order issue found in the reviewed path.
  • Compatibility: thrift optional fields are wire-compatible, but rolling upgrade / pre-existing cache behavior is incomplete because existing cached partitions have no stored remote checksum.
  • Parallel paths: normal and temp partition request building share the same helper, so the issue affects both paths.
  • Tests: missing coverage for refreshing a version-matched partition whose cached metadata has no remoteMetaChecksum but whose replica layout differs from the remote source.
  • Observability/config/persistence/data writes: no new config, persistence, transaction, or data-write path issue found. Existing logs are sufficient for this metadata RPC.

User focus: no additional user-provided review focus was specified.

Comment thread fe/fe-core/src/main/java/org/apache/doris/datasource/doris/FeServiceClient.java Outdated
@hello-stephen
Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.06% (1854/2375)
Line Coverage 64.55% (33350/51663)
Region Coverage 65.26% (16540/25343)
Branch Coverage 55.75% (8839/15854)

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17735	4217	4131	4131
q2	q3	10960	1411	819	819
q4	4770	473	353	353
q5	10722	2315	2136	2136
q6	389	179	139	139
q7	962	787	643	643
q8	9578	1814	1536	1536
q9	7052	5033	5003	5003
q10	6456	2392	1890	1890
q11	437	272	241	241
q12	642	442	299	299
q13	18150	3362	2813	2813
q14	265	255	238	238
q15	q16	813	784	710	710
q17	1007	910	1016	910
q18	6848	5709	5527	5527
q19	1150	1228	1114	1114
q20	528	403	261	261
q21	5583	2624	2455	2455
q22	433	366	302	302
Total cold run time: 104480 ms
Total hot run time: 31520 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4404	4386	4438	4386
q2	q3	4533	4933	4333	4333
q4	2089	2175	1369	1369
q5	4477	4752	4985	4752
q6	263	189	137	137
q7	2014	1839	1614	1614
q8	2499	2237	2179	2179
q9	8058	7901	8537	7901
q10	4823	4737	4265	4265
q11	585	451	406	406
q12	751	775	554	554
q13	3298	3570	2998	2998
q14	298	314	293	293
q15	q16	713	736	631	631
q17	1390	1376	1361	1361
q18	7974	7197	6808	6808
q19	1107	1087	1092	1087
q20	2228	2216	1949	1949
q21	5275	4573	4481	4481
q22	513	454	409	409
Total cold run time: 57292 ms
Total hot run time: 51913 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 172501 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 f22ebd707aa0d3bfac2cbe31757df78f0ed07077, data reload: false

query5	4313	684	521	521
query6	341	222	201	201
query7	4250	597	308	308
query8	326	235	216	216
query9	8803	4105	4037	4037
query10	440	353	318	318
query11	5800	2431	2281	2281
query12	188	139	128	128
query13	1278	620	441	441
query14	6116	5507	5181	5181
query14_1	4533	4497	4497	4497
query15	220	206	192	192
query16	1032	502	443	443
query17	1152	757	623	623
query18	2802	513	365	365
query19	226	217	185	185
query20	140	139	134	134
query21	218	151	123	123
query22	13642	13684	13375	13375
query23	17365	16513	16267	16267
query23_1	16401	16419	16337	16337
query24	7372	1795	1333	1333
query24_1	1351	1304	1374	1304
query25	580	505	450	450
query26	1322	330	183	183
query27	2671	539	354	354
query28	4360	2026	2039	2026
query29	1012	661	534	534
query30	318	243	200	200
query31	1145	1101	959	959
query32	90	81	78	78
query33	572	376	310	310
query34	1175	1192	669	669
query35	805	780	691	691
query36	1419	1439	1230	1230
query37	170	109	93	93
query38	3223	3189	3076	3076
query39	929	920	887	887
query39_1	879	900	885	885
query40	226	150	124	124
query41	68	64	64	64
query42	112	114	111	111
query43	339	331	291	291
query44	
query45	218	202	204	202
query46	1076	1212	752	752
query47	2364	2431	2286	2286
query48	402	418	299	299
query49	626	495	389	389
query50	1012	357	250	250
query51	4360	4314	4325	4314
query52	108	105	94	94
query53	269	295	213	213
query54	316	273	267	267
query55	97	92	86	86
query56	311	310	292	292
query57	1449	1443	1315	1315
query58	304	277	272	272
query59	1626	1698	1501	1501
query60	327	333	322	322
query61	157	156	157	156
query62	695	656	591	591
query63	254	201	211	201
query64	2369	842	642	642
query65	
query66	1669	471	383	383
query67	29801	29782	29357	29357
query68	
query69	473	345	316	316
query70	978	1027	1007	1007
query71	310	280	315	280
query72	3011	2739	2439	2439
query73	838	782	413	413
query74	5093	4958	4772	4772
query75	2694	2606	2272	2272
query76	2292	1170	809	809
query77	428	425	344	344
query78	12413	12330	11849	11849
query79	1506	1085	738	738
query80	1015	547	468	468
query81	504	287	237	237
query82	1379	162	120	120
query83	369	296	255	255
query84	274	142	112	112
query85	939	546	468	468
query86	444	330	347	330
query87	3425	3399	3258	3258
query88	3669	2762	2756	2756
query89	454	395	344	344
query90	1833	193	191	191
query91	184	171	140	140
query92	82	83	80	80
query93	1531	1542	907	907
query94	645	355	304	304
query95	686	386	357	357
query96	1121	781	337	337
query97	2747	2723	2607	2607
query98	237	229	236	229
query99	1170	1143	1026	1026
Total cold run time: 255292 ms
Total hot run time: 172501 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 29.75% (36/121) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.98% (21003/38906)
Line Coverage 37.53% (199017/530306)
Region Coverage 33.83% (155968/461031)
Branch Coverage 34.80% (67846/194983)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.84% (28130/38095)
Line Coverage 57.82% (305809/528928)
Region Coverage 55.12% (256525/465431)
Branch Coverage 56.55% (110667/195709)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/121) 🎉
Increment coverage report
Complete coverage report

@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

@github-actions
Copy link
Copy Markdown
Contributor

OpenCode automated review failed and did not complete.

Error: Error: Token refresh failed: 401
Workflow run: https://github.com/apache/doris/actions/runs/26702284994

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.06% (1854/2375)
Line Coverage 64.50% (33325/51663)
Region Coverage 65.21% (16527/25343)
Branch Coverage 55.71% (8832/15854)

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17591	4028	4032	4028
q2	q3	10752	1375	815	815
q4	4686	491	348	348
q5	7563	2328	2145	2145
q6	241	177	138	138
q7	967	757	646	646
q8	9349	1850	1663	1663
q9	5194	4949	4936	4936
q10	6376	2202	1894	1894
q11	453	266	249	249
q12	631	428	307	307
q13	18161	3384	2808	2808
q14	268	254	242	242
q15	q16	824	771	710	710
q17	980	920	944	920
q18	6903	5825	5548	5548
q19	1152	1187	1001	1001
q20	522	580	301	301
q21	5938	2885	2626	2626
q22	467	379	311	311
Total cold run time: 99018 ms
Total hot run time: 31636 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5035	4812	4866	4812
q2	q3	4953	5308	4595	4595
q4	2097	2269	1464	1464
q5	4989	4719	4699	4699
q6	240	179	129	129
q7	1941	1720	1522	1522
q8	2453	2130	2217	2130
q9	7880	7434	7456	7434
q10	4767	4674	4196	4196
q11	532	378	355	355
q12	738	750	529	529
q13	3062	3298	2804	2804
q14	266	277	246	246
q15	q16	673	698	608	608
q17	1269	1257	1260	1257
q18	7288	6956	6881	6881
q19	1161	1101	1107	1101
q20	2235	2223	1950	1950
q21	5305	4583	4443	4443
q22	521	453	408	408
Total cold run time: 57405 ms
Total hot run time: 51563 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 171952 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 5354b6e3e941d05a7cc2e0859c86b9d98fd5f444, data reload: false

query5	4310	658	510	510
query6	336	215	197	197
query7	4389	537	317	317
query8	324	228	219	219
query9	8799	3974	3990	3974
query10	459	353	293	293
query11	5811	2439	2240	2240
query12	183	125	126	125
query13	1280	648	461	461
query14	6129	5533	5185	5185
query14_1	4461	4473	4459	4459
query15	212	206	186	186
query16	1015	489	446	446
query17	1164	768	586	586
query18	2636	480	347	347
query19	209	200	155	155
query20	132	127	127	127
query21	214	133	119	119
query22	13697	13662	13366	13366
query23	17459	16556	16228	16228
query23_1	16361	16414	16341	16341
query24	7507	1790	1303	1303
query24_1	1330	1306	1336	1306
query25	540	496	408	408
query26	1305	324	172	172
query27	2682	554	341	341
query28	4435	1976	2003	1976
query29	989	650	490	490
query30	307	239	194	194
query31	1112	1077	948	948
query32	85	77	72	72
query33	538	354	286	286
query34	1180	1124	669	669
query35	778	796	734	734
query36	1396	1406	1210	1210
query37	154	101	91	91
query38	3215	3208	3072	3072
query39	923	933	898	898
query39_1	886	932	866	866
query40	224	148	122	122
query41	66	66	61	61
query42	111	112	107	107
query43	328	331	287	287
query44	
query45	214	200	193	193
query46	1093	1233	743	743
query47	2418	2393	2276	2276
query48	422	434	305	305
query49	628	495	375	375
query50	968	347	258	258
query51	4336	4310	4281	4281
query52	106	107	92	92
query53	258	269	211	211
query54	310	272	248	248
query55	94	92	83	83
query56	293	308	299	299
query57	1449	1433	1316	1316
query58	299	270	274	270
query59	1591	1686	1423	1423
query60	318	328	309	309
query61	165	158	155	155
query62	708	652	594	594
query63	248	203	209	203
query64	2405	800	649	649
query65	
query66	1649	470	356	356
query67	29834	29792	29612	29612
query68	
query69	472	336	308	308
query70	1046	1021	995	995
query71	308	265	256	256
query72	3035	2678	2383	2383
query73	845	832	397	397
query74	5111	4938	4794	4794
query75	2711	2613	2276	2276
query76	2298	1192	788	788
query77	406	401	340	340
query78	12542	12467	11881	11881
query79	1251	1109	755	755
query80	571	540	456	456
query81	447	282	241	241
query82	244	161	127	127
query83	275	288	252	252
query84	257	142	109	109
query85	854	545	512	512
query86	362	346	344	344
query87	3427	3397	3258	3258
query88	3609	2770	2738	2738
query89	434	397	357	357
query90	2164	190	180	180
query91	193	182	153	153
query92	91	81	76	76
query93	1427	1481	881	881
query94	559	373	347	347
query95	712	490	368	368
query96	1018	811	372	372
query97	2723	2731	2601	2601
query98	245	233	245	233
query99	1169	1175	1051	1051
Total cold run time: 253210 ms
Total hot run time: 171952 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.06% (21043/38928)
Line Coverage 37.61% (199505/530490)
Region Coverage 33.87% (156176/461089)
Branch Coverage 34.84% (67935/194995)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.82% (28138/38117)
Line Coverage 57.79% (305792/529112)
Region Coverage 54.98% (255930/465489)
Branch Coverage 56.39% (110366/195721)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/123) 🎉
Increment coverage report
Complete coverage report

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one distinct blocking issue in the current head. The existing inline threads about mixed snapshots, checksum bootstrapping, and temp partition list reuse were reviewed and not duplicated here.

Critical checkpoint conclusions:

  • Goal/test: the PR aims to refresh remote OLAP partition metadata when replica metadata changes without visible version/time changes. The added unit test covers ordering stability and backend-id changes, but not other query-affecting replica metadata changes.
  • Scope: the change is focused, but the checksum definition is too narrow for the stated goal.
  • Concurrency/lifecycle: the server now keeps table metadata and partition payload generation under one table read lock, which addresses the snapshot consistency concern already raised in an existing thread. No new lock-order issue found.
  • Compatibility: thrift fields are optional, so mixed-version thrift parsing is structurally compatible; the existing bootstrap thread covers old cached partitions.
  • Parallel paths: normal and temp partitions use the same checksum path.
  • Data correctness: blocking issue below: unchanged checksum can suppress refreshes after query-relevant replica metadata changes, leaving stale remote scan locations/replica eligibility.
  • Tests: current tests do not prove refresh for bad/failed/state/path metadata changes.
  • Observability/config/persistence: no new config or persistence requirement found beyond existing metadata serialization.
  • User focus: no additional user-provided review focus was specified.

Comment thread fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java
@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one additional blocking correctness issue in the remote partition freshness check. The existing review threads already cover mixed snapshots, checksum bootstrap, temp partition mixing, and missing replica query fields; this comment is a distinct non-replica stale-partition case.

Critical checkpoint conclusions:

  • Goal/test: the PR aims to refresh remote OLAP partition metadata when replica placement/status changes without a visible version change. It partially accomplishes this and adds checksum unit tests, but the freshness key is still incomplete for the full serialized Partition payload.
  • Scope/clarity: the change is focused, but the checksum abstraction needs to match the data it gates.
  • Concurrency/lifecycle: table metadata response generation now uses a single table read lock, which addresses the previously noted mixed snapshot risk; no new thread/lifecycle concern found beyond existing comments.
  • Compatibility: thrift fields are optional, so wire compatibility is intended; rolling-upgrade checksum bootstrap was already raised in an existing thread.
  • Parallel paths: normal and temp partitions both use the checksum path.
  • Tests: tests cover ordering and several replica fields, but do not cover non-replica Partition fields such as partition rename.
  • Observability/performance: no additional observability issue found; checksum work is bounded by serialized partition metadata size and only done during remote metadata refresh.
  • User focus: no additional user-provided review focus was supplied.

Comment thread fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java
@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

1 similar comment
@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Code review completed for PR 63894 at cfdbbed.

No additional distinct inline findings were confirmed beyond the already-open review threads provided in .opencode-review.oz4N53/pr_review_threads.md. I avoided duplicating those existing comments.

Checkpoint conclusions:

  • Goal: The PR aims to avoid stale remote OLAP partition metadata after replica/top-level metadata changes by adding partition metadata checksums to the FE metadata RPC. The current implementation addresses the main checksum exchange flow in the inspected paths, subject to the already-open review threads.
  • Scope: The change is focused on Partition checksum generation, remote FE client request/response handling, service-side partition filtering, thrift fields, and checksum tests.
  • Concurrency: The server-side metadata response is built under table.readLock() in the inspected current diff, avoiding the mixed table/partition snapshot issue locally. No new lock ordering or deadlock issue was confirmed.
  • Lifecycle/static initialization: No new static initialization or lifecycle hazard was found.
  • Configuration: No configuration items are added.
  • Compatibility: The thrift fields are optional. Rolling-upgrade checksum bootstrapping was inspected; no new distinct compatibility issue was confirmed beyond the existing review context.
  • Parallel code paths: Normal and temp partition paths were both inspected. No additional distinct path omission was confirmed.
  • Special checks/error handling: RPC status handling and partition removal/update filtering were inspected; no new unchecked failure path was confirmed.
  • Tests: Unit tests cover deterministic checksum ordering and changes to several partition/replica fields. I did not run tests in this review runner.
  • Observability: No new observability requirement was identified for this metadata cache optimization.
  • Transaction/persistence/data writes: No transaction, edit-log, or storage write path change is introduced.
  • FE-BE variable passing: The new values are FE-to-FE thrift metadata fields, not BE scan variables; no BE propagation issue was found.
  • Performance: The checksum adds sorting/hash work during remote metadata refresh. This is outside the normal query execution hot path, and no confirmed pathological behavior beyond existing cache correctness discussions was found.

User focus: No additional user-provided review focus was specified.

@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen
Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.34% (1906/2433)
Line Coverage 64.86% (34030/52468)
Region Coverage 65.39% (17547/26833)
Branch Coverage 54.07% (9317/17230)

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Automated review summary

No additional confirmed, distinct issues were found in this review pass beyond the existing inline review threads. I did not resubmit the already-known concerns from those threads.

Critical checkpoint conclusions:

  • Goal and tests: The PR targets refreshing remote OLAP cached partitions when metadata changes without visible-version changes, especially replica relocation. The added checksum flow and unit tests cover the main intended checksum cases.
  • Scope and clarity: The change is focused on the remote OLAP table metadata request/response path and partition checksum calculation.
  • Concurrency and lifecycle: The current implementation keeps table metadata serialization and partition update/removal decisions under the table read lock, avoiding a mixed snapshot in this path. No additional distinct concurrency/lifecycle issue was confirmed.
  • Configuration and compatibility: No new configuration items. Added Thrift fields are optional, so no additional protocol compatibility issue was confirmed in this pass.
  • Parallel paths: Normal and temp partition refresh paths are both handled.
  • Error handling and data correctness: No additional distinct unchecked failure or stale-cache path was confirmed beyond existing review threads.
  • Test coverage: Unit tests were added for checksum determinism and checksum changes on top-level partition fields and query-affecting replica fields. I did not run tests in this review environment.
  • Observability and performance: No new observability requirement or confirmed performance blocker was found.

User focus: No additional user-provided review focus was specified.

@HonestManXin
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review completed against the GitHub PR diff and existing inline review context. I did not add new inline comments because I did not find a distinct, non-duplicative issue beyond the already-known threads.

Critical checkpoint conclusions:

  • Goal/test: The PR aims to avoid stale remote Olap partition metadata by adding partition meta checksums and tests for checksum determinism and selected invalidation cases. The latest patch includes unit coverage for replica query fields and partition top-level fields.
  • Scope: The actual PR scope is focused on remote Olap table metadata refresh, checksum plumbing, and thrift fields.
  • Concurrency/lifecycle: getOlapTableMeta now keeps table metadata serialization and partition change collection under one table read lock, addressing the mixed-snapshot risk already raised. No new concurrency issue found in the reviewed diff.
  • Compatibility: New thrift fields are optional and appended. Checksum-less requests still follow the old version-only behavior, while the updated client bootstraps a checksum from cached partitions.
  • Parallel paths: Normal and temp partition refresh paths both carry checksums and separate updated/removed lists in the latest patch.
  • Data correctness: Existing review threads cover the main stale-cache risks. I did not find an additional distinct stale-cache path that is not already represented by those threads.
  • Tests: Unit tests cover checksum ordering stability, selected replica fields, rename/state/bucket/nextVersion changes. I did not run tests in this review.
  • Observability/performance: No additional logging/metric requirement identified for this metadata refresh path; checksum cost is proportional to visible partition replica metadata during refresh.

User focus: No additional user-provided review focus was specified.

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.34% (1906/2433)
Line Coverage 64.85% (34024/52468)
Region Coverage 65.34% (17532/26833)
Branch Coverage 54.03% (9310/17230)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 36.88% (59/160) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.14% (21081/38940)
Line Coverage 37.63% (199626/530531)
Region Coverage 33.89% (156336/461322)
Branch Coverage 34.85% (67945/194984)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.97% (28204/38129)
Line Coverage 57.92% (306470/529154)
Region Coverage 55.06% (256439/465749)
Branch Coverage 56.58% (110738/195734)

@HonestManXin
Copy link
Copy Markdown
Contributor Author

run external

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/518) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.18% (27521/38129)
Line Coverage 55.56% (293988/529154)
Region Coverage 52.67% (245299/465749)
Branch Coverage 53.86% (105417/195734)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/518) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17616	4179	4099	4099
q2	q3	10744	1500	842	842
q4	4750	485	356	356
q5	8230	913	605	605
q6	299	186	141	141
q7	907	882	650	650
q8	10975	1667	1787	1667
q9	7350	4594	4593	4593
q10	6817	1797	1520	1520
q11	442	284	258	258
q12	652	428	301	301
q13	18155	3450	2837	2837
q14	264	263	239	239
q15	q16	817	779	713	713
q17	1007	964	966	964
q18	6744	5760	5638	5638
q19	1170	1396	1084	1084
q20	525	413	265	265
q21	5554	2704	2430	2430
q22	441	362	299	299
Total cold run time: 103459 ms
Total hot run time: 29501 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4523	4448	4414	4414
q2	q3	4569	4962	4340	4340
q4	2141	2192	1401	1401
q5	4499	4321	4672	4321
q6	271	218	169	169
q7	2204	1889	1677	1677
q8	2637	2315	2270	2270
q9	8426	8087	8028	8028
q10	4871	4833	4324	4324
q11	627	510	410	410
q12	782	788	590	590
q13	3411	3639	2919	2919
q14	300	290	295	290
q15	q16	719	752	655	655
q17	1680	1392	1408	1392
q18	8014	7564	7310	7310
q19	1147	1125	1114	1114
q20	2238	2266	1935	1935
q21	5388	4753	4654	4654
q22	530	496	409	409
Total cold run time: 58977 ms
Total hot run time: 52622 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 169384 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 db5061cfaa818181fbcfaeeefc597cf12ab87b10, data reload: false

query5	4322	632	481	481
query6	434	201	179	179
query7	4815	562	297	297
query8	386	240	211	211
query9	8783	4124	4100	4100
query10	450	317	289	289
query11	5948	2379	2220	2220
query12	160	105	102	102
query13	1248	609	441	441
query14	6649	5452	5061	5061
query14_1	4416	4445	4417	4417
query15	205	196	178	178
query16	1004	475	366	366
query17	1108	690	575	575
query18	2673	489	342	342
query19	197	181	142	142
query20	114	110	106	106
query21	215	150	123	123
query22	13654	13592	13493	13493
query23	17272	16501	16120	16120
query23_1	16244	16149	16314	16149
query24	7607	1804	1308	1308
query24_1	1306	1297	1290	1290
query25	588	477	415	415
query26	1316	314	169	169
query27	2655	574	352	352
query28	4452	2050	2014	2014
query29	1129	632	504	504
query30	307	243	200	200
query31	1144	1089	976	976
query32	111	67	62	62
query33	536	333	270	270
query34	1160	1168	661	661
query35	765	814	671	671
query36	1378	1388	1216	1216
query37	154	109	98	98
query38	3192	3179	3065	3065
query39	942	920	892	892
query39_1	895	892	885	885
query40	232	127	107	107
query41	71	68	68	68
query42	98	97	99	97
query43	335	345	291	291
query44	
query45	206	186	190	186
query46	1098	1206	734	734
query47	2362	2413	2285	2285
query48	400	432	297	297
query49	672	487	372	372
query50	1004	372	260	260
query51	4320	4327	4285	4285
query52	91	91	80	80
query53	255	269	213	213
query54	289	240	219	219
query55	85	78	74	74
query56	279	263	238	238
query57	1454	1408	1318	1318
query58	264	225	226	225
query59	1623	1685	1528	1528
query60	314	261	235	235
query61	186	182	180	180
query62	699	716	591	591
query63	221	184	197	184
query64	2519	770	612	612
query65	
query66	1733	465	347	347
query67	29931	29731	29633	29633
query68	
query69	424	301	253	253
query70	961	994	965	965
query71	289	218	211	211
query72	2974	2278	2411	2278
query73	824	766	462	462
query74	5154	4924	4792	4792
query75	2658	2600	2229	2229
query76	2335	1149	787	787
query77	354	378	296	296
query78	12533	12439	11807	11807
query79	1442	1049	748	748
query80	1176	473	389	389
query81	509	294	246	246
query82	583	158	122	122
query83	346	274	248	248
query84	260	141	117	117
query85	944	536	435	435
query86	410	315	288	288
query87	3396	3354	3191	3191
query88	3657	2744	2759	2744
query89	432	384	328	328
query90	1774	188	190	188
query91	177	169	141	141
query92	66	65	62	62
query93	1514	1569	902	902
query94	633	350	307	307
query95	686	496	343	343
query96	1067	772	334	334
query97	2710	2684	2539	2539
query98	211	226	214	214
query99	1142	1170	1032	1032
Total cold run time: 252773 ms
Total hot run time: 169384 ms

@morningman
Copy link
Copy Markdown
Contributor

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review completed on the current PR diff. I did not find additional distinct blocking issues beyond the existing inline review threads, and the current head appears to address those previously raised concerns: checksum-less cached partitions are bootstrapped, normal and temp partition updates are separated, replica query-affecting fields and top-level partition fields are included in the checksum, and table metadata plus partition payload decisions are built under one table read lock.\n\nCritical checkpoint conclusions:\n- Goal/test coverage: the change targets refreshing remote OLAP partitions when replica/top-level partition metadata changes without visible-version changes; new checksum unit coverage was added for replica query fields and partition top-level fields.\n- Scope/minimality: the current six-file PR is focused on remote OLAP metadata refresh and thrift checksum propagation.\n- Concurrency/lifecycle: the response snapshot is now protected by a single table read lock; I did not find another distinct locking issue.\n- Configuration/incompatible changes: no config changes; thrift fields are optional, preserving mixed-version tolerance.\n- Parallel paths: normal and temp partition paths are both updated.\n- Data correctness: checksum propagation now covers the already-reviewed stale-cache paths for replica relocation, partition rename/state, and checksum bootstrap.\n- Tests/results: FE unit tests cover checksum stability and invalidation; no generated regression result issue applies to this PR.\n- Observability/performance: no additional observability requirement found; checksum work is limited to metadata refresh.\n- User focus: no additional user-provided review focus was supplied.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants