LuckysHorizon commented on PR #13136:
URL: https://github.com/apache/seatunnel/pull/13136#issuecomment-7170824374

   > Please preserve the worker addresses returned by 
`SeaTunnelClient.getJobInfo(jobId)` after a batch job finishes.
   > 
   > I reproduced this on `718f00b8` with a single-worker `FakeSource` → 
`Console` job. After `FINISHED`, the archived DAG contained the worker address. 
The base revision returned that address both before and after cleanup. On this 
PR, the client returned an empty `historyExecutionPlan` until cleanup finished. 
The distributed `JobInfo` is retained for 60 seconds by default. During that 
window, `CoordinatorService.getJobInfo()` calls `restoreJobDAGInfo()`, which 
rebuilds the DAG with an empty worker set.
   > 
   > Could we fix #13130 in 
`RealtimeMetricsService.resolveObservabilityConfig()`? It already reads the 
current attempt’s `JobInfo` to get its initialization timestamp. Reading the 
env options from that attempt’s `JobImmutableInformation.getJobConfig()` would 
keep the metrics fix local and preserve the archived DAG for completed jobs.
   > 
   > Please add a regression test that queries the worker address while cleanup 
is pending. In the same-ID restore E2E, please also assert that 
`/metrics/realtime/jobs` reports `enabled=true` and `bucketMs=2000` while the 
previous attempt’s `enabled=false` history entry still exists. On the base 
revision, the current assertion passed after about 63 seconds because the 
history entry expired within the two-minute wait.
   
   Thanks @nzw921rx for the reproduction. I confirmed it and reworked the PR 
(head 2801b15).
   
   - **`getJobInfo()` is reverted.** `CoordinatorService.java` has no diff 
against the base now, so a finished batch job keeps its archived DAG, including 
the worker address in `historyExecutionPlan`, during `state-cleanup-delay-ms`.
   - **#13130 is fixed locally**, as you suggested, in 
`RealtimeMetricsService.resolveObservabilityConfig()`. It reads the env options 
from the current attempt's `JobInfo`. It also caches per `(jobId, 
initializationTimestamp)` and falls back to `getJobInfo()` if the `JobInfo` is 
missing or unreadable.
   - **Cleanup-window test:** 
`CoordinatorServiceJobCleanupTest.testGetJobInfoReturnsArchivedDagDuringDelayedCleanup`
 uses a 30 s cleanup delay. While the `runningJobInfoIMap` entry still exists, 
it asserts the archived DAG with a non-empty execution plan and worker address. 
It fails if I re-apply the old reorder.
   - **Restore IT:** history retention is set above the test's total await 
time, the test asserts the attempt-1 history entry (`enabled=false`) still 
exists, and then asserts `/metrics/realtime/jobs` reports `enabled=true` and 
`bucketMs=2000` while it does. It fails if I revert the 
`RealtimeMetricsService` change.
   
   `RealtimeMetricsRestIT` passed 2/2 in each of two local runs. The 
apache-side Build still needs workflow approval, so could you approve the run 
when convenient? Please re-review when you have time.


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