Skip to content

[improvement](external) Support Elasticsearch 9.x node discovery - #69651

Merged
Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/es9-query-compatibility
Oct 27, 2026
Merged

Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/es9-query-compatibility

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #69650 (reader regression coverage)

With nodes_discovery=true, ES metadata loading follows EsMetadataFetcher.fetchShards -> EsConnectorRestClient.getHttpNodes -> EsNodeInfo -> EsMajorVersion.parse. The parser accepts only majors through 8, so a 9.x node makes discovery fail with an unsupported-version exception. The configured-seed path with discovery disabled does not parse node versions and is not affected in the same way.

Add the explicit ES 9 major, comparisons and latest-supported bound while continuing to reject unvalidated future majors with a clear diagnostic. Add an HTTP unit test containing mixed 8.19/9.0 nodes, IPv6 routing and a node without HTTP, plus an opt-in live compatibility suite rather than relying on version parsing alone.

The live suite creates isolated temporary indices and checks the production connector's _nodes/http, _mapping, _search_shards, index listing and metadata fetching with discovery enabled/disabled. It also verifies authenticated source/docvalue scroll requests, missing values, pagination, scroll cleanup and invalid-credential failures. Enable it with DORIS_ES9_TEST_URL, DORIS_ES9_TEST_USER and DORIS_ES9_TEST_PASSWORD.

Release note

Allow Elasticsearch 9.x nodes during ES catalog node discovery.

Check List (For Author)

  • Test
    • Version parsing and mixed-node tests reproduce the unsupported-9.x failure before the change.
    • All 124 ES connector tests pass with live authenticated Elasticsearch 9.0.0 and 9.5.5, including the three opt-in compatibility tests on each version.
    • Default unit-test execution passes with the live suite disabled when no endpoint is configured.
    • FE Checkstyle for the ES module and its reactor dependencies.
    • The BE ES reader also reads the authenticated three-row fixture through source/docvalue scans with batch size 1 on both versions, using the reader coverage change in the related ES regression PR.
    • Full Doris SQL end-to-end validation against ES 9; the live tests above validate connector metadata and HTTP reader compatibility.
  • Behavior changed:
    • Yes: discovery accepts ES 9 nodes; later unverified majors remain rejected.
  • Does this need documentation?
    • No new catalog properties or configuration are introduced.

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?

Related PR: apache#69650 (reader regression coverage)

With `nodes_discovery=true`, ES metadata loading follows `EsMetadataFetcher.fetchShards -> EsConnectorRestClient.getHttpNodes -> EsNodeInfo -> EsMajorVersion.parse`. The parser accepts only majors through 8, so a 9.x node makes discovery fail with an unsupported-version exception. The configured-seed path with discovery disabled does not parse node versions and is not affected in the same way.

Add the explicit ES 9 major, comparisons and latest-supported bound while continuing to reject unvalidated future majors with a clear diagnostic. Add an HTTP unit test containing mixed 8.19/9.0 nodes, IPv6 routing and a node without HTTP, plus an opt-in live compatibility suite rather than relying on version parsing alone.

The live suite creates isolated temporary indices and checks the production connector's `_nodes/http`, `_mapping`, `_search_shards`, index listing and metadata fetching with discovery enabled/disabled. It also verifies authenticated source/docvalue scroll requests, missing values, pagination, scroll cleanup and invalid-credential failures. Enable it with `DORIS_ES9_TEST_URL`, `DORIS_ES9_TEST_USER` and `DORIS_ES9_TEST_PASSWORD`.

### Release note

Allow Elasticsearch 9.x nodes during ES catalog node discovery.

### Check List (For Author)

- Test
    - [x] Version parsing and mixed-node tests reproduce the unsupported-9.x failure before the change.
    - [x] All 124 ES connector tests pass with live authenticated Elasticsearch 9.0.0 and 9.5.5, including the three opt-in compatibility tests on each version.
    - [x] Default unit-test execution passes with the live suite disabled when no endpoint is configured.
    - [x] FE Checkstyle for the ES module and its reactor dependencies.
    - [x] The BE ES reader also reads the authenticated three-row fixture through source/docvalue scans with batch size 1 on both versions, using the reader coverage change in the related ES regression PR.
    - [ ] Full Doris SQL end-to-end validation against ES 9; the live tests above validate connector metadata and HTTP reader compatibility.
