You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "davidzollo (via GitHub)" <gi...@apache.org> on 2026/04/15 03:46:30 UTC

[I] [Design Proposal][Zeta] Reduce historical job runtime info stored in IMap / StateStore with differentiated retention [seatunnel]

davidzollo opened a new issue, #10767:
URL: https://github.com/apache/seatunnel/issues/10767

   ### Search before asking
   
   - [x] I searched existing issues and found related discussions about IMAP growth, job history storage, StateStore abstraction, and IMAP compaction, but did not find a dedicated issue for differentiating retention strategy between batch and streaming historical runtime information.
   
   ### Description
   
   ## Background
   
   Today, SeaTunnel Zeta stores finished job runtime information in distributed engine state, including:
   
   - finished job status
   - finished job metrics
   - finished job DAG / vertex info
   - related historical logs / references
   
   There is currently a single global retention control:
   
   - `history-job-expire-minutes`
   
   This is useful, but it is still too coarse for real workloads.
   
   In practice, the engine should not keep all historical runtime information in IMap / StateStore with a single retention policy for all job types.
   
   ## Problem
   
   ### 1. Batch jobs and streaming jobs have different retention needs
   
   - Batch jobs are naturally finite, and users often only need historical details for a bounded period.
   - Streaming jobs are long-running, and their runtime information should not accumulate in distributed state in an unbounded or over-detailed way.
   
   Using one global expiration policy for both types can be inefficient:
   
   - too short: batch troubleshooting data may disappear too early
   - too long: distributed engine state grows unnecessarily and increases memory / storage pressure
   
   ### 2. Not all history should stay in distributed engine state
   
   Distributed engine state should mainly keep what is necessary for:
   
   - current coordination
   - recent troubleshooting
   - bounded recovery / UI summary needs
   
   It should not become the long-term storage for all historical runtime detail.
   
   ### 3. Existing issues already show symptoms of state growth / history pressure
   
   Related examples:
   
   - #8558
   - #10039
   - #10329
   - #10766
   
   There was also an older design discussion about job history storage:
   
   - #2398
   
   ## Proposal
   
   Discuss and design a differentiated retention strategy for historical runtime information.
   
   ### For batch jobs
   
   Introduce retention control dedicated to finished batch jobs, for example:
   
   - separate retention setting from streaming jobs
   - configurable retention for finished batch job state / metrics / DAG detail
   - optional summary-only retention after detailed data expires
   
   ### For streaming jobs
   
   Streaming jobs need a different strategy.
   
   Possible direction:
   
   - do not keep all historical runtime detail in IMap / StateStore
   - keep only bounded recent detail needed for UI / troubleshooting
   - retain only latest summary / latest checkpoint summary / latest error summary in distributed state
   - move long-term detailed history to more suitable storage if needed
   
   This is especially important because streaming jobs can run for a very long time, so "history" for them should usually be:
   
   - rolling window
   - compacted summary
   - bounded recent records
   
   rather than full detail kept in distributed engine state.
   
   ### Suggested design discussion topics
   
   1. Which data must stay in distributed engine state?
   2. Which data can be reduced to summary form?
   3. Which data should use bounded rolling retention instead of full historical retention?
   4. Should batch and streaming jobs have separate retention configuration?
   5. Should different artifacts have separate retention policies?
      - job state summary
      - detailed metrics
      - DAG / vertex detail
      - checkpoint / runtime detail
      - logs / log references
   
   ## Non-goals
   
   - This issue is not proposing to replace Hazelcast IMap with RocksDB in the same step.
   - This issue is not proposing a big refactor before agreement on data boundaries.
   - The main goal is to define a better retention policy and reduce unnecessary historical runtime data kept in engine state.
   
   ## Acceptance criteria
   
   - We define which historical runtime information should remain in IMap / StateStore and which should not.
   - We define different retention expectations for batch and streaming jobs.
   - We avoid relying on a single global retention policy for all job types and all historical artifacts.
   - The final direction helps reduce engine state growth without breaking troubleshooting or recovery needs.
   
   ### Related issues
   
   - #2398
   - #8558
   - #10039
   - #10181
   - #10209
   - #10329
   - #10766
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct
   


