Skip to content

[feat](cloud) Support Cloud partition inverted format rollout - #66475

Open
hoshinojyunn wants to merge 1 commit into
apache:masterfrom
hoshinojyunn:fix/rowset
Open

[feat](cloud) Support Cloud partition inverted format rollout#66475
hoshinojyunn wants to merge 1 commit into
apache:masterfrom
hoshinojyunn:fix/rowset

Conversation

@hoshinojyunn

@hoshinojyunn hoshinojyunn commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Cloud tables previously had one table-level inverted_index_storage_format, so an online V2-to-V3 migration required all partitions to move together. This prevents a gradual rollout and cannot retain the format selected when an existing partition was created while new partitions use a new default.

This PR adds the Cloud-only table property partition.inverted_index_storage_format. It is the default for partitions created after the property is set. The property supports V2 and V3; V1 is rejected. Existing partitions and their tablet metadata are not rewritten by a property update.

  • Persist the resolved base-index inverted-index storage format in PartitionInfo for every Cloud partition. The value is durable in journal replay and is transferred through partition creation, recycle, recovery, and replacement metadata.
  • New explicit, automatic, and dynamic partitions use the current partition format default. Existing partitions retain their recorded format, allowing V2 and V3 to coexist in one table.
  • Tablet and rowset metadata persist the physical format independently of shared schema metadata so that mixed-format partitions remain distinguishable throughout a rolling upgrade.
  • SHOW PARTITIONS, SHOW PARTITION, SHOW PARTITION ID, and the partitions TVF expose InvertedIndexStorageFormat from PartitionInfo rather than reading tablet metadata from MetaService for this value.

Basic usage, with enable_partition_inverted_index_storage_format_rollout enabled:

CREATE TABLE partition_format_demo (
    k DATE NOT NULL,
    v STRING,
    INDEX idx_v (v) USING INVERTED
) ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_v2 VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE partition_format_demo
    SET ("partition.inverted_index_storage_format" = "V3");
ALTER TABLE partition_format_demo
    ADD PARTITION p_v3 VALUES [("2024-01-01"), ("2025-01-01"));
SHOW PARTITIONS FROM partition_format_demo;

Expected result:

the existing p_v2 partition remains V2, while the newly created p_v3 partition is V3. The InvertedIndexStorageFormat column returned by SHOW PARTITIONS therefore contains V2 for p_v2 and V3 for p_v3. Changing the default again affects only partitions created afterwards.

Coverage area Implementation coverage Test coverage
Property resolution and partition metadata partition.inverted_index_storage_format takes precedence, the legacy table property remains the fallback, and the resolved format is persisted per Cloud partition. FE unit coverage for property analysis, table creation, table properties, and partition persistence.
Partition creation paths Explicit range/list partitions, auto partitions, and dynamic partitions use the current resolved partition-format default. Cloud rollout regression coverage.
Mixed-format storage compatibility Coexisting V2/V3 partitions retain their own tablet and rowset metadata format. BE rowset/tablet metadata unit coverage and Cloud rowset-schema regression coverage.
Recycle, recovery, and replacement paths The persisted partition format survives recycle/recover, truncate, and insert-overwrite metadata paths. FE recycle/recover unit coverage and Cloud recycle/truncate regression coverage.
Metadata observability Partition format is served from FE PartitionInfo, avoiding per-partition tablet-meta reads for SHOW and TVF output. Cloud format regression coverage and partitions TVF coverage.

Release note

Cloud OLAP tables can roll out inverted-index file storage formats by partition. New partitions can use V3 while existing V2 partitions remain online and queryable.

Check List (For Author)

  • Test

    • Regression test
      • test_partition_cloud_inverted_index_storage_format_meta_write_switch
    • Unit Test
      • FE partition-property, persistence, recycle/recover, and Cloud schema-change tests
      • BE rowset and tablet metadata tests
    • 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. Cloud tables accept partition.inverted_index_storage_format; it affects subsequently created partitions and exposes the resolved format in partition metadata commands.
  • 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

@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?

@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17631	3930	3892	3892
q2	1997	318	200	200
q3	10954	1364	815	815
q4	4736	473	339	339
q5	8386	824	560	560
q6	351	183	143	143
q7	830	801	608	608
q8	10601	1595	1592	1592
q9	5515	4130	4073	4073
q10	6824	1625	1356	1356
q11	515	348	343	343
q12	780	574	464	464
q13	18129	3293	2768	2768
q14	261	260	243	243
q15	q16	737	731	663	663
q17	1098	1024	942	942
q18	6700	5612	5529	5529
q19	1397	1277	1116	1116
q20	790	698	606	606
q21	5747	2605	2543	2543
q22	417	352	308	308
Total cold run time: 104396 ms
Total hot run time: 29103 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4480	4297	4195	4195
q2	270	312	203	203
q3	4559	4959	4362	4362
q4	2138	2264	1370	1370
q5	4226	4172	4101	4101
q6	232	190	135	135
q7	1732	2051	1643	1643
q8	2502	2154	2068	2068
q9	7264	7244	7111	7111
q10	4305	4244	3858	3858
q11	538	427	354	354
q12	713	733	497	497
q13	3387	3490	2925	2925
q14	294	322	269	269
q15	q16	723	771	642	642
q17	1279	1296	1330	1296
q18	12133	10955	11905	10955
q19	1187	1160	1165	1160
q20	2229	2231	1920	1920
q21	5671	4688	4523	4523
q22	516	454	398	398
Total cold run time: 60378 ms
Total hot run time: 53985 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 165848 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 cc40ae36e60695cd0207e27d34944136d155d159, data reload: false

query5	4341	596	462	462
query6	458	210	211	210
query7	4840	594	315	315
query8	317	158	144	144
query9	8788	3965	3950	3950
query10	483	353	333	333
query11	5778	2170	1985	1985
query12	151	99	93	93
query13	1255	599	432	432
query14	6041	4239	3962	3962
query14_1	3778	3750	3797	3750
query15	195	193	177	177
query16	994	461	423	423
query17	912	666	522	522
query18	2416	485	345	345
query19	207	188	146	146
query20	106	103	102	102
query21	230	153	134	134
query22	12967	12923	12736	12736
query23	15741	14763	14592	14592
query23_1	14639	14693	14676	14676
query24	7516	1714	1245	1245
query24_1	1263	1239	1226	1226
query25	570	434	379	379
query26	1312	358	209	209
query27	2600	619	374	374
query28	4610	1971	1991	1971
query29	1058	616	485	485
query30	343	263	229	229
query31	1175	1117	1042	1042
query32	112	65	64	64
query33	539	315	259	259
query34	1164	1114	636	636
query35	756	761	643	643
query36	790	756	670	670
query37	155	105	89	89
query38	1828	1777	1651	1651
query39	808	828	797	797
query39_1	778	778	804	778
query40	243	162	143	143
query41	67	65	65	65
query42	93	94	92	92
query43	313	319	271	271
query44	1427	770	762	762
query45	196	170	169	169
query46	1031	1133	703	703
query47	1555	1517	1459	1459
query48	406	415	325	325
query49	590	410	277	277
query50	1108	418	343	343
query51	10825	10552	10635	10552
query52	92	92	80	80
query53	266	268	194	194
query54	269	232	215	215
query55	76	74	66	66
query56	308	304	292	292
query57	1029	1010	924	924
query58	280	255	255	255
query59	1492	1554	1351	1351
query60	302	263	257	257
query61	151	163	145	145
query62	390	320	261	261
query63	232	198	191	191
query64	2846	1005	816	816
query65	3840	3836	3820	3820
query66	1816	470	345	345
query67	28235	28111	28035	28035
query68	3083	1499	1031	1031
query69	413	297	252	252
query70	852	785	786	785
query71	390	323	304	304
query72	3045	2619	2428	2428
query73	893	783	429	429
query74	4643	4498	4309	4309
query75	2386	2361	2004	2004
query76	2322	1148	760	760
query77	332	375	286	286
query78	11097	11223	10516	10516
query79	1367	1183	702	702
query80	769	596	506	506
query81	485	338	288	288
query82	635	178	134	134
query83	423	344	318	318
query84	323	165	136	136
query85	1062	650	525	525
query86	370	260	222	222
query87	1978	1987	1822	1822
query88	3780	2810	2773	2773
query89	395	316	304	304
query90	1774	195	191	191
query91	194	181	160	160
query92	59	59	54	54
query93	1547	1544	967	967
query94	615	362	292	292
query95	801	601	480	480
query96	1036	801	348	348
query97	2474	2430	2339	2339
query98	191	191	184	184
query99	740	737	617	617
Total cold run time: 252144 ms
Total hot run time: 165848 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.71 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit cc40ae36e60695cd0207e27d34944136d155d159, data reload: false