- Behavior changed:
    - [x] Yes: discovery accepts ES 9 nodes; later unverified majors remain rejected.
- Does this need documentation?
    - [x] No new catalog properties or configuration are introduced.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
@hello-stephen

Copy link
Copy Markdown
Contributor

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

Please clearly describe your PR:

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

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed all four changed files at 6f3cfe264e3fbc0611cd0f9b8be07dfac000a1fc, including the discovery-to-shard-routing-to-reader flow. No verified new findings or existing inline blockers were identified.

Critical checkpoint conclusions:

Checkpoint Conclusion
Goal and supporting tests The new 9.x prefix removes the discovered-node parser rejection. Version, mixed-node HTTP and opt-in production metadata tests target that behavior.
Scope and reuse One production class and three related test files; the implementation follows the existing major-version representation and parser.
Concurrency and locks No production threading, shared mutable state or locking changes.
Lifecycle and initialization V_9_X is initialized before LATEST in the same class. The local server, UUID test indices and scroll contexts have cleanup paths.
Configuration No production settings added; environment variables opt into the live tests.
Compatibility Existing supported prefixes and comparison/equality semantics remain intact; future majors still fail explicitly. No storage-format or binary-interface migration is introduced.
Thrift and protobuf No definitions or field IDs changed; release-branch ID comparison is inapplicable.
Parallel paths Traced discovery and configured-seed routing, single/per-shard planning and the shared BE scroll reader. No additional active version gate needs updating.
Conditional checks The explicit 9.x branch and unsupported-version bound match the intended policy. Class-level JUnit gating protects the optional endpoint initializer.
Test coverage JUnit coverage includes parsing, ordering, equality, future rejection, mixed 8/9 nodes, IPv6 and missing HTTP. Opt-in tests add production metadata, both discovery settings, authentication failures and REST scroll/null/docvalue checks.
Expected results New assertions were inspected; no regression golden-result files changed.
Observability The unsupported-version diagnostic now reports 9.x. Existing request/error reporting remains applicable.
Transactions, persistence and failover No production transaction, edit-log or persisted metadata representation changes.
Data writes and atomicity Production changes only affect metadata reading; new writes create isolated live-test fixtures with teardown.
FE/BE variables No new transmitted fields or scan properties; existing transfer paths are unchanged.
Performance One additional fixed prefix check and version constant; no added production I/O, unbounded work or synchronization.
Other issues and user focus No additional substantiated issue after independent full-diff and risk-focused reviews. No additional user focus was supplied.

Validation limits: this was static inspection only. No builds, tests, live Elasticsearch requests or SQL end-to-end checks were executed, and the author's reported results were not independently reproduced. The new source/docvalue scroll test uses a standalone Java HTTP client, so it establishes REST smoke coverage rather than executing Doris SQL or the BE reader. Static review coverage is complete; these execution limits do not establish full ES9 runtime compatibility.

The optional test gate and scroll assumptions were cross-checked against the JUnit 5.14.1 condition documentation and Elastic pagination documentation.

Review converged after 1 round(s).

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17613	5171	5081	5081
q2	2151	314	265	265
q3	10222	1366	812	812
q4	4682	466	338	338
q5	7425	800	535	535
q6	179	185	153	153
q7	751	787	610	610
q8	9260	1323	1075	1075
q9	5389	4205	4199	4199
q10	6810	1292	1035	1035
q11	434	252	230	230
q12	633	392	276	276
q13	18088	3582	2992	2992
q14	272	272	249	249
q15	q16	740	713	663	663
q17	1202	743	570	570
q18	6926	6171	6119	6119
q19	1104	954	619	619
q20	390	339	226	226
q21	4403	2139	2279	2139
q22	344	290	258	258
Total cold run time: 99018 ms
Total hot run time: 28444 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5636	5615	5594	5594
q2	664	569	557	557
q3	5225	5403	4963	4963
q4	2002	2151	1590	1590
q5	5360	5162	5445	5162
q6	248	194	158	158
q7	2424	2056	1931	1931
q8	3046	2680	2685	2680
q9	8035	7998	7973	7973
q10	3731	3954	3275	3275
q11	641	422	411	411
q12	697	692	547	547
q13	3513	3873	3223	3223
q14	327	335	283	283
q15	q16	679	721	670	670
q17	8361	7058	6843	6843
q18	13090	12219	12942	12219
q19	893	780	800	780
q20	2139	2146	1942	1942
q21	5673	4740	4783	4740
q22	526	477	431	431
Total cold run time: 72910 ms
Total hot run time: 65972 ms

@hello-stephen

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

query5	4296	611	429	429
query6	417	220	192	192
query7	4808	450	221	221
query8	324	160	155	155
query9	8782	3086	3079	3079
query10	465	306	260	260
query11	5963	3866	3545	3545
query12	151	94	90	90
query13	1252	447	315	315
query14	6134	3945	3628	3628
query14_1	3424	3370	3362	3362
query15	208	205	178	178
query16	929	438	426	426
query17	872	652	523	523
query18	2416	427	314	314
query19	197	171	138	138
query20	84	87	84	84
query21	212	125	110	110
query22	12988	13028	12747	12747
query23	13397	12966	12596	12596
query23_1	12590	12627	12619	12619
query24	7382	814	461	461
query24_1	484	474	479	474
query25	544	420	360	360
query26	1259	261	140	140
query27	2776	445	277	277
query28	4624	1945	1939	1939
query29	1545	631	424	424
query30	287	216	183	183
query31	1013	931	813	813
query32	134	87	90	87
query33	510	288	227	227
query34	935	841	488	488
query35	722	748	631	631
query36	844	844	722	722
query37	115	92	78	78
query38	1754	1740	1656	1656
query39	783	781	758	758
query39_1	726	733	743	733
query40	221	110	93	93
query41	64	62	62	62
query42	85	81	79	79
query43	338	354	310	310
query44	1280	683	686	683
query45	180	168	162	162
query46	821	972	551	551
query47	2980	2843	2707	2707
query48	303	305	214	214
query49	560	400	290	290
query50	657	303	206	206
query51	10540	10537	10596	10537
query52	78	82	68	68
query53	181	209	157	157
query54	234	200	189	189
query55	73	66	63	63
query56	230	222	210	210
query57	1633	1619	1576	1576
query58	272	259	283	259
query59	2123	2230	1991	1991
query60	275	242	225	225
query61	144	141	144	141
query62	392	338	282	282
query63	188	154	160	154
query64	2737	923	759	759
query65	3323	3255	3249	3249
query66	1755	415	312	312
query67	20285	20273	20070	20070
query68	3017	1007	614	614
query69	388	288	247	247
query70	871	776	757	757
query71	286	234	212	212
query72	2725	2572	2269	2269
query73	505	512	286	286
query74	4594	4478	4345	4345
query75	2353	2295	1903	1903
query76	2329	1004	574	574
query77	328	416	272	272
query78	9629	9710	9174	9174
query79	904	838	502	502
query80	520	423	326	326
query81	534	326	266	266
query82	582	130	103	103
query83	304	189	176	176
query84	307	118	99	99
query85	856	410	360	360
query86	324	291	229	229
query87	2014	1951	1800	1800
query88	3621	2661	2661	2661
query89	329	280	237	237
query90	1848	166	165	165
query91	162	146	128	128
query92	99	84	85	84
query93	1006	987	580	580
query94	451	300	259	259
query95	585	323	361	323
query96	651	481	232	232
query97	2496	2423	2350	2350
query98	161	149	148	148
query99	774	773	647	647
Total cold run time: 233591 ms
Total hot run time: 150798 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.04	0.05
query3	0.27	0.09	0.09
query4	1.61	0.10	0.10
query5	0.25	0.24	0.24
query6	1.17	0.69	0.68
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.33	0.36
query10	0.56	0.56	0.62
query11	0.19	0.15	0.14
query12	0.18	0.15	0.15
query13	0.51	0.50	0.50
query14	1.01	1.03	1.00
query15	0.63	0.61	0.62
query16	0.36	0.35	0.35
query17	1.13	1.13	1.13
query18	0.21	0.19	0.21
query19	2.19	2.04	1.95
query20	0.02	0.01	0.02
query21	15.49	0.19	0.14
query22	4.85	0.05	0.06
query23	16.29	0.33	0.12
query24	3.11	0.46	0.34
query25	0.10	0.07	0.06
query26	0.79	0.21	0.16
query27	0.04	0.05	0.03
query28	3.58	0.87	0.37
query29	12.48	4.17	3.28
query30	0.28	0.14	0.10
query31	2.78	0.55	0.32
query32	3.22	0.61	0.50
query33	3.14	3.29	3.20
query34	15.56	4.02	3.42
query35	3.35	3.38	3.36
query36	0.56	0.45	0.44
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.02 s
Total hot run time: 24.36 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@Gabriel39
Gabriel39 merged commit c00ecb1 into apache:master Oct 27, 2026
38 checks passed
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Oct 29, 2026
Apply the outstanding changes in master merge order:
apache#69545 7d16729
apache#69551 7224a2d
apache#69612 61d1aef
apache#69615 8d2bd1e
apache#69650 3dc7341
apache#69651 c00ecb1
apache#69646 e493c61
apache#69668 7865646

apache#69614 already exists on branch-4.2 through apache#69644.
Adapt datasource APIs and tests to the release branch, retaining its
existing scanner dispatch and statement-bound metadata contracts.
yiguolei pushed a commit that referenced this pull request Oct 30, 2026
### What problem does this PR solve?

Backport the requested external-data and FileScannerV2 changes to
`branch-4.2` in their actual master merge order:

| Order | Master PR | Change | Backport |
| --- | --- | --- | --- |
| 1 | #69545 | Preserve Paimon schema options after field renames |
Included |
| 2 | #69551 | Expand Iceberg capability, transaction and snapshot tests
| Included with 4.2 API adaptations |
| 3 | #69614 | Elasticsearch HTTP scans in FileScannerV2 | Already
present through #69644 (`2104b7509cda`); not applied twice |
| 4 | #69612 | Check catalog visibility before SHOW DATABASES accesses
metadata | Included |
| 5 | #69615 | Publish Iceberg Parquet split offsets | Included |
| 6 | #69650 | Preserve ES compound residuals and expand scanner
coverage | Included |
| 7 | #69651 | Accept Elasticsearch 9.x during node discovery | Included
|
| 8 | #69646 | Prioritize Parquet V2 row groups using TopN bounds |
Included |
| 9 | #69668 | Arrow loads and schema inference in FileScannerV2 |
Included |

The eight outstanding changes are combined in one commit. This branch
retains the 4.2 FE datasource APIs instead of importing master's
connector-module refactor.

### Backport adaptations

- Port Paimon schema restoration, catalog-option provenance, fallback
handling and tests to the existing table-copy/serialization lifecycle.
Keep statement-bound fields when reader options are applied after a
schema-only rename.
- Exercise Iceberg's existing metadata and transaction entry points with
real in-memory tables and retained-generation fixtures. Preserve the
nine disabled known-bug reproductions; omit two connector-only lifecycle
tests. Expiration checks verify live data-file sets and exact
delete-file counters; 4.2's separate manifest-name/data-counter issue
remains unchanged. The delete/history SQL suite checks visible rows and
eager/late-materialization parity because 4.2 does not expose master's
`_file`/`_pos` columns. The inventory labels upstream-only evidence
explicitly.
- Port ES residual tracking to the legacy planner and add compound
OR/NOT, docvalue eligibility and Thrift-context tests there. Use Java
8-compatible HTTP APIs for opt-in ES 9 tests and the branch's supported
node-address fixtures.
- Keep the existing full-schema Iceberg metadata-table scan, which
already supplies the file-size dependency for split offsets. Adapt the
external write suite to verify offsets without requiring master-only
distribution plans or golden output.
- Use the existing Parquet statistics interface and physical
row-location representation. Keep the TopN scheduling and pruning
invariants.
- Include the shared Arrow array normalizer required by the new reader,
taken from the same master revision. Preserve 4.2 Lance/Avro dispatch;
omit the schema-inference test for the unavailable Hive OpenCSV parser.

### Validation

- FE production and test sources compile with the branch's Java 8
target. Across the targeted runs and focused reruns, 20 test classes
report 181 discovered, 171 passed, zero failures/errors, and 10 skipped:
nine intentionally disabled known-bug reproductions plus the opt-in live
ES 9 class.
- FE Checkstyle: passed with zero violations.
- Clang compiler syntax checks: all 23 affected C++ translation units
passed against the current sources and freshly generated Thrift, using
cached third-party/generated build dependencies. Focused BE runtime
validation is listed below.
- clang-format 16: all 30 affected C++ source/header files passed.
- Groovy 4.0.19 syntax and AST conversion: all seven changed suites
passed. All 105 local inventory links resolve.
- Complete staged-diff self-review, whitespace/conflict checks, and
sensitive-information checks passed.

A full BE rebuild and SQL/external-service regressions were not run
locally. Live ES 9 tests require their opt-in endpoint. CI is requested
for the combined backport.

### Release note

Fix Paimon reads after field renames, external-catalog SHOW DATABASES
authorization, and ES compound residual filtering. Support ES 9.x node
discovery, publish Iceberg Parquet split offsets, improve Parquet V2
TopN row-group scheduling, and use FileScannerV2 for Arrow loads and
text/JSON schema inference.

### Check List (For Author)

- Test
    - [x] Unit Test
- [x] Regression test additions and syntax checks; SQL execution pending
CI
- Behavior changed:
    - [x] Yes. Backport the changes listed above.
- Does this need documentation?
- [x] No. Existing interfaces and settings are retained; the test
coverage inventory is included.

### Follow-up fixes

- Set the Thrift `enable_file_scanner_v2` default to `true`, matching
the session default. Preserve explicit `false` for legacy query scans
and extend the existing load-selection test.
- Keep the selected Paimon snapshot and schema together during relation
projection. Historical sequence/aggregation options must not be combined
with the latest field names. Read-only principals can resolve historical
selectors without INSERT permission.
- Read legacy append schemas with missing or empty bucket keys without
bucket pruning, preserving every historical file. The regression covers
both unaware and multiple fixed buckets.

Follow-up validation: 169 targeted Paimon FE tests passed with zero
failures/errors/skips. FE production compilation and Checkstyle passed.
Both changed C++ test translation units passed compiler syntax checks
and clang-format 16. Regenerated Java/C++ defaults are enabled; a Java
8-targeted protocol check verifies constructor/clear defaults, an
omitted wire field, and an explicit-false round trip. Complete BE CI and
live external SQL suites remain pending.

The two new reproductions first failed with the same missing-bucket-key
and renamed-sequence-field errors as CI. A separate read-only-principal
reproduction also failed before the permission correction. Complete
external regression execution remains pending CI.

### BE unit-test compatibility

- Complete the native Arrow Variant input dependency for `branch-4.2`:
accept binary storage and the Parquet Variant extension, validate
metadata and payloads before appending, and retain owned data after
Arrow buffers are released. Allow that ingestion path through the load
reader while preserving query-format restrictions and source-default
validation.
- Preserve Variant V2 markers in the Arrow test fixtures, including
nested types. Verify timestamp input against this branch's SerDe for
positive, negative, and second-boundary values. Match the existing DATE
range diagnostic in the TopN pruning test.
- Add tests for sliced and empty reads, invalid ranges and carriers,
malformed metadata/payloads, NULL children, atomic failure, buffer
ownership, and the query capability boundary.

Validation: all 13 previously failing BE tests passed. The expanded run
passed all 309 tests across nine suites, including Arrow/JSON loads,
load validation, Iceberg, table mapping, and Variant input/output. The
focused executable rebuilds the affected readers and SerDe against
cached 4.2 build dependencies; this is not a complete BE rebuild. All
seven changed C++ translation units passed compiler checks with current
headers/generated Thrift, and all 33 affected C/C++ files passed
clang-format 16. The complete staged diff, whitespace, and
sensitive-information checks passed. Full CI is requested with `run
buildall` and `/review`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants