sun-9545sunoj commented on issue #13360:
URL: https://github.com/apache/seatunnel/issues/13360#issuecomment-7015614096

   Thanks for the detailed proposal. The O(state bytes) scaling on the master 
matches what we see with CDC snapshot-phase state, and the handle indirection 
looks like the right foundation.
   
   I'd like to help implement this. To keep reviews small and avoid overlapping 
with your own work, I suggest splitting it into phases:
   
   1. **Phase 1: `StateHandle` abstraction, no behavior change.** Introduce 
`StateHandle` / `InlineStateHandle` and switch `ActionSubtaskState`, 
`TaskAcknowledgeOperation`, `PendingCheckpoint` and `CompletedCheckpoint` to 
handles. Every handle is inline, so the on-disk v1 blob stays byte-for-byte 
identical. Tests prove that existing v1 checkpoints still restore.
   2. **Phase 2: `ChunkSupportStorage` SPI and the v2 format.** Add the chunk 
and `_metadata` formats with CRC, implement them for local-file and HDFS, and 
add dual-format probing on restore.
   3. **Phase 3: worker write-through.** Make `SeaTunnelTask#addState` write 
chunks above the inline threshold, add the `state-write-mode` / 
`state-inline-threshold` options, capability-based fallback, and en/zh docs.
   4. **Phase 4: cleanup and observability.** Orphan, `.tmp` and retention 
cleanup, the new metrics, and E2E tests that restore after failover.
   
   I plan to start with Phases 1 and 2 as a draft PR (no change to the runtime 
write path yet), if that doesn't collide with anything you've already started. 
Please tell me which parts you plan to own.
   
   My thoughts on the open questions:
   1. **Inline threshold:** 20 KB. It's aligned with Flink and is just a 
default; it's configurable anyway.
   2. **Missing storage config on a worker:** fail fast, naming the node. A 
silent fallback would hide a misconfiguration and bring back the master-heap 
problem without anyone noticing.
   3. **Orphan cleanup:** the master's periodic task. Only the master knows 
which checkpoint ids committed, so plugins shouldn't have to work that out.
   4. **Offline v1→v2 migration tool:** probably unnecessary, since v1 stays 
readable and new checkpoints build up in v2 after the upgrade.
   5. **`Both` mode:** I'd skip it. Defaulting to `worker` with v1 still 
readable, plus the `master` escape hatch, already gives a rollback path, and 
dual writes would double the IO.
   


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