query1	0.01	0.01	0.00
query2	0.14	0.09	0.08
query3	0.36	0.24	0.24
query4	1.60	0.24	0.24
query5	0.33	0.31	0.32
query6	1.16	0.71	0.68
query7	0.04	0.01	0.01
query8	0.09	0.07	0.07
query9	0.50	0.39	0.40
query10	0.60	0.59	0.61
query11	0.30	0.18	0.18
query12	0.31	0.18	0.18
query13	0.56	0.56	0.55
query14	0.93	0.94	0.93
query15	0.70	0.62	0.63
query16	0.40	0.39	0.39
query17	1.04	1.03	1.03
query18	0.30	0.28	0.27
query19	1.95	1.83	1.83
query20	0.02	0.01	0.02
query21	15.39	0.38	0.30
query22	4.80	0.13	0.12
query23	15.84	0.49	0.30
query24	2.36	0.63	0.41
query25	0.15	0.10	0.10
query26	0.73	0.26	0.22
query27	0.10	0.10	0.10
query28	3.41	0.84	0.43
query29	12.46	4.10	3.19
query30	0.36	0.27	0.26
query31	2.81	0.61	0.36
query32	3.22	0.65	0.51
query33	3.03	2.97	2.91
query34	15.74	4.26	3.44
query35	3.36	3.35	3.36
query36	0.66	0.54	0.53
query37	0.12	0.08	0.09
query38	0.09	0.07	0.06
query39	0.07	0.06	0.06
query40	0.20	0.18	0.17
query41	0.13	0.09	0.08
query42	0.09	0.06	0.06
query43	0.07	0.07	0.07
Total cold run time: 96.53 s
Total hot run time: 25.71 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 40.35% (69/171) 🎉
Increment coverage report
Complete coverage report

gavinchou
gavinchou previously approved these changes Aug 14, 2026
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Aug 15, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66475

Problem Summary: This change separately submits the Meta Service portion of apache#66475. During a partition-level inverted-index format rollout, a rowset can use a format that differs from its shared schema metadata. The recycler and checker previously selected index paths from shared schema metadata or its cache, which could target V1 paths for a rowset whose files use V3.

Persist the actual inverted-index storage format in rowset and tablet metadata. Make the recycler and checker prefer the rowset format, while retaining schema and schema-KV fallback for metadata written before the field existed. Add a Cloud unit test where the shared schema is V1 and the rowset is V3, verifying that recycler deletes the V3 index file.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - `./run-cloud-ut.sh --run --filter=recycler_test:RecyclerTest.delete_tmp_rowset_data_with_rowset_idx_v3`
- Behavior changed: Yes. Meta Service recycler and checker use each rowset\047s persisted inverted-index format when selecting index files.
- Does this need documentation: No
gavinchou pushed a commit that referenced this pull request Aug 18, 2026
Related PR: #66475

Problem Summary:

This PR separately submits the Meta Service changes from #66475. When
the shared schema format differs from the physical format used by an
existing rowset, recycler and checker must use the rowset format to
select the correct inverted-index files.

The change persists the physical inverted-index format in metadata and
makes recycler/checker prefer the rowset value, with the existing schema
and schema-KV fallback retained for old metadata.

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [x] Unit Test
- `./run-cloud-ut.sh --run
--filter=recycler_test:RecyclerTest.delete_tmp_rowset_data_with_rowset_idx_v3`
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
- [x] Yes. Recycler and checker select inverted-index files from the
persisted rowset format.

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
Issue Number: None

Related PR: None

Problem Summary: Cloud tables previously had a single table-level inverted-index storage format. That made V2-to-V3 upgrades all-or-nothing: updating the default could not preserve the format selected when existing partitions and their tablet metadata were created.

This change adds the Cloud-only partition.inverted_index_storage_format table property. It controls the format for subsequently created partitions, while each existing partition retains its resolved V2 or V3 format. The resolved value is durable in partition metadata and is carried through journal replay, recycle/recover, truncate, insert overwrite, and schema-change paths. Tablet and rowset metadata record the physical format separately so mixed-format partitions remain distinguishable during a rolling upgrade. Partition inspection commands read the value from FE partition metadata.

Cloud OLAP tables can roll out inverted-index storage formats by partition. New partitions can use V3 while existing V2 partitions remain online and queryable.

- Test: Regression test / Unit Test
    - FE unit tests covering partition properties, persistence, recycle/recover, and Cloud schema-change handling
    - BE unit tests covering rowset and tablet metadata serialization
    - Cloud regression test: test_partition_cloud_inverted_index_storage_format_meta_write_switch
- Behavior changed: Yes. Cloud tables accept partition.inverted_index_storage_format for new partitions and expose the resolved format in partition metadata commands.
- Does this need documentation: No
@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17572	3160	3148	3148
q2	1948	243	153	153
q3	10413	859	516	516
q4	4676	254	206	206
q5	7673	579	401	401
q6	139	116	94	94
q7	542	510	392	392
q8	9249	935	932	932
q9	3514	2400	2409	2400
q10	6517	864	720	720
q11	452	262	243	243
q12	696	400	325	325
q13	17867	1583	1179	1179
q14	160	153	145	145
q15	q16	440	402	360	360
q17	754	721	763	721
q18	3121	2237	2227	2227
q19	1105	853	692	692
q20	621	529	485	485
q21	5264	1766	1952	1766
q22	337	269	237	237
Total cold run time: 93060 ms
Total hot run time: 17342 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3508	3420	3481	3420
q2	218	220	172	172
q3	2237	2306	2169	2169
q4	1206	1185	900	900
q5	2204	2117	2125	2117
q6	172	123	87	87
q7	1035	925	811	811
q8	1667	1427	1431	1427
q9	3183	3136	3135	3135
q10	1835	1776	1635	1635
q11	360	281	260	260
q12	474	432	340	340
q13	1496	1534	1145	1145
q14	172	182	162	162
q15	q16	398	394	361	361
q17	1070	1055	1058	1055
q18	4974	4406	4761	4406
q19	877	860	878	860
q20	972	941	815	815
q21	3732	3153	3273	3153
q22	419	343	307	307
Total cold run time: 32209 ms
Total hot run time: 28737 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 83255 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 513370a6a1103a822b52db365202338ec97516dd, data reload: false

query5	4282	422	338	338
query6	413	161	176	161
query7	4881	467	274	274
query8	293	127	131	127
query9	8673	2916	2910	2910
query10	443	270	212	212
query11	5369	1042	943	943
query12	116	68	69	68
query13	1182	444	308	308
query14	6156	2254	2131	2131
query14_1	2013	1974	1978	1974
query15	174	140	115	115
query16	924	360	344	344
query17	773	429	339	339
query18	2324	321	233	233
query19	169	136	108	108
query20	71	67	67	67
query21	213	114	100	100
query22	5316	5289	5358	5289
query23	6576	6087	6081	6081
query23_1	6165	5936	6011	5936
query24	7314	1104	754	754
query24_1	750	775	773	773
query25	408	291	236	236
query26	1247	283	173	173
query27	2691	453	286	286
query28	4663	1524	1509	1509
query29	927	423	337	337
query30	278	182	149	149
query31	860	421	353	353
query32	96	48	47	47
query33	444	210	166	166
query34	993	829	468	468
query35	418	395	335	335
query36	571	563	527	527
query37	120	79	66	66
query38	1002	836	813	813
query39	499	459	454	454
query39_1	475	479	445	445
query40	222	123	109	109
query41	53	51	51	51
query42	79	79	81	79
query43	247	246	211	211
query44	1017	549	541	541
query45	112	108	99	99
query46	771	835	551	551
query47	782	760	711	711
query48	313	319	234	234
query49	529	238	188	188
query50	809	325	282	282
query51	8220	8252	7982	7982
query52	73	77	68	68
query53	214	219	163	163
query54	259	205	183	183
query55	79	62	68	62
query56	358	234	230	230
query57	685	653	630	630
query58	233	192	192	192
query59	1253	1267	1121	1121
query60	292	219	203	203
query61	134	130	136	130
query62	387	204	193	193
query63	193	156	158	156
query64	2947	782	597	597
query65	1626	1634	1591	1591
query66	1957	316	264	264
query67	9869	10113	9728	9728
query68	3001	1152	763	763
query69	345	218	199	199
query70	685	642	605	605
query71	290	260	263	260
query72	2343	1769	1568	1568
query73	657	628	318	318
query74	1968	1221	1137	1137
query75	1236	1135	1001	1001
query76	2371	738	567	567
query77	260	251	213	213
query78	3945	3651	3244	3244
query79	2898	848	609	609
query80	1588	385	337	337
query81	523	198	176	176
query82	642	150	108	108
query83	324	252	241	241
query84	319	124	105	105
query85	886	428	383	383
query86	476	176	171	171
query87	1026	972	886	886
query88	3030	2127	2152	2127
query89	323	230	204	204
query90	2022	147	140	140
query91	159	154	125	125
query92	60	48	45	45
query93	2028	1162	743	743
query94	628	233	223	223
query95	627	419	328	328
query96	863	578	263	263
query97	1066	1057	992	992
query98	186	142	135	135
query99	423	356	318	318
Total cold run time: 180567 ms
Total hot run time: 83255 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.54 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 513370a6a1103a822b52db365202338ec97516dd, data reload: false

query1	0.01	0.00	0.00
query2	0.07	0.03	0.03
query3	0.25	0.12	0.11
query4	1.60	0.10	0.10
query5	0.18	0.16	0.16
query6	1.19	0.71	0.67
query7	0.03	0.00	0.00
query8	0.05	0.03	0.03
query9	0.31	0.21	0.21
query10	0.34	0.36	0.34
query11	0.19	0.12	0.11
query12	0.14	0.12	0.12
query13	0.30	0.30	0.30
query14	0.45	0.45	0.46
query15	0.36	0.36	0.35
query16	0.23	0.22	0.21
query17	0.66	0.64	0.66
query18	0.19	0.15	0.16
query19	1.18	1.18	1.16
query20	0.02	0.01	0.01
query21	15.44	0.16	0.11
query22	5.09	0.05	0.04
query23	16.22	0.26	0.10
query24	3.03	0.32	0.25
query25	0.12	0.04	0.04
query26	0.71	0.16	0.13
query27	0.04	0.03	0.04
query28	3.61	0.53	0.28
query29	12.45	3.17	2.58
query30	0.25	0.12	0.12
query31	2.76	0.37	0.17
query32	3.50	0.32	0.23
query33	1.37	1.34	1.39
query34	15.36	2.21	1.75
query35	1.70	1.70	1.71
query36	0.46	0.29	0.29
query37	0.06	0.04	0.04
query38	0.04	0.04	0.03
query39	0.03	0.03	0.02
query40	0.12	0.09	0.07
query41	0.08	0.02	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 90.27 s
Total hot run time: 14.54 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 60.54% (89/147) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (14/14) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 62.20% (28928/46508)
Line Coverage 47.27% (302883/640693)
Region Coverage 42.94% (244425/569268)
Branch Coverage 44.52% (113807/255608)

@airborne12

Copy link
Copy Markdown
Member

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review step was failure (possibly timeout or cancelled)
Workflow run: https://github.com/apache/doris/actions/runs/32362189018

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

@airborne12 airborne12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@airborne12

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes: I found eight independently verified issues (seven P1, one P2) in the per-partition inverted-index format rollout.

Review coverage and checkpoint conclusions:

  • Goal and test: the PR adds durable per-partition V2/V3/SNII selection across FE and BE metadata plus SHOW/TVF observability. The happy-path unit and regression coverage is broad, but it does not exercise the restart/failover, mixed-version activation, selected restore, snapshot-rowset restore, truncate-old-partition recovery, or value-level TVF cases that expose these issues.
  • Scope and focus: reviewed all 51 changed files and all 3,817 lines of the authoritative diff; no additional user-provided focus was present.
  • Concurrency, lifecycle, and initialization: no separate lock-order or static-initialization defect was found. The material lifecycle failures are process-local config drift after FE restart/failover, truncate/recover metadata loss, and selected/snapshot restore omissions.
  • Configuration dynamics: rollout enablement changes interpretation of already-persisted metadata but is mutable, master-only, default-false, and non-journaled. Durable raw values must remain authoritative after activation.
  • Compatibility and rolling upgrade: the new top-level BE discriminators work only after every serving BE understands them; activation currently has neither an enforced capability fence nor a documented and tested operator precondition.
  • Parallel paths and special conditions: ordinary create/add/auto/dynamic/temp/insert-overwrite, load, compaction, partial update, schema change, protobuf conversion, cache resolution, and rollup paths were traced. Snapshot restore remains a direct writer bypass, selected-partition restore omits the FE map, and ALTER/ADD/BUILD validation is still table-scoped despite per-partition V2/V3/SNII execution.
  • Tests and results: no local builds or tests were run, as required by the review-only bundle. On the reviewed head, every non-skipped GitHub check is successful, including CheckStyle, Clang Formatter, License Check, secret/dependency checks, and BE UT on macOS; those checks do not cover the failure paths above.
  • Observability: SHOW/PROC and the BE debug synchronization path were checked without another defect, but the $partitions TVF maps the new field to BinlogSize rather than the format column.
  • Persistence, failover, and write safety: image/add-partition/recycle persistence and normal metadata conversions were checked. The accepted findings cover non-deterministic FE interpretation, truncate recycle loss, selected restore publication, and rowset-schema detachment during snapshot restore; no separate atomicity or crash-window issue was substantiated.
  • FE/BE variable paths: FE creation and schema-change consumers were traced to the per-partition getters, and BE tablet/rowset override propagation was traced through shared schema-KV resolution. The identified gaps are the old-BE path and the direct restore writer.
  • Performance: the new test mocks away the production Env.modifyTableProperties path, which still scans all partitions under the table write lock for this future-only property. No other material regression was found.
  • Other issues: all candidates were independently validated and deduplicated against the live PR. Round 2 complete-review and risk-focused passes all reported NO_NEW_VALUABLE_FINDINGS, so review convergence was reached without a third round.

Comment thread fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
Comment thread fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
Comment thread be/src/cloud/cloud_rowset_writer.cpp
// init _schema
TabletSchemaSPtr schema = std::make_shared<TabletSchema>();
schema->init_from_pb(tablet_meta_pb.schema());
TabletSchemaPB schema_pb = tablet_meta_pb.schema();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P1] Enforce or document the old-BE activation precondition. These top-level overrides are the only place a BE distinguishes two physical formats sharing one schema-KV key; a pre-change BE ignores the unknown fields and uses whichever format the shared schema contains. The default-false switch can serve as a manual fence only if operators wait until every serving BE supports these fields, but the dynamic setter performs no capability/version check and the PR adds no documented/tested activation order. Enabling it while an old BE still serves lets that BE read or write a new V3/SNII partition as V2. Please enforce the all-BEs-supported precondition, or make the activation contract explicit and test it.

new Column("UnsyncTables", ScalarType.createStringType()),
new Column("CommittedVersion", ScalarType.createType(PrimitiveType.BIGINT)),
new Column("RowCount", ScalarType.createType(PrimitiveType.BIGINT)),
new Column("InvertedIndexStorageFormat", ScalarType.createStringType()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P1] Keep the TVF schema aligned with the proc row. PartitionsProcDir emits CommittedVersion, RowCount, BinlogSize, then InvertedIndexStorageFormat, but this schema omits BinlogSize and derives source indices from its own ordinal. MetadataGenerator therefore fetches proc cell 22 for the new field, returning a human-readable binlog size instead of V2/V3/SNII. Add BinlogSize before this column (or use an explicit source map) and add a value-level TVF assertion.

new CloudSchemaChangeHandler().updateTableProperties(database, "tbl", properties);

Mockito.verify(env).modifyTableProperties(database, table, properties);
Mockito.verify(table, Mockito.never()).getAllPartitions();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] This test does not exercise the scan it claims to exclude. Env is mocked, so modifyTableProperties never reaches its real unconditional table.getPartitions loop, which runs under the table write lock and rewrites in-memory/storage-policy entries even when this future-only property is the sole change. On a large auto-partitioned table the new ALTER remains O(partitions). Please skip that generic propagation when no partition-wide property changed and make the test execute or directly cover the real Env path.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (8/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 65.03% (29295/45051)
Line Coverage 49.90% (316066/633363)
Region Coverage 45.78% (259624/567146)
Branch Coverage 46.95% (119672/254885)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 8.79% (69/785) 🎉
Increment coverage report
Complete coverage report

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.

4 participants