-- 
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: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Discussion][Zeta] Reduce historical job runtime info stored in IMap / StateStore with differentiated retention [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10767:
URL: https://github.com/apache/seatunnel/issues/10767#issuecomment-4252929749

   Thanks, this is a useful distinction.
   
   I rechecked the current `dev` code path:
   - finished job state, finished job metrics, and finished job DAG info all use the same global `history-job-expire-minutes` TTL in `JobHistoryService`
   - `runningJobMetrics` is maintained separately in `engine_runningJobMetrics` and is not governed by that history TTL
   
   So I agree with the point in the thread: the more immediate growth pressure may indeed come from `runningJobMetrics`, while this issue is really about how finished / historical runtime artifacts should be retained and compacted.
   
   Because of that, I would suggest splitting the next step into two layers:
   1. first, use the observability work in #10766 to measure which stores / artifacts are actually growing in practice
   2. then, for retention design, make the boundaries explicit: which finished-job artifacts keep a TTL, which should degrade to summary form, and whether batch / streaming really need separate retention knobs
   
   That should let us avoid adding several new retention configs before we know which artifacts are actually dominating the state pressure.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Discussion][Zeta] Reduce historical job runtime info stored in IMap / StateStore with differentiated retention [seatunnel]

Posted by "goutamadwant (via GitHub) via commits" <co...@seatunnel.apache.org>.
goutamadwant commented on issue #10767:
URL: https://github.com/apache/seatunnel/issues/10767#issuecomment-6715710346

   @DanielLeens I tested this locally: TTL expiry and restart behaved correctly, but WAL files stayed on disk. Detailed metrics were 84% of estimated finished-history heap in the 20-job test. Streaming metrics contexts stayed stable while checkpoint-monitor WAL grew.
   
   Would keeping summaries longer than detailed metrics be the right first design scope, preserving defaults and making expired detail clear in REST/CLI? WAL reclamation would stay with #10329.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Discussion][Zeta] Reduce historical job runtime info stored in IMap / StateStore with differentiated retention [seatunnel]

Posted by "dybyte (via GitHub)" <gi...@apache.org>.
dybyte commented on issue #10767:
URL: https://github.com/apache/seatunnel/issues/10767#issuecomment-4250348119

   From what I understand, the more immediate state growth pressure seems to come from `runningJobMetrics`, rather than finished job data itself.
   That said, I still think it makes sense to introduce separate retention policies for batch and streaming jobs, since their runtime characteristics are quite different.
   It may also be helpful to clarify which historical artifacts are actually contributing most to state growth in practice.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Discussion][Zeta] Reduce historical job runtime info stored in IMap / StateStore with differentiated retention [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on issue #10767:
URL: https://github.com/apache/seatunnel/issues/10767#issuecomment-6739656927

   Thanks for the measurements. Keeping compact summaries longer than detailed finished-job metrics is a reasonable first design direction, but it is not yet a change to defaults or retention configuration.
   
   Current `dev` still has three separate boundaries: finished-history maps use `history-job-expire-minutes`; running metrics use `engine_runningJobMetrics`; and `FileMapStore` explicitly skips persistence for the running-metrics map. Therefore the reported WAL growth must first be attributed to an exact map/store path rather than treated as evidence that finished-history retention caused it.
   
   Please add a small evidence table before proposing code: backend and map name, entry/byte counts before and after expiry, job mix, retention value, restart result, and the WAL files attributed to that map. Also specify the REST/CLI contract when detailed metrics have expired but a summary remains, including how callers distinguish an expired detail from an unavailable job.
   
   For the first implementation discussion, preserve the existing `history-job-expire-minutes` behavior and avoid adding batch/streaming knobs until this evidence identifies a material difference. WAL reclamation remains a separate concern; please keep it out of a retention-only PR.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org