sun-9545sunoj commented on PR #13374:
URL: https://github.com/apache/seatunnel/pull/13374#issuecomment-7045151907

   Thanks @DanielLeens, both points are right. They are addressed in 405b1af94.
   
   Note: I rewrote the branch history to drop a co-author trailer from the 
commit messages. The code of the first two commits is unchanged; they are now 
eed753504 and d46ac44d6 (previously bc3bca79e and 1d802d1de).
   
   **1. Real v1 read failures are no longer mistaken for absence**
   - You're right that the reader only saw failures the v1 getters threw. 
`LocalFileStorage` returns `null` on an `IOException`, and 
`HdfsStorage#getCheckpointsByJobIdAndPipelineId` skips the file.
   - Instead of changing those public getters (other callers rely on them), 
`ChunkSupportStorage` gains two methods:
     - `listV1Checkpoints(jobId, pipelineId)`: enumerates v1 files from their 
names only, newest write timestamp first, the same order 
`getLatestCheckpointByJobIdAndPipelineId` uses.
     - `readV1Checkpoint(file)`: throws on any read or deserialization failure, 
and checks that the file contains the expected pipeline and checkpoint id.
   - `DualFormatCheckpointReader` merges these v1 candidates with the v2 ones 
(by checkpoint id, v2 first on a tie, v1 keeping its own order). It falls back 
to the next readable candidate and fails closed when completed candidates exist 
but none can be read. This applies to both the latest and the 
typed-restore/list selection.
   - Storages without `ChunkSupportStorage` are unchanged.
   - Tests: `DualFormatCheckpointReaderTest` now runs every scenario against 
both the local-file storage and the Hadoop storage on the local FS, using real 
files instead of mocked getters:
     - A corrupt latest v1 falls back to an older v1.
     - All v1 corrupt and no v2 → throws, for both methods.
     - A corrupt v1 next to a valid v2 → v2.
     - A v1 file without read permission → throws, then an older readable one 
is used. The test first asserts that the existing getter swallows it: `null` 
from `LocalFileStorage`, a skipped file from `HdfsStorage`'s list.
   - With the previous reader, 7 of these checks fail.
   
   **2. The restore test enters through `reportedTask`**
   - `testExternalStateIsResolvedThroughTheRealRestoreOperation` no longer 
reflects into `restoreTaskState`.
   - Each task's `TaskReportStatusOperation(WAITING_RESTORE)` goes through 
Hazelcast serialization and is passed to `CheckpointCoordinator#reportedTask`, 
which dispatches asynchronously on the coordinator executor. The test waits on 
a bounded latch (10 s) for both restore operations.
   - All the earlier assertions are kept: exact restored bytes, null segments, 
real `NotifyTaskRestoreOperation#runInternal` after serialization, and a 
missing chunk reported to the master without restoring the task.
   - With the `WAITING_RESTORE` dispatch removed, the test fails.
   
   Validation: `org.apache.seatunnel.engine.server.checkpoint` passes (86 run, 
0 failures, 2 existing skips), as do the storage module tests and `-DskipTests 
verify` on the four changed modules. The checkpoint E2Es have not been re-run 
since the first commit, and CI has not run because Actions is not enabled on my 
fork yet; I'm fixing that.
   


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