HTHou opened a new pull request, #19002:
URL: https://github.com/apache/iotdb/pull/19002

   ## Description
   
   Introduce an optional extension boundary for WAL and checkpoint formats 
without adding a new built-in file format or an encryption implementation to 
Apache IoTDB.
   
   ### Format Dispatch And Ownership
   
   - Add `WALFormatProvider` and `WALFileContext` for format detection, 
per-file read/write contexts, segment decoding, metadata sealing and resource 
release.
   - Load at most one optional provider through `ServiceLoader`. With no 
provider installed, writers continue to use the existing V2 checkpoint and V3 
WAL formats.
   - Use `WALFileVersion.EXTENDED` only as an internal dispatch marker. The 
provider owns its on-disk magic, headers and payload layout; no V4 layout, 
cryptographic algorithm, wallet, key-management implementation or production 
service registration is included.
   - Reject unavailable formats in the reserved versioned WAL magic namespace 
instead of interpreting them as V1.
   
   ### Recovery And Cleanup
   
   - Add a cause-aware `WALFormatException` for failures that must not become 
tail-truncation recovery, metadata reconstruction or file quarantine.
   - Run provider validation before WAL/checkpoint replay or destructive 
cleanup, propagate failures from asynchronous recovery tasks, and expose an 
optional recovery-failure diagnostic callback.
   - Release decoded segment buffers before their per-file context, retain 
logical seek/resume support, and close caller-owned channels when provider 
initialization fails.
   - Preserve the built-in format codecs and existing recovery diagnostics.
   
   ### Tests
   
   - Add provider selection, magic detection, error propagation and 
cleanup-order tests.
   - Exercise writer/reader/checkpoint dispatch, seek/resume, metadata 
failures, initialization cleanup and startup recovery with a mock provider in 
an isolated classloader. The mock provider is not globally registered and 
cannot conflict with downstream providers.
   - Full-reactor English build with targeted WAL tests: **81 tests passed**, 
with **7 additional extension scenarios** checked inside the isolated-runtime 
test.
   - Full-reactor Chinese `test-compile`: passed.
   - Spotless, Checkstyle and `git diff --check`: passed.
   
   No cluster integration test or production encryption-provider test is 
claimed by this PR.
   
   ## Checklist
   
   - [x] Self-reviewed the format boundary and failure paths.
   - [x] Added Javadocs for the extension interfaces and lifecycle contract.
   - [x] Added unit tests and Apache license headers.
   - [x] Kept encryption implementations and concrete extension file formats 
out of Apache IoTDB.
   


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

Reply via email to