Gabriel39 opened a new issue, #71238:
URL: https://github.com/apache/doris/issues/71238

   ### Background
   
   Iceberg encryption combines KMS-managed file keys with encrypted metadata, 
Parquet modular encryption (PME), and authenticated Puffin streams. Doris has 
an opt-in native encrypted-read path. The merged Iceberg v4 support also 
introduces relative file descriptors and Parquet manifests that must retain the 
SDK encryption chain.
   
   ### Current behavior
   
   The existing read path does not cover the full set of encrypted files 
produced by the Iceberg SDK: encrypted Puffin deletion vectors, signed 
plaintext Parquet footers, AES_GCM_CTR_V1, and independently encrypted columns 
need additional handling. V4 relocation and metadata-table planning must 
preserve descriptor provenance without exposing file-key metadata through JNI 
rows. Native-positive regression suites are disabled by the checked-in test 
configuration.
   
   ### Expected behavior
   
   With encrypted reads and protected private RPC configured, HMS and REST 
catalogs read supported encrypted v3/v4 tables through native readers, 
including independent data/delete keys, historical snapshots, and metadata 
tables. Unsupported data formats and encrypted writes fail explicitly. Ordinary 
plaintext reads retain their existing behavior.
   
   ### Proposed design
   
   Keep key resolution in the Iceberg SDK and pass only query-scoped, 
independently owned file keys over authenticated private RPC. Decode AGS1 
Puffin ranges with bounded authenticated blocks. Authenticate Parquet footer 
and encrypted column metadata before pruning; support both upstream cipher 
variants. Resolve independent column keys through an operator-installed local 
provider, with immutable location and physical-column-path inputs.
   
   Preserve typed descriptors and native encrypted input wrappers through v4 
relocation and cancellation. Materialize projected metadata rows into bounded, 
detached tasks with reserved key-carrier fields removed. Use bounded lazy 
batches and a statement-owned key cache. Require a fresh versioned capability 
from every selectable BE and preserve fail-closed checks at dispatch and lazy 
fetch.
   
   Native alternatives that route encrypted data through a generic JNI reader 
or cache unwrapped keys across statements are excluded because they lose native 
format validation or current authorization. Keep synchronous maintenance and 
transaction refresh/commit fences so an enabled read path cannot authorize 
encrypted writes. Split fetches are consuming operations: do not replay 
ambiguous failures, discard failed streams, and bind requests/connections to 
the FE process incarnation.
   
   ### Impact
   
   Users reading encrypted Iceberg v3/v4 tables through HMS or REST catalogs 
benefit. Changes span connector planning, common SDK adapters, FE/BE capability 
transport, native Parquet/Puffin readers, and regression fixtures. The read 
switch remains disabled by default.
   
   ### Reproduction or evidence
   
   The accompanying regression fixtures use the Iceberg SDK to generate 
encrypted data, metadata, deletes, and independent reference results. New 
focused tests reproduce lost v4 encryption provenance, missing 
authentication/column-key handling, stale FE split connections after restart, 
and a timed-out split response becoming a later query's batch. The last failure 
was reproduced over a real TLS socket before its fix.
   
   ### Scope and non-goals
   
   Read-only support for supported Parquet data/delete files, authenticated 
Puffin deletion vectors, and encrypted metadata. Plaintext ORC data may carry 
encrypted Parquet/Puffin deletes. Encrypted Avro/ORC data and encrypted writes 
remain unsupported. Real AWS/GCP/Azure IAM and credential-refresh acceptance 
requires an external environment and is not claimed by local SDK/protocol 
fixtures.
   
   ### Acceptance criteria
   
   - Local native, connector, FE, wire, and enabled SQL suites pass, including 
v3/v4, HMS/REST, eager/lazy, cache, pruning/count, history, key rotation, 
malformed inputs, and rejection controls.
   - A real legacy BE prevents encrypted reads before KMS access; removing it 
restores reads without restarting current nodes.
   - RELEASE baseline/candidate comparisons and repeated 
read/cancel/timeout/recovery resource measurements are recorded separately from 
correctness results.
   - English and Chinese user documentation describes configuration, support, 
limitations, and troubleshooting.
   
   ### Risks and compatibility
   
   New Thrift fields are optional and use IDs verified across supported release 
branches. Legacy bool-only BE capability cannot authorize the expanded reader 
contract; older peers continue ordinary plaintext work. No encrypted storage 
format, key-bearing persistent metadata, or dependency version is introduced. 
AES_GCM_CTR_V1 authenticates metadata but does not authenticate page payloads, 
as defined upstream. Encrypted writes and result-cache reuse remain fenced.
   
   ### Related
   
   - apache/doris#70869: Iceberg v4 support.
   - apache/doris-website#4721: user documentation.
   - [Iceberg encryption](https://iceberg.apache.org/docs/nightly/encryption/).
   - [Iceberg encryption 
specification](https://iceberg.apache.org/spec/#encryption-keys).
   - [Parquet 
encryption](https://github.com/apache/parquet-format/blob/master/Encryption.md).
   


-- 
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]

Reply via email to