Gabriel39 opened a new pull request, #71239:
URL: https://github.com/apache/doris/pull/71239
### Background
Iceberg encryption uses KMS-managed file keys, Parquet modular encryption
(PME), and authenticated Puffin streams. Doris already has an opt-in native
encrypted-read path, while Iceberg v4 adds relative descriptors and Parquet
manifests. These formats need the SDK encryption chain to survive planning and
independently keyed deletes to reach the native readers.
### What problem does this PR solve?
Issue Number: close #71238
Related PR: #70869 (v4 support this builds on)
PR Type: Feature
Problem Summary:
HMS/REST users cannot read several SDK-produced encrypted v3/v4 layouts, and
the positive native regression suites are disabled in the external pipeline.
Add authenticated Puffin deletion vectors, both Parquet cipher/footer variants,
independent column keys, and bounded encrypted metadata-table and lazy planning
paths. Preserving v4 provenance, protecting every key-delivery boundary, and
adding independent SDK fixtures account for most of the change. The
operator-only `enable_encryption_read` plugin setting remains false by default
and requires an FE restart.
### Details
- **Change map:** 90 files: production +2,134/-342; tests/fixtures
+3,655/-100; generated regression output +757; docs +78/-30; build/config +6.
Read in this order:
1. SDK descriptor relocation, query-owned IO, and bounded metadata
rows/lazy batches: `DorisRelocatedFiles`, `DorisMetadataRows`,
`IcebergMetadataSplitSource`, and scan planning.
2. Authenticated Puffin/Parquet readers and independent key delivery:
`DeletionVectorReader`, `IcebergParquetFooter`, `IcebergParquetColumnKeys`, and
native Parquet crypto.
3. Versioned BE admission, protected dispatch/fetch, write/CAS fences, and
FE-incarnation/failed-stream handling for consuming split RPCs.
Tests exceed production additions and use SDK-produced encrypted files
with independently checked results.
- **Scope:** HMS and REST encrypted v3/v4 reads, Parquet data/legacy
deletes, AGS1 Puffin deletion vectors, and metadata tables. Plaintext ORC data
can use encrypted Parquet/Puffin deletes. Encrypted Avro/ORC data and encrypted
writes remain unsupported and fail explicitly.
- **Design:** Retain typed SDK encryption provenance, pass query-owned file
keys only over protected private RPC, and keep metadata JNI tasks detached and
keyless. Authenticate metadata before pruning and bound
decryption/row/batch/key-cache memory. Independent column keys use an
operator-installed local provider; user catalog properties cannot download or
select its implementation. Generic JNI encrypted-data fallback and
cross-statement key caching would lose these invariants. Proposed in #71238,
opened for this PR; not discussed yet.
- **Usage:** Configure private mutual TLS as documented in
`docs/private-rpc-tls.md`, set `enable_encryption_read=true` in the Iceberg
plugin's `iceberg.conf` on every FE, restart FEs, and query an existing
encrypted HMS/REST table:
```sql
SELECT id FROM iceberg_catalog.db.encrypted_table WHERE id = 1;
SELECT * FROM iceberg_catalog.db.encrypted_table$files;
```
Independently encrypted columns additionally require
`parquet_column_key_provider_class` in the operator-controlled plugin
configuration and its local implementation.
- **Default behavior:** Encrypted reads remain disabled. The external
regression pipeline enables `enableIcebergEncryptionNativeRead=true`; enabled
suites require their prerequisites and emit completion markers after actual
assertions.
- **Compatibility:** Optional Thrift fields and enum IDs were checked
against master and all supported release branches. Expanded reads require a
fresh version2 capability from every selectable BE; boolean-only peers cannot
authorize them. Plaintext work retains legacy routes. Capability leases are
process-local, with replay/image/stale-heartbeat tests. Deploy FE, BE, and
connector plugins together; no storage-format or dependency-version change is
introduced.
- **Behavior change:** When encrypted reads are enabled, even previously
supported layouts now require fresh version2 capabilities from every selectable
BE. During a mixed-version upgrade these queries refuse before KMS access;
upgrade FE, BE, and connector plugins together.
- **Persistence and failure handling:** No persistent unwrapped-key cache is
added. Encrypted writes/maintenance fail before direct IO and through
refresh/commit; definite SDK cleanup failures remove staged metadata. A
consuming split request is not replayed after ambiguous transport failure:
discard its stream, and reject requests bound to another FE incarnation before
looking up source IDs.
- **Security and privileges:** Catalog creation/query privileges and the
existing SDK KMS authorization model apply. The column-provider implementation
is an operator-controlled local plugin. Independent-column reads fetch
authenticated footer bytes on the FE through existing table FileIO/catalog
storage endpoints; existing catalog privileges and endpoint checks apply. No
new endpoint property, remote artifact loader, or key-bearing diagnostics is
added. Private RPC must authenticate both peers. AES_GCM_CTR_V1 authenticates
metadata but not page payloads, following the upstream format.
- **Follow-up plan:** Encrypted Avro data and encrypted writing need
separate work. Live cloud-provider IAM/credential-refresh acceptance remains
unverified without an environment.
### Testing
- Local ASAN native preset: 304/304 tests pass, including real TLS
late-response isolation, cipher/footer/column-key combinations, AGS1
authentication/range boundaries, and malformed input controls.
- Connector inventory: 2,433 pass and 11 existing skips; later targeted
ORC/delete coverage passes 539 tests (overlaps the inventory). Current FE/wire
selection: 40 pass.
- Official local normal comparison: all eight PME SQL suites pass, zero
failures/fatal errors/skips, with both native completion markers. Covers
HMS/REST, v3/v4, cache/eager/lazy/pruning/count combinations, rich
types/evolution, history/key rotation, KMS refusal/recovery, write rejection,
and a real FE cold restart.
- Real mixed-BE local control passes: same-CA current/legacy heartbeats,
cold/warm eager/lazy capability refusal with zero KMS requests, and recovery
after removing only the legacy BE without restarting current nodes. Frozen
packages remain unchanged and owned engines are cleaned up.
- Local RELEASE comparison against exact base `8597e08d`: 24 cases, 4/64
files and 1,048,576 rows, three warmups and eleven alternating pairs per case.
All 528 measured results match; plaintext median ratios are 0.974–1.049 on a
shared host. This is descriptive data, not quiet-host certification.
- Repeated resource controls pass: 40 nested/binary metadata reads, 80
concurrent encrypted reads, 20 cancellations, 10 timeouts, and 10 refreshes,
each with validated recovery. Owned process identities persist through all
phases; final cleanup has no survivors/errors and both frozen packages remain
unchanged. Post-warmup thread and FD counts stay stable across the measured
series.
### Notes for Reviewers
- The generated integration output has 113 tags/543 rows independently
checked against SDK results and fixture arithmetic.
- Both candidate executables pass the GLIBC2.17 gate. The 39 shipped
dependency ABI findings are byte-identical to the exact-HEAD baseline; full
JNI-closure GLIBC2.17 compatibility is not claimed.
### Release note
Extend opt-in Iceberg encrypted reads to supported v3/v4 metadata, Parquet
encryption variants and independent column keys, and authenticated Puffin
deletion vectors. Encrypted writes remain unavailable.
### Check List (For Author)
- Behavior changed: Yes (see Details)
- Does this need documentation: Yes (apache/doris-website#4721)
- Pre-submission status: Partially verified: live AWS/GCP/Azure IAM and
credential refresh need an unavailable environment; quiet-host latency
certification is unavailable on the shared host
### AI Disclosure
- Tool: Codex (GPT-6)
- Generated: implementation, tests, local evidence tooling, and this
description
- Human review: not stated
- Prompts: Audit official Iceberg PME coverage and close the read gaps
except Avro data and encrypted writes; include v4, enable and run the cases
locally, fix repeated self-review findings before committing, and add
English/Chinese feature documentation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]