Skip to content

[Feature](partition) Support new partition recycle mechanism - #57013

Merged
zclllyybb merged 5 commits into
apache:masterfrom
zclllyybb:new_partition
Nov 12, 2025
Merged

[Feature](partition) Support new partition recycle mechanism#57013
zclllyybb merged 5 commits into
apache:masterfrom
zclllyybb:new_partition

Conversation

@zclllyybb

@zclllyybb zclllyybb commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

now support:

create table auto_recycle(
    k0 datetime(6) not null
)
auto partition by range (date_trunc(k0, 'day')) ()
DISTRIBUTED BY HASH(`k0`) BUCKETS 1
properties(
    "replication_num" = "1",
    "partition.retention_count" = "3"
);

which means only keep the latest 3 partition in history partitions.

ccr will be tested in selectdb/ccr-syncer#646

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?

Check List (For Reviewer who merge this PR)

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

@Thearas

Thearas commented Oct 15, 2025

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?

@zclllyybb

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 190623 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 3261f0649b07b2ee820ba5442aff1a4fc65ab3c2, data reload: false

query1	1107	453	415	415
query2	6584	1668	1642	1642
query3	6754	220	224	220
query4	26350	23672	23301	23301
query5	5869	657	493	493
query6	350	249	212	212
query7	4661	498	311	311
query8	321	270	256	256
query9	8728	2622	2591	2591
query10	571	374	317	317
query11	16073	15415	14955	14955
query12	187	121	120	120
query13	1695	579	446	446
query14	12630	9198	9200	9198
query15	259	195	187	187
query16	7835	680	503	503
query17	1622	898	747	747
query18	2117	473	340	340
query19	364	200	179	179
query20	143	140	146	140
query21	231	151	117	117
query22	5089	4891	4673	4673
query23	34825	33956	34196	33956
query24	8203	2500	2572	2500
query25	583	557	460	460
query26	1253	298	166	166
query27	2876	514	364	364
query28	4415	2275	2238	2238
query29	854	615	515	515
query30	313	241	220	220
query31	939	848	794	794
query32	87	84	79	79
query33	627	383	340	340
query34	829	942	514	514
query35	835	861	807	807
query36	1046	1046	928	928
query37	134	113	95	95
query38	3603	3806	3493	3493
query39	1479	1430	1405	1405
query40	221	133	117	117
query41	67	57	102	57
query42	125	114	104	104
query43	474	517	474	474
query44	1329	833	825	825
query45	188	179	175	175
query46	843	1030	639	639
query47	1810	1876	1770	1770
query48	402	429	320	320
query49	775	511	414	414
query50	640	681	403	403
query51	3988	3870	3969	3870
query52	110	108	109	108
query53	255	273	197	197
query54	620	583	525	525
query55	95	86	85	85
query56	377	307	304	304
query57	1204	1202	1143	1143
query58	292	281	279	279
query59	2610	2718	2558	2558
query60	347	334	329	329
query61	150	156	159	156
query62	807	752	686	686
query63	232	192	195	192
query64	4428	1149	821	821
query65	4037	3959	3951	3951
query66	1027	431	331	331
query67	15533	15433	15409	15409
query68	6877	937	593	593
query69	493	322	295	295
query70	1377	1299	1351	1299
query71	509	356	322	322
query72	5927	4968	4880	4880
query73	576	592	364	364
query74	8882	8943	8636	8636
query75	4296	3298	2721	2721
query76	4716	1152	740	740
query77	938	390	311	311
query78	9696	10027	8938	8938
query79	2219	818	583	583
query80	688	557	509	509
query81	485	263	230	230
query82	438	163	134	134
query83	297	270	241	241
query84	308	114	93	93
query85	892	474	423	423
query86	353	323	306	306
query87	3788	3718	3633	3633
query88	3350	2296	2223	2223
query89	398	323	303	303
query90	2036	222	215	215
query91	163	161	133	133
query92	79	74	66	66
query93	1155	989	646	646
query94	685	445	342	342
query95	388	321	322	321
query96	491	582	279	279
query97	2996	2972	2863	2863
query98	243	222	213	213
query99	1475	1415	1289	1289
Total cold run time: 282641 ms
Total hot run time: 190623 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.26	0.08	0.08
query4	1.60	0.11	0.12
query5	0.28	0.27	0.25
query6	1.17	0.65	0.64
query7	0.03	0.03	0.02
query8	0.06	0.04	0.05
query9	0.61	0.54	0.52
query10	0.60	0.57	0.58
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.63	0.61	0.61
query14	1.03	1.03	1.03
query15	0.87	0.87	0.85
query16	0.40	0.39	0.40
query17	1.04	1.04	1.04
query18	0.22	0.20	0.21
query19	1.97	1.85	1.87
query20	0.02	0.02	0.01
query21	15.48	0.92	0.57
query22	0.75	1.08	0.61
query23	15.09	1.39	0.61
query24	6.45	1.43	1.16
query25	0.48	0.08	0.20
query26	0.68	0.15	0.13
query27	0.07	0.06	0.06
query28	9.53	1.41	0.93
query29	12.57	4.08	3.26
query30	0.28	0.14	0.12
query31	2.84	0.60	0.39
query32	3.24	0.57	0.48
query33	3.00	3.14	3.12
query34	16.17	5.41	4.83
query35	4.90	4.87	4.88
query36	0.71	0.50	0.51
query37	0.10	0.07	0.08
query38	0.08	0.05	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 104.07 s
Total hot run time: 30.64 s

@zclllyybb

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 189945 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 4a6ce988ffb0e319d45b8b7f55959bed78ab9742, data reload: false

query1	1048	432	395	395
query2	6550	1790	1717	1717
query3	6758	243	225	225
query4	26148	23771	22932	22932
query5	5136	657	503	503
query6	347	257	249	249
query7	4667	493	308	308
query8	331	273	272	272
query9	8700	2590	2582	2582
query10	549	373	286	286
query11	15377	15020	14724	14724
query12	201	122	115	115
query13	1685	562	450	450
query14	11542	9301	9351	9301
query15	251	189	173	173
query16	8391	690	569	569
query17	1746	827	642	642
query18	2124	460	385	385
query19	278	226	181	181
query20	141	164	132	132
query21	263	144	123	123
query22	4637	4851	4726	4726
query23	34892	33531	34096	33531
query24	8899	2445	2481	2445
query25	581	534	472	472
query26	1225	288	169	169
query27	2821	520	383	383
query28	4335	2327	2199	2199
query29	777	647	514	514
query30	316	253	220	220
query31	970	879	786	786
query32	89	79	70	70
query33	597	374	359	359
query34	802	846	534	534
query35	804	835	756	756
query36	964	1009	901	901
query37	122	112	83	83
query38	3534	3571	3496	3496
query39	1474	1427	1403	1403
query40	229	124	113	113
query41	64	58	59	58
query42	126	111	108	108
query43	484	505	478	478
query44	1340	842	832	832
query45	189	188	173	173
query46	848	994	628	628
query47	1772	1808	1727	1727
query48	411	426	306	306
query49	751	507	421	421
query50	648	689	413	413
query51	3916	3987	3878	3878
query52	108	118	101	101
query53	237	267	202	202
query54	602	600	530	530
query55	90	86	85	85
query56	346	319	309	309
query57	1177	1175	1134	1134
query58	297	277	287	277
query59	2581	2650	2489	2489
query60	353	361	355	355
query61	188	187	217	187
query62	798	731	694	694
query63	235	203	215	203
query64	4391	1167	848	848
query65	4034	3962	3936	3936
query66	1068	432	332	332
query67	15422	15038	15108	15038
query68	8035	953	617	617
query69	485	329	284	284
query70	1379	1314	1309	1309
query71	502	334	317	317
query72	6064	4904	4776	4776
query73	708	573	360	360
query74	8813	9008	9006	9006
query75	3966	3472	2887	2887
query76	3733	1180	738	738
query77	814	423	332	332
query78	9519	9798	8968	8968
query79	2434	857	590	590
query80	694	595	515	515
query81	495	269	226	226
query82	449	163	131	131
query83	292	275	251	251
query84	312	112	102	102
query85	865	465	436	436
query86	341	309	286	286
query87	3812	3812	3652	3652
query88	2894	2285	2282	2282
query89	412	327	303	303
query90	2010	218	220	218
query91	182	161	140	140
query92	80	72	64	64
query93	1132	980	656	656
query94	696	443	332	332
query95	402	316	318	316
query96	495	578	289	289
query97	2961	2973	2863	2863
query98	240	222	224	222
query99	1500	1412	1311	1311
Total cold run time: 279493 ms
Total hot run time: 189945 ms

@doris-robot

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

query1	0.05	0.04	0.05
query2	0.09	0.05	0.06
query3	0.26	0.09	0.09
query4	1.60	0.11	0.11
query5	0.27	0.27	0.25
query6	1.18	0.65	0.64
query7	0.03	0.03	0.03
query8	0.05	0.07	0.04
query9	0.63	0.53	0.51
query10	0.58	0.58	0.57
query11	0.17	0.11	0.12
query12	0.16	0.12	0.12
query13	0.64	0.62	0.62
query14	1.02	1.04	1.03
query15	0.86	0.89	0.86
query16	0.41	0.41	0.40
query17	1.05	1.04	1.06
query18	0.22	0.20	0.20
query19	1.90	1.83	1.81
query20	0.02	0.02	0.01
query21	15.45	0.94	0.61
query22	0.77	1.20	0.78
query23	14.83	1.40	0.62
query24	7.16	2.84	0.41
query25	0.30	0.13	0.07
query26	0.44	0.17	0.13
query27	0.08	0.04	0.05
query28	9.31	1.35	0.93
query29	12.71	3.94	3.28
query30	0.30	0.14	0.11
query31	2.84	0.59	0.39
query32	3.26	0.55	0.48
query33	3.14	3.07	3.20
query34	16.12	5.45	4.85
query35	4.89	4.91	4.94
query36	0.69	0.54	0.50
query37	0.11	0.08	0.07
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.18	0.14	0.14
query41	0.09	0.03	0.03
query42	0.05	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 104.06 s
Total hot run time: 30.08 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 18.45% (19/103) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 70.87% (73/103) 🎉
Increment coverage report
Complete coverage report

Comment thread fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java Outdated
@dataroaring

Copy link
Copy Markdown
Contributor

what about using retention_count, e.g. "partition.retention_count" = "3"?

@zclllyybb

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

query1	1065	441	408	408
query2	6572	1725	1709	1709
query3	6752	223	222	222
query4	26387	23807	23492	23492
query5	5268	650	493	493
query6	333	247	227	227
query7	4656	496	299	299
query8	314	270	247	247
query9	8726	2579	2572	2572
query10	524	367	311	311
query11	15302	15274	14886	14886
query12	198	134	114	114
query13	1696	554	437	437
query14	11431	9340	9368	9340
query15	201	193	184	184
query16	7672	679	528	528
query17	1309	753	615	615
query18	2175	454	377	377
query19	215	224	221	221
query20	141	155	145	145
query21	267	134	123	123
query22	4910	4762	4526	4526
query23	34920	33881	33792	33792
query24	8552	2493	2604	2493
query25	641	601	506	506
query26	1351	303	196	196
query27	2736	521	383	383
query28	4556	2251	2242	2242
query29	856	684	536	536
query30	332	250	212	212
query31	1006	892	794	794
query32	87	80	67	67
query33	614	401	367	367
query34	843	928	557	557
query35	880	855	776	776
query36	974	1127	951	951
query37	132	127	86	86
query38	3760	3692	3631	3631
query39	1539	1402	1397	1397
query40	221	128	118	118
query41	60	61	56	56
query42	123	114	114	114
query43	494	507	481	481
query44	1396	827	822	822
query45	186	198	177	177
query46	844	998	633	633
query47	1788	1776	1769	1769
query48	392	422	331	331
query49	791	490	409	409
query50	668	689	417	417
query51	3971	3954	3863	3863
query52	112	108	97	97
query53	237	270	200	200
query54	628	592	539	539
query55	94	86	85	85
query56	309	316	321	316
query57	1206	1210	1110	1110
query58	294	275	284	275
query59	2616	2750	2580	2580
query60	364	340	327	327
query61	161	155	156	155
query62	820	728	666	666
query63	235	202	200	200
query64	4393	1178	894	894
query65	4150	3973	3973	3973
query66	1035	435	325	325
query67	15445	15169	15216	15169
query68	9388	955	593	593
query69	518	328	288	288
query70	1353	1275	1317	1275
query71	507	340	336	336
query72	5823	4947	4868	4868
query73	676	572	362	362
query74	9044	9233	8625	8625
query75	4560	3330	2822	2822
query76	3775	1157	746	746
query77	985	403	333	333
query78	9634	9816	8899	8899
query79	1948	835	607	607
query80	718	575	500	500
query81	490	259	300	259
query82	455	167	135	135
query83	303	270	251	251
query84	298	111	111	111
query85	900	497	434	434
query86	335	318	314	314
query87	3736	3776	3633	3633
query88	2932	2275	2245	2245
query89	419	334	290	290
query90	2046	224	231	224
query91	169	261	136	136
query92	85	70	67	67
query93	1300	1002	655	655
query94	699	464	335	335
query95	400	331	327	327
query96	503	578	279	279
query97	2987	2940	2884	2884
query98	236	214	213	213
query99	1433	1384	1299	1299
Total cold run time: 281581 ms
Total hot run time: 190908 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.10	0.06	0.06
query3	0.26	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.26	0.25
query6	1.17	0.66	0.65
query7	0.04	0.03	0.03
query8	0.06	0.05	0.04
query9	0.66	0.53	0.52
query10	0.59	0.58	0.58
query11	0.16	0.12	0.12
query12	0.16	0.12	0.13
query13	0.63	0.62	0.60
query14	1.03	1.03	1.04
query15	0.88	0.86	0.86
query16	0.41	0.40	0.40
query17	1.05	1.06	1.06
query18	0.22	0.21	0.20
query19	1.96	1.84	1.87
query20	0.02	0.01	0.01
query21	15.42	0.94	0.57
query22	0.75	1.06	0.64
query23	15.08	1.44	0.63
query24	6.98	1.52	0.69
query25	0.48	0.13	0.19
query26	0.67	0.16	0.13
query27	0.08	0.05	0.05
query28	9.61	1.43	0.96
query29	12.54	3.90	3.27
query30	0.28	0.14	0.14
query31	2.83	0.61	0.39
query32	3.24	0.55	0.48
query33	3.12	3.06	3.05
query34	16.20	5.48	4.84
query35	4.90	4.90	4.98
query36	0.70	0.52	0.54
query37	0.11	0.07	0.06
query38	0.07	0.05	0.05
query39	0.04	0.03	0.03
query40	0.19	0.16	0.14
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 104.81 s
Total hot run time: 30.38 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 18.27% (19/104) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 70.19% (73/104) 🎉
Increment coverage report
Complete coverage report

@yujun777 yujun777 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.

LGTM

@dataroaring dataroaring 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.

LGTM

@zclllyybb
zclllyybb merged commit 4058843 into apache:master Nov 12, 2025
42 of 47 checks passed
@zclllyybb
zclllyybb deleted the new_partition branch November 12, 2025 04:04
github-actions Bot pushed a commit that referenced this pull request Nov 12, 2025
now support:
```sql
create table auto_recycle(
    k0 datetime(6) not null
)
auto partition by range (date_trunc(k0, 'day')) ()
DISTRIBUTED BY HASH(`k0`) BUCKETS 1
properties(
    "replication_num" = "1",
    "partition.retention_count" = "3"
);
```
which means only keep the latest 3 partition in history partitions.

ccr will be tested in selectdb/ccr-syncer#646

### Release note

Resolve the problem of different name format when need to recycle auto partition
wyxxxcat pushed a commit to wyxxxcat/doris that referenced this pull request Nov 13, 2025
…57013)

now support:
```sql
create table auto_recycle(
    k0 datetime(6) not null
)
auto partition by range (date_trunc(k0, 'day')) ()
DISTRIBUTED BY HASH(`k0`) BUCKETS 1
properties(
    "replication_num" = "1",
    "partition.retention_count" = "3"
);
```
which means only keep the latest 3 partition in history partitions.

ccr will be tested in selectdb/ccr-syncer#646

### Release note

Resolve the problem of different name format when need to recycle auto partition
yiguolei pushed a commit that referenced this pull request Nov 13, 2025
…ism #57013 (#57939)

Cherry-picked from #57013

Co-authored-by: zclllyybb <zhaochangle@selectdb.com>
wyxxxcat pushed a commit to wyxxxcat/doris that referenced this pull request Nov 18, 2025
…57013)

now support:
```sql
create table auto_recycle(
    k0 datetime(6) not null
)
auto partition by range (date_trunc(k0, 'day')) ()
DISTRIBUTED BY HASH(`k0`) BUCKETS 1
properties(
    "replication_num" = "1",
    "partition.retention_count" = "3"
);
```
which means only keep the latest 3 partition in history partitions.

ccr will be tested in selectdb/ccr-syncer#646

### Release note

Resolve the problem of different name format when need to recycle auto partition
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 25, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 25, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 25, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 25, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 25, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 26, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud tests were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 26, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud regression test test_nereids_showpartitionid passed against the persistent Cloud runtime; Docker suites were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 26, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary:

A table can change its inverted-index storage format, but existing partitions must retain the format used when their tablets were created. Previously, there was no partition-scoped persistent format to distinguish historical tablets from tablets created after a format rollout.

This change adds `partition.inverted_index_storage_format` for future logical partitions. The resolved V2 or V3 format is persisted in partition metadata and is passed to tablet and replica creation. Existing partitions are not rewritten, allowing V2 and V3 partitions to coexist while a table rolls forward. The implementation preserves this value through partition creation, auto and dynamic partitioning, edit-log replay, restore, recycle-bin recovery, truncate, insert overwrite, and replica repair.

Observability:

- `SHOW PARTITIONS`, `SHOW PARTITION <partition_id>`, and `partitions(...)` expose `InvertedIndexStorageFormat`.
- `SHOW CREATE TABLE` includes `partition.inverted_index_storage_format` when configured.
- `SHOW TABLETS FROM <table> PARTITION(<partition>)` returns each tablet MetaUrl. Requesting `GET <MetaUrl>` returns `schema.inverted_index_storage_format`, which verifies the actual BE tablet metadata.

Example SQL:

```sql
CREATE TABLE db.t (
    k DATE NOT NULL,
    v VARCHAR(100),
    INDEX idx_v (v) USING INVERTED PROPERTIES("parser" = "english")
)
ENGINE=OLAP
DUPLICATE KEY(k)
PARTITION BY RANGE(k) (
    PARTITION p_old VALUES LESS THAN ("2024-01-01")
)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "inverted_index_storage_format" = "V2"
);

ALTER TABLE db.t
SET ("partition.inverted_index_storage_format" = "V3");

ALTER TABLE db.t
ADD PARTITION p_new VALUES [("2024-01-01"), ("2025-01-01"));

SHOW PARTITIONS FROM db.t;
SHOW TABLETS FROM db.t PARTITION(p_new);
```

Expected observability result: `p_old` reports V2 and its tablet meta header contains `schema.inverted_index_storage_format: "V2"`; `p_new` reports V3 and its tablet meta header contains `schema.inverted_index_storage_format: "V3"`.

Users can roll out V3 inverted-index storage format to newly created partitions without changing historical partitions.

- Test
    - [x] Regression test
    - [x] 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

Test summary:

- `./run-fe-ut.sh --run org.apache.doris.catalog.TablePropertyTest,org.apache.doris.common.PropertyAnalyzerTest` passed.
- `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including FE Checkstyle and packaging.
- `./run-regression-test.sh --run -d inverted_index_p0 -s test_partition_inverted_index_storage_format_rollout` passed. It covers initial, manual, auto, and dynamic partitions, `SHOW PARTITION`, and actual BE tablet meta headers.
- `./run-regression-test.sh --run -d inverted_index_p2 -s test_partition_inverted_index_storage_format_replica_recovery` passed. It verifies that recovery recreates a removed V2 replica as V2 while a V3 partition remains V3.
- Cloud regression test test_nereids_showpartitionid passed against the persistent Cloud runtime; Docker suites were not run.

- Behavior changed:
    - [ ] No.
    - [x] Yes. Future partitions can use a different inverted-index storage format from historical partitions.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 30, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#57013

Problem Summary: Cloud tables need to roll out inverted-index V2 and V3 formats partition by partition while keeping existing partitions unchanged. Persist an optional partition-level format through partition creation, replay, replacement, recycle, recovery, restore, and schema changes; a missing entry resolves to the legacy table-level format. Restore and truncate retain their source partition format. Updating the partition format default no longer synchronously fetches one tablet from every partition while holding the table write lock, eliminating the O(partition_count) Meta Service RPC scan and its retry failure mode.

### Release note

Cloud tables support partition-level V2/V3 inverted-index format rollout while retaining the format of existing partitions.

### Check List (For Author)

- Test: Regression test / Unit Test
    - Unit Test: 13 HEAD/HEAD~1 related FE test classes, 106 passed
    - Unit Test: CloudSchemaChangeHandlerTest, OlapTableTest, CloudSchemaChangeJobV2Test, ModifyDynamicPartitionInfoTest, 22 passed
    - Regression test: external_table_p0/tvf/test_partitions_tvf passed
    - Regression test: Cloud suites test_cloud_show_inverted_index_storage_format, test_partition_cloud_inverted_index_storage_format_rollout, and test_partition_cloud_inverted_index_storage_format_recycle_truncate passed
- Behavior changed: Yes. Cloud partitions retain their creation-time inverted-index format while new partitions use the current configured default, and property updates no longer scan every partition's tablet metadata.
- Does this need documentation: No
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 31, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary: Cloud tables need to roll out inverted-index V2 and V3 formats partition by partition while keeping existing partitions unchanged. Persist an optional partition-level format through partition creation, replay, replacement, recycle, recovery, restore, and schema changes; a missing entry resolves to the legacy table-level format. Restore and truncate retain their source partition format. Updating the partition format default no longer synchronously fetches one tablet from every partition while holding the table write lock, eliminating the O(partition_count) Meta Service RPC scan and its retry failure mode.

Cloud tables support partition-level V2/V3 inverted-index format rollout while retaining the format of existing partitions.

- Test: Regression test / Unit Test
    - Unit Test: 13 HEAD/HEAD~1 related FE test classes, 106 passed
    - Unit Test: CloudSchemaChangeHandlerTest, OlapTableTest, CloudSchemaChangeJobV2Test, ModifyDynamicPartitionInfoTest, 22 passed
    - Regression test: external_table_p0/tvf/test_partitions_tvf passed
    - Regression test: Cloud suites test_cloud_show_inverted_index_storage_format, test_partition_cloud_inverted_index_storage_format_rollout, and test_partition_cloud_inverted_index_storage_format_recycle_truncate passed
- Behavior changed: Yes. Cloud partitions retain their creation-time inverted-index format while new partitions use the current configured default, and property updates no longer scan every partition's tablet metadata.
- Does this need documentation: No
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 31, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary: Cloud tables need to roll out inverted-index V2 and V3 formats partition by partition while keeping existing partitions unchanged. Persist an optional partition-level format through partition creation, replay, replacement, recycle, recovery, restore, and schema changes; a missing entry resolves to the legacy table-level format. Restore and truncate retain their source partition format. Updating the partition format default no longer synchronously fetches one tablet from every partition while holding the table write lock, eliminating the O(partition_count) Meta Service RPC scan and its retry failure mode.

Cloud tables support partition-level V2/V3 inverted-index format rollout while retaining the format of existing partitions.

- Test: Regression test / Unit Test
    - Unit Test: 13 HEAD/HEAD~1 related FE test classes, 106 passed
    - Unit Test: CloudSchemaChangeHandlerTest, OlapTableTest, CloudSchemaChangeJobV2Test, ModifyDynamicPartitionInfoTest, 22 passed
    - Regression test: external_table_p0/tvf/test_partitions_tvf passed
    - Regression test: Cloud suites test_cloud_show_inverted_index_storage_format, test_partition_cloud_inverted_index_storage_format_rollout, and test_partition_cloud_inverted_index_storage_format_recycle_truncate passed
- Behavior changed: Yes. Cloud partitions retain their creation-time inverted-index format while new partitions use the current configured default, and property updates no longer scan every partition's tablet metadata.
- Does this need documentation: No
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 31, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary: Cloud tables need to roll out inverted-index V2 and V3 formats partition by partition while keeping existing partitions unchanged. Persist an optional partition-level format through partition creation, replay, replacement, recycle, recovery, restore, and schema changes; a missing entry resolves to the legacy table-level format. Restore and truncate retain their source partition format. Updating the partition format default no longer synchronously fetches one tablet from every partition while holding the table write lock, eliminating the O(partition_count) Meta Service RPC scan and its retry failure mode.

Cloud tables support partition-level V2/V3 inverted-index format rollout while retaining the format of existing partitions.

- Test: Regression test / Unit Test
    - Unit Test: 13 HEAD/HEAD~1 related FE test classes, 106 passed
    - Unit Test: CloudSchemaChangeHandlerTest, OlapTableTest, CloudSchemaChangeJobV2Test, ModifyDynamicPartitionInfoTest, 22 passed
    - Regression test: external_table_p0/tvf/test_partitions_tvf passed
    - Regression test: Cloud suites test_cloud_show_inverted_index_storage_format, test_partition_cloud_inverted_index_storage_format_rollout, and test_partition_cloud_inverted_index_storage_format_recycle_truncate passed
- Behavior changed: Yes. Cloud partitions retain their creation-time inverted-index format while new partitions use the current configured default, and property updates no longer scan every partition's tablet metadata.
- Does this need documentation: No
hoshinojyunn added a commit to hoshinojyunn/doris that referenced this pull request Jul 31, 2026
Issue Number: None

Related PR: apache#57013

Problem Summary: Cloud tables need to roll out inverted-index V2 and V3 formats partition by partition while keeping existing partitions unchanged. Persist an optional partition-level format through partition creation, replay, replacement, recycle, recovery, restore, and schema changes; a missing entry resolves to the legacy table-level format. Restore and truncate retain their source partition format. Updating the partition format default no longer synchronously fetches one tablet from every partition while holding the table write lock, eliminating the O(partition_count) Meta Service RPC scan and its retry failure mode.

Cloud tables support partition-level V2/V3 inverted-index format rollout while retaining the format of existing partitions.

- Test: Regression test / Unit Test
    - Unit Test: 13 HEAD/HEAD~1 related FE test classes, 106 passed
    - Unit Test: CloudSchemaChangeHandlerTest, OlapTableTest, CloudSchemaChangeJobV2Test, ModifyDynamicPartitionInfoTest, 22 passed
    - Regression test: external_table_p0/tvf/test_partitions_tvf passed
    - Regression test: Cloud suites test_cloud_show_inverted_index_storage_format, test_partition_cloud_inverted_index_storage_format_rollout, and test_partition_cloud_inverted_index_storage_format_recycle_truncate passed
- Behavior changed: Yes. Cloud partitions retain their creation-time inverted-index format while new partitions use the current configured default, and property updates no longer scan every partition's tablet metadata.
- Does this need documentation: No
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. dev/4.0.2-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants