Skip to content

[fix](backup) Fix UnsupportedOperationException in RestoreCommand by copying properties before modification#61890

Merged
w41ter merged 1 commit intoapache:masterfrom
w41ter:fix_restore_command_unsupported_operations
Apr 3, 2026
Merged

[fix](backup) Fix UnsupportedOperationException in RestoreCommand by copying properties before modification#61890
w41ter merged 1 commit intoapache:masterfrom
w41ter:fix_restore_command_unsupported_operations

Conversation

@w41ter
Copy link
Copy Markdown
Contributor

@w41ter w41ter commented Mar 30, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #50638

Problem Summary:

The properties map could be an ImmutableMap, so calling remove() on it causes UnsupportedOperationException.

Release note

None

Check List (For Author)

  • Test

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

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

@w41ter
Copy link
Copy Markdown
Contributor Author

w41ter commented Mar 30, 2026

run buildall

@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Mar 30, 2026

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

Please clearly describe your PR:

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

Copy link
Copy Markdown
Contributor

@morrySnow morrySnow left a comment

Choose a reason for hiding this comment

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

add a ut

@w41ter w41ter force-pushed the fix_restore_command_unsupported_operations branch from 765c204 to ec94d96 Compare March 30, 2026 09:18
@w41ter
Copy link
Copy Markdown
Contributor Author

w41ter commented Mar 30, 2026

run buildall

@w41ter w41ter force-pushed the fix_restore_command_unsupported_operations branch from ec94d96 to af2011a Compare March 30, 2026 09:24
@w41ter
Copy link
Copy Markdown
Contributor Author

w41ter commented Mar 30, 2026

run buildall

1 similar comment
@w41ter
Copy link
Copy Markdown
Contributor Author

w41ter commented Mar 31, 2026

run buildall

@doris-robot
Copy link
Copy Markdown

TPC-H: Total hot run time: 26502 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit c73690e73350a6a6323f1f4dd3054b6a5c376f76, 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	17609	4465	4300	4300
q2	q3	10713	817	537	537
q4	4732	362	252	252
q5	8094	1210	1025	1025
q6	235	173	150	150
q7	812	853	672	672
q8	10866	1504	1340	1340
q9	6766	4760	4638	4638
q10	6302	1928	1675	1675
q11	490	247	262	247
q12	746	593	459	459
q13	18031	2679	1947	1947
q14	230	230	214	214
q15	q16	722	738	661	661
q17	751	855	430	430
q18	5953	5399	5270	5270
q19	1126	1001	623	623
q20	541	488	377	377
q21	4502	1825	1439	1439
q22	353	289	246	246
Total cold run time: 99574 ms
Total hot run time: 26502 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	4412	4343	4382	4343
q2	q3	3837	4268	3789	3789
q4	873	1167	774	774
q5	4023	4341	4313	4313
q6	182	173	137	137
q7	1755	1582	1454	1454
q8	2444	2667	2538	2538
q9	7300	7196	7014	7014
q10	3694	3933	3491	3491
q11	496	418	405	405
q12	477	586	436	436
q13	2342	2751	1977	1977
q14	267	283	259	259
q15	q16	688	757	705	705
q17	1122	1298	1313	1298
q18	7162	6763	6684	6684
q19	886	897	893	893
q20	2010	2103	1924	1924
q21	3895	3447	3264	3264
q22	427	414	383	383
Total cold run time: 48292 ms
Total hot run time: 46081 ms

@doris-robot
Copy link
Copy Markdown

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

query5	4325	640	511	511
query6	328	220	206	206
query7	4216	449	254	254
query8	329	245	263	245
query9	8752	2717	2710	2710
query10	506	385	353	353
query11	6941	5102	4846	4846
query12	178	131	136	131
query13	1280	464	396	396
query14	5738	3751	3447	3447
query14_1	2882	2851	2806	2806
query15	205	199	177	177
query16	1033	511	486	486
query17	1136	754	634	634
query18	2495	473	357	357
query19	218	217	184	184
query20	139	121	122	121
query21	215	139	112	112
query22	13217	13387	13018	13018
query23	16225	15841	15689	15689
query23_1	15717	15707	15693	15693
query24	7235	1665	1235	1235
query24_1	1253	1246	1220	1220
query25	570	500	461	461
query26	1255	267	159	159
query27	2785	486	298	298
query28	4513	1846	1856	1846
query29	866	656	484	484
query30	305	237	192	192
query31	1052	954	863	863
query32	85	74	75	74
query33	515	332	285	285
query34	879	880	532	532
query35	649	685	613	613
query36	1090	1158	1036	1036
query37	143	94	88	88
query38	2981	2919	2891	2891
query39	877	840	807	807
query39_1	794	797	789	789
query40	230	156	143	143
query41	66	63	67	63
query42	270	261	268	261
query43	247	266	224	224
query44	
query45	197	191	180	180
query46	867	989	618	618
query47	2102	2164	2093	2093
query48	308	313	231	231
query49	632	465	373	373
query50	696	280	210	210
query51	4057	4046	4038	4038
query52	265	267	264	264
query53	293	339	284	284
query54	301	275	264	264
query55	99	95	83	83
query56	346	323	315	315
query57	1916	1891	1666	1666
query58	279	277	268	268
query59	2800	2963	2753	2753
query60	347	348	326	326
query61	165	163	157	157
query62	626	609	528	528
query63	315	277	275	275
query64	5039	1281	1024	1024
query65	
query66	1460	472	404	404
query67	24252	24383	24200	24200
query68	
query69	414	323	289	289
query70	948	985	951	951
query71	336	298	291	291
query72	2828	2753	2466	2466
query73	551	539	324	324
query74	9687	9584	9401	9401
query75	2885	2751	2479	2479
query76	2307	1053	657	657
query77	380	371	298	298
query78	11019	11063	10433	10433
query79	1116	766	572	572
query80	1338	643	552	552
query81	550	266	225	225
query82	1020	152	120	120
query83	377	284	245	245
query84	250	118	108	108
query85	913	510	474	474
query86	425	312	291	291
query87	3131	3062	2964	2964
query88	3547	2665	2663	2663
query89	432	370	339	339
query90	2005	191	185	185
query91	178	168	142	142
query92	84	78	72	72
query93	921	848	504	504
query94	650	322	300	300
query95	604	407	334	334
query96	653	521	230	230
query97	2448	2544	2420	2420
query98	248	222	220	220
query99	996	994	918	918
Total cold run time: 248624 ms
Total hot run time: 167789 ms

…copying properties before modification

The properties map could be an ImmutableMap, so calling remove() on it causes UnsupportedOperationException.
@w41ter w41ter force-pushed the fix_restore_command_unsupported_operations branch from c73690e to 4926388 Compare April 1, 2026 07:15
@w41ter
Copy link
Copy Markdown
Contributor Author

w41ter commented Apr 1, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 80.00% (4/5) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link
Copy Markdown

TPC-H: Total hot run time: 29324 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 49263884b8766026e7e621d674eb55fa64a668eb, 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	3938	3734	3734
q2	q3	10674	895	636	636
q4	4679	465	355	355
q5	7459	1360	1147	1147
q6	183	171	139	139
q7	927	959	770	770
q8	9325	1432	1399	1399
q9	5619	5429	5290	5290
q10	6267	2055	1795	1795
q11	476	286	282	282
q12	857	716	534	534
q13	18044	2800	2147	2147
q14	287	279	264	264
q15	q16	903	841	780	780
q17	1041	1158	778	778
q18	6541	5701	5421	5421
q19	1326	1266	1077	1077
q20	638	547	409	409
q21	4856	2444	2037	2037
q22	488	391	330	330
Total cold run time: 98181 ms
Total hot run time: 29324 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	4717	4533	4485	4485
q2	q3	4661	4801	4113	4113
q4	1998	2110	1323	1323
q5	4914	4943	5242	4943
q6	202	166	130	130
q7	2047	1766	1609	1609
q8	3306	3178	3141	3141
q9	8214	8248	8240	8240
q10	4459	4441	4227	4227
q11	618	446	393	393
q12	678	751	495	495
q13	2758	3069	2338	2338
q14	296	295	269	269
q15	q16	760	760	670	670
q17	1264	1274	1235	1235
q18	7834	7181	7017	7017
q19	1120	1111	1169	1111
q20	2197	2216	1921	1921
q21	5956	5394	4996	4996
q22	552	516	440	440
Total cold run time: 58551 ms
Total hot run time: 53096 ms

@doris-robot
Copy link
Copy Markdown

TPC-DS: Total hot run time: 179842 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 49263884b8766026e7e621d674eb55fa64a668eb, data reload: false

query5	4380	660	542	542
query6	352	231	208	208
query7	4311	608	328	328
query8	339	242	224	224
query9	8723	3908	3836	3836
query10	543	405	341	341
query11	6649	5509	5132	5132
query12	187	132	141	132
query13	1311	615	457	457
query14	5694	5177	4755	4755
query14_1	4163	4123	4125	4123
query15	217	208	181	181
query16	997	449	425	425
query17	963	776	646	646
query18	2450	484	384	384
query19	250	233	198	198
query20	151	134	135	134
query21	223	145	119	119
query22	13845	14677	14579	14579
query23	18048	17195	16924	16924
query23_1	16882	16827	16646	16646
query24	7423	1789	1343	1343
query24_1	1319	1347	1368	1347
query25	575	525	442	442
query26	1262	331	173	173
query27	2717	608	368	368
query28	4444	1857	1844	1844
query29	1009	660	553	553
query30	302	231	197	197
query31	1101	1060	947	947
query32	87	74	71	71
query33	557	354	297	297
query34	1184	1165	675	675
query35	750	795	670	670
query36	1285	1253	1073	1073
query37	147	100	85	85
query38	3068	3030	2980	2980
query39	922	892	853	853
query39_1	835	843	822	822
query40	236	157	139	139
query41	65	60	61	60
query42	275	272	270	270
query43	311	317	273	273
query44	
query45	203	196	187	187
query46	1125	1316	815	815
query47	2315	2342	2219	2219
query48	416	409	298	298
query49	642	530	436	436
query50	698	287	222	222
query51	4361	4304	4181	4181
query52	280	285	272	272
query53	321	344	278	278
query54	331	289	267	267
query55	99	97	92	92
query56	326	328	319	319
query57	1762	1667	1513	1513
query58	306	278	273	273
query59	2855	2973	2748	2748
query60	334	337	327	327
query61	153	149	158	149
query62	689	624	556	556
query63	313	273	265	265
query64	5368	1437	1074	1074
query65	
query66	1483	466	367	367
query67	24340	24234	24151	24151
query68	
query69	459	329	304	304
query70	1005	999	1016	999
query71	365	339	310	310
query72	3081	2797	2489	2489
query73	766	736	432	432
query74	9864	9673	9505	9505
query75	3551	3361	2997	2997
query76	2324	1154	774	774
query77	394	395	335	335
query78	11349	11383	10744	10744
query79	1514	1071	823	823
query80	837	754	667	667
query81	461	280	238	238
query82	1384	156	117	117
query83	414	298	270	270
query84	303	145	116	116
query85	865	512	505	505
query86	390	318	334	318
query87	3266	3206	3090	3090
query88	3549	2686	2685	2685
query89	476	424	380	380
query90	1982	172	179	172
query91	178	174	139	139
query92	83	74	71	71
query93	901	896	507	507
query94	518	353	306	306
query95	689	380	335	335
query96	1079	756	336	336
query97	2651	2683	2553	2553
query98	241	226	232	226
query99	1073	1051	968	968
Total cold run time: 258443 ms
Total hot run time: 179842 ms

@gavinchou
Copy link
Copy Markdown
Contributor

/review

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

github-actions bot commented Apr 2, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

PR approved by anyone and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

No issues found in this PR.

Critical checkpoint conclusions:

  • Goal and correctness: The change fixes the reported in for immutable property maps, and the added unit test covers the failing path.
  • Change scope: The modification is minimal and focused to the offending mutation site.
  • Concurrency: No new concurrency or locking behavior is introduced.
  • Lifecycle/static init: No lifecycle or static initialization concerns are involved.
  • Configuration: No new configuration items are added.
  • Compatibility: No FE/BE protocol, symbol, or storage-format compatibility changes are involved.
  • Parallel paths: The reachable SQL/Nereids restore path now handles immutable maps correctly; no other equivalent changed path was missed in this fix.
  • Conditional checks: The existing property validation logic remains consistent and understandable.
  • Test coverage: The new FE unit test exercises the immutable-map case directly; no regression gap specific to this fix was found.
  • Observability: No additional observability is needed for this small validation-path fix.
  • Transaction/persistence: No transaction, EditLog, or persistence logic is changed.
  • Data writes/modifications: No data-write atomicity or crash-consistency behavior is affected.
  • FE/BE variable passing: No new cross-component variables are added.
  • Performance: The added defensive copy is small, local to analysis, and acceptable for this non-hot path.
  • Other issues: None found.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

No issues found in this PR.

Critical checkpoint conclusions:

  • Goal and correctness: The change fixes the reported UnsupportedOperationException in RestoreCommand.analyzeProperties() for immutable property maps, and the added unit test covers the failing path.
  • Change scope: The modification is minimal and focused to the offending mutation site.
  • Concurrency: No new concurrency or locking behavior is introduced.
  • Lifecycle/static init: No lifecycle or static initialization concerns are involved.
  • Configuration: No new configuration items are added.
  • Compatibility: No FE/BE protocol, symbol, or storage-format compatibility changes are involved.
  • Parallel paths: The reachable SQL/Nereids restore path now handles immutable maps correctly; no other equivalent changed path was missed in this fix.
  • Conditional checks: The existing property validation logic remains consistent and understandable.
  • Test coverage: The new FE unit test exercises the immutable-map case directly; no regression gap specific to this fix was found.
  • Observability: No additional observability is needed for this small validation-path fix.
  • Transaction/persistence: No transaction, EditLog, or persistence logic is changed.
  • Data writes/modifications: No data-write atomicity or crash-consistency behavior is affected.
  • FE/BE variable passing: No new cross-component variables are added.
  • Performance: The added defensive copy is small, local to analysis, and acceptable for this non-hot path.
  • Other issues: None found.

@w41ter w41ter closed this Apr 3, 2026
@w41ter w41ter reopened this Apr 3, 2026
@w41ter w41ter merged commit e61837c into apache:master Apr 3, 2026
44 of 46 checks passed
@w41ter w41ter deleted the fix_restore_command_unsupported_operations branch April 3, 2026 02:18
github-actions bot pushed a commit that referenced this pull request Apr 3, 2026
…copying properties before modification (#61890)

The properties map could be an ImmutableMap, so calling remove() on it
causes UnsupportedOperationException.
github-actions bot pushed a commit that referenced this pull request Apr 3, 2026
…copying properties before modification (#61890)

The properties map could be an ImmutableMap, so calling remove() on it
causes UnsupportedOperationException.
yiguolei pushed a commit that referenced this pull request Apr 3, 2026
…eCommand by copying properties before modification #61890 (#62072)

Cherry-picked from #61890

Co-authored-by: walter <maochuan@selectdb.com>
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.x dev/4.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants