Skip to content

[chore](load) Remove the unused single replica load feature - #66623

Merged
deardeng merged 2 commits into
apache:masterfrom
deardeng:codex/remove-single-replica-load
Aug 11, 2026
Merged

[chore](load) Remove the unused single replica load feature#66623
deardeng merged 2 commits into
apache:masterfrom
deardeng:codex/remove-single-replica-load

Conversation

@deardeng

Copy link
Copy Markdown
Contributor

Single replica load is an experimental, disabled-by-default load path that writes data to one master replica first and then pulls the generated rowset to slave replicas.

This feature maintains a separate end-to-end implementation across FE and BE, including:

  • FE configuration and session variables
  • Nereids and legacy sink planning
  • Master/slave tablet location generation
  • DeltaWriter slave commit callbacks
  • Transaction-to-writer callback tracking
  • Slave rowset pull and commit RPCs
  • A dedicated HTTP download endpoint and worker pool
  • Auto-partition master/slave location caching
  • Feature-specific regression tests and debug logic

The feature is no longer actively used, while its parallel execution path adds considerable maintenance cost and introduces additional transaction, callback, concurrency, and upgrade complexity.

This PR removes the single replica load implementation and makes normal load paths always write to all selected replicas.

The following options are removed:

  • FE config: enable_single_replica_load
  • BE config: enable_single_replica_load
  • Session variable: enable_single_replica_insert
  • Related slave download worker and RPC timeout configurations

The Thrift and protobuf definitions are intentionally kept unchanged to avoid protocol schema and generated-code churn.

For compatibility and data safety:

  • A BE receiving write_single_replica = true returns NotSupported explicitly instead of silently writing only one replica.
  • The retained slave rowset RPC methods return NotSupported.
  • New FE-generated load plans no longer populate write_single_replica, slave_location, or slave tablet locations.
  • Normal multi-replica load and transaction commit paths remain unchanged.

Feature-specific regression cases are removed, while existing normal load tests are updated to use the simplified DeltaWriter::commit_txn() interface.

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

### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: Update DeltaWriter callers to require the simplified transaction commit API that remains after removing the unused single replica load implementation. This is the compile-time RED checkpoint: the focused test translation unit fails because the production API still requires PSlaveTabletNodes.

### Release note

None

### Check List (For Author)

- Test: Unit Test

    - Compile-time RED: delta_writer_test.cpp fails with the expected missing no-argument commit_txn overload

- Behavior changed: No

- Does this need documentation: No
@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?

@deardeng
deardeng force-pushed the codex/remove-single-replica-load branch from 556bdcb to 6d1affd Compare August 10, 2026 12:04
@deardeng

Copy link
Copy Markdown
Contributor Author

run buildall

Issue Number: N/A

Related PR: N/A

Problem Summary: The unused single replica load path duplicated FE planning, tablet location, BE write, transaction callback, rowset pull, and HTTP download logic. Remove the runtime configuration and session switches together with the master/slave execution paths and dedicated tests. Keep the Thrift and protobuf contracts unchanged; retained RPC methods and old write_single_replica requests now fail explicitly with NotSupported. Ordinary loads always send data to all selected replica locations.

Remove the experimental single replica load and single replica insert options.

- Test:
    - Unit Test: ./run-fe-ut.sh --run org.apache.doris.planner.OlapTableSinkTest,org.apache.doris.planner.GroupCommitBlockSinkTest,org.apache.doris.transaction.AutoPartitionCacheManagerTest (7 tests passed)
    - Manual test: compiled the changed BE translation units and affected DeltaWriter/VRowDistribution test translation units with be/ut_build_ASAN/compile_commands.json
    - BE unit-test linking was attempted but blocked by the missing thirdparty/installed/lib64/libarrow_compute.a in this worktree
- Behavior changed: Yes. Single replica load settings are removed and retained protocol requests are rejected explicitly.
- Does this need documentation: No. The removed switches belonged to an unused experimental feature.

[fix](fe) Fix Nereids checkstyle violations

Issue Number: None

Related PR: None

Problem Summary: FE Checkstyle validation failed because RemoteOlapInsertExecutor had an extra blank line before its class Javadoc and NereidsLoadPlanInfoCollector retained an unused Config import. Remove both violations so FE style validation succeeds.

None

- Test: No need to test (style-only import and whitespace cleanup)
- Check: `mvn checkstyle:check -pl fe-core`
- Behavior changed: No
- Does this need documentation: No
@deardeng
deardeng force-pushed the codex/remove-single-replica-load branch from 6d1affd to 0eaefa1 Compare August 10, 2026 12:14
@deardeng

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17611	4156	4019	4019
q2	2033	329	206	206
q3	10286	1443	818	818
q4	4680	468	341	341
q5	7513	840	544	544
q6	189	177	142	142
q7	753	807	595	595
q8	9329	1676	1662	1662
q9	5758	4074	4077	4074
q10	6730	1643	1358	1358
q11	529	364	324	324
q12	733	576	470	470
q13	18207	3343	2786	2786
q14	261	264	248	248
q15	q16	738	735	666	666
q17	985	905	1099	905
q18	6675	5665	5599	5599
q19	1181	1270	1034	1034
q20	823	708	592	592
q21	5890	2839	2703	2703
q22	463	386	324	324
Total cold run time: 101367 ms
Total hot run time: 29410 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4970	4601	4660	4601
q2	286	347	218	218
q3	4951	5319	4659	4659
q4	2218	2278	1430	1430
q5	4916	4418	4597	4418
q6	231	178	130	130
q7	1825	1692	1513	1513
q8	2438	2084	2031	2031
q9	7072	6729	6744	6729
q10	4246	4238	3804	3804
q11	516	374	343	343
q12	703	725	506	506
q13	3077	3343	2736	2736
q14	270	290	256	256
q15	q16	669	689	617	617
q17	1264	1243	1232	1232
q18	12078	11020	11717	11020
q19	1150	1073	1089	1073
q20	2193	2175	1906	1906
q21	5328	4594	4643	4594
q22	529	454	409	409
Total cold run time: 60930 ms
Total hot run time: 54225 ms

@hello-stephen

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

query5	4314	582	457	457
query6	455	249	216	216
query7	4939	560	343	343
query8	322	159	150	150
query9	8778	4054	4032	4032
query10	469	356	326	326
query11	5865	2197	2007	2007
query12	174	100	99	99
query13	1259	611	472	472
query14	6065	4303	4038	4038
query14_1	3794	3830	3804	3804
query15	210	190	181	181
query16	983	471	445	445
query17	921	703	584	584
query18	2435	465	350	350
query19	212	190	154	154
query20	104	101	103	101
query21	236	157	138	138
query22	13089	13074	12902	12902
query23	15891	14992	14516	14516
query23_1	14793	14776	14619	14619
query24	7463	1716	1237	1237
query24_1	1239	1235	1238	1235
query25	573	444	390	390
query26	1323	334	215	215
query27	2631	633	407	407
query28	4607	2033	2040	2033
query29	1072	611	511	511
query30	340	269	237	237
query31	1174	1132	1048	1048
query32	107	64	63	63
query33	520	320	252	252
query34	1209	1133	635	635
query35	744	765	651	651
query36	772	766	735	735
query37	160	110	93	93
query38	1826	1761	1672	1672
query39	836	835	799	799
query39_1	788	790	777	777
query40	266	165	149	149
query41	70	70	70	70
query42	96	96	94	94
query43	319	324	283	283
query44	1451	778	807	778
query45	182	177	165	165
query46	1092	1144	744	744
query47	1496	1519	1473	1473
query48	381	459	293	293
query49	568	408	299	299
query50	1123	465	340	340
query51	10812	10618	10483	10483
query52	93	93	74	74
query53	262	275	202	202
query54	282	238	226	226
query55	80	70	70	70
query56	296	312	290	290
query57	1012	1017	917	917
query58	283	273	272	272
query59	1552	1650	1408	1408
query60	304	276	256	256
query61	156	153	149	149
query62	396	325	260	260
query63	242	205	199	199
query64	2880	1004	875	875
query65	3898	3804	3827	3804
query66	1906	465	346	346
query67	20064	20112	19849	19849
query68	3513	1556	997	997
query69	417	306	258	258
query70	903	802	772	772
query71	389	337	329	329
query72	3034	2662	2333	2333
query73	882	776	408	408
query74	4646	4507	4306	4306
query75	2401	2342	1990	1990
query76	2397	1131	801	801
query77	328	356	278	278
query78	11204	11165	10587	10587
query79	1318	1100	734	734
query80	1264	548	482	482
query81	517	328	286	286
query82	640	170	137	137
query83	383	324	301	301
query84	349	160	132	132
query85	1005	602	527	527
query86	403	235	219	219
query87	1945	1974	1845	1845
query88	3688	2791	2751	2751
query89	399	327	274	274
query90	1976	195	196	195
query91	210	188	163	163
query92	63	57	64	57
query93	1659	1551	999	999
query94	696	362	322	322
query95	811	492	563	492
query96	1014	806	361	361
query97	2494	2462	2363	2363
query98	196	191	186	186
query99	724	729	608	608
Total cold run time: 246294 ms
Total hot run time: 158499 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.09	0.05	0.05
query3	0.25	0.13	0.14
query4	1.61	0.14	0.13
query5	0.24	0.22	0.23
query6	1.15	0.84	0.82
query7	0.04	0.01	0.01
query8	0.06	0.04	0.03
query9	0.38	0.32	0.30
query10	0.54	0.58	0.54
query11	0.19	0.14	0.13
query12	0.18	0.15	0.14
query13	0.46	0.46	0.47
query14	1.00	1.00	1.01
query15	0.61	0.58	0.58
query16	0.32	0.33	0.32
query17	1.09	1.12	1.08
query18	0.20	0.19	0.20
query19	2.08	1.95	2.01
query20	0.01	0.01	0.01
query21	15.46	0.23	0.13
query22	4.78	0.05	0.06
query23	16.15	0.31	0.12
query24	2.90	0.43	0.32
query25	0.12	0.04	0.04
query26	0.74	0.20	0.15
query27	0.05	0.03	0.04
query28	3.52	0.73	0.34
query29	12.51	4.00	3.19
query30	0.28	0.17	0.15
query31	2.77	0.56	0.32
query32	3.22	0.59	0.49
query33	3.13	3.29	3.24
query34	15.83	3.92	3.31
query35	3.26	3.23	3.22
query36	0.55	0.42	0.41
query37	0.08	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.29 s
Total hot run time: 23.97 s

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 76.74% (33/43) 🎉
Increment coverage report
Complete coverage report

@deardeng

Copy link
Copy Markdown
Contributor Author

run feut

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 47.62% (20/42) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

skip check_coverage

@deardeng

Copy link
Copy Markdown
Contributor Author

/review

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

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

I found three blocking compatibility regressions in the single-replica-load removal: an old master can wait until roughly 90% of the load timeout when an upgraded slave returns an application error without the legacy completion callback; an upgraded selected master can silently commit only its local replica while ignoring an old sender's slave metadata; and the removed session variable is not registered in Doris's removed-variable compatibility set.

Checkpoint conclusions:

  • Goal, scope, and proof: the all-new FE/BE path is consistently simplified to normal full-replica writes, but the change does not safely accomplish removal across retained rolling-upgrade and client-compatibility boundaries. Current tests do not prove those boundaries.
  • Size and focus: the cleanup is mechanically focused and removes the feature-owned state together, but the retained protocol stubs and public variable surface need the compatibility fixes called out inline.
  • Concurrency and lifecycle: the feature-owned callback maps, locks, waits, timers, worker, transaction-writer registry, and endpoint are otherwise removed consistently; ordinary writer and download lifecycles remain intact. The legacy callback lifecycle in the old-master/new-slave placement is the first inline defect. No new lock-order, static-initialization, or ownership issue was found.
  • Configuration: no configuration is added. Stale FE/BE config-file keys are warned and ignored, and removed persisted/forwarded session fields are skipped, but explicit legacy SET/SET GLOBAL/SELECT @@ access is broken as described inline.
  • Compatibility and FE/BE passing: retained Thrift/protobuf field IDs and default-false behavior let new senders use old receivers normally. Two old-request/new-BE placements are unsafe: the callback path and receiver-side add-block path described inline. No new cross-layer variable was added.
  • Parallel paths and conditions: local/remote INSERT, Nereids load collection, group commit, initial locations, automatic create, overwrite replace, retry cache, adaptive bucket, and load-to-single-tablet paths all propagate the full selected replica set where consumed. The new sink-executor rejection guard is valid but cannot protect an upgraded receiving tablet master.
  • Error handling: the retained slave-pull RPC's application status is ignored by the old caller, while the upgraded selected master returns a misleading OK after discarding slave metadata. Other changed status/error paths are checked consistently.
  • Tests and results: the modified unit tests are consistent with the new ordinary API shape and cache behavior, and current CI checks are green. There is no mixed-version coverage for either failing placement and no removed-variable compatibility test; the deleted feature-specific suites do not cover those gaps.
  • Transactions, persistence, and data correctness: FE quorum enforcement prevents the under-replicated local write from becoming a successful visible transaction, but affected loads fail late or after avoidable work. No EditLog, replay, failover, MoW, visible-version, or ordinary atomicity defect was found.
  • Observability: existing identifiers are adequate for ordinary paths, but returning OK after ignoring legacy slave metadata hides the actual incompatibility; prompt non-OK rejection would make it diagnosable. No additional metric is otherwise needed.
  • Performance: the all-new path removes replica-pull overhead, but the old-master/new-slave placement can stall for about 90% of the configured load timeout. No other CPU, memory, or complexity regression was found.
  • Memory and nullable handling: no new allocation ownership, reservation, COW, nullable-column, or const-nullable behavior is introduced by this removal.
  • Other issues: no additional valuable finding survived the complete second pass. No additional user-provided review focus was specified.

Review completion: converged after 2 rounds; all candidates were independently verified and deduplicated; 3 inline comments are included.

Comment thread be/src/service/internal_service.cpp
Comment thread fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
Comment thread be/src/load/channel/tablets_channel.cpp
@deardeng
deardeng dismissed github-actions[bot]’s stale review August 11, 2026 08:08

ignore,
These issues are only reachable if single replica load was enabled on an old version or clients still access its experimental session variable. This experimental feature has never been used in production and is being removed intentionally, so these compatibility scenarios
are out of scope and should not block this PR.

@deardeng
deardeng merged commit 62707fd into apache:master Aug 11, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants