JNSimba opened a new pull request, #62449:
URL: https://github.com/apache/doris/pull/62449

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Problem Summary:
   
   After FE checkpoint restart, streaming job's S3 offset and partial 
statistics (fileNumber, fileSize, filteredRows) are lost, causing:
   
   1. **S3 offset lost → duplicate data consumption**: `S3SourceOffsetProvider` 
did not implement `getPersistInfo()`, so `offsetProviderPersist` was always 
null. The checkpoint image did not contain offset state. After restart from 
checkpoint image, the job re-consumed all files from the beginning.
   
   2. **Job statistics partially lost**: `StreamingJobStatistic.fileNumber`, 
`fileSize`, `filteredRows` were missing `@SerializedName` annotations. 
`GsonUtils.GSON` uses `HiddenAnnotationExclusionStrategy` which skips fields 
without `@SerializedName` during serialization, causing these fields to reset 
to 0 after checkpoint restart.
   
   Root cause: Both issues share the same root cause — fields that should be 
persisted in the checkpoint image were not being serialized by `GsonUtils.GSON`.
   
   ### Fix
   
   1. **S3 offset persistence**:
      - Implement `getPersistInfo()` in `S3SourceOffsetProvider` to return 
serialized current offset
      - Implement `replayIfNeed()` to restore offset from 
`offsetProviderPersist` on restart
      - Add `this.offsetProviderPersist = offsetProvider.getPersistInfo()` in 
`updateJobStatisticAndOffset()` to keep the persist field in sync after each 
task commit
   
   2. **Statistics serialization**:
      - Add `@SerializedName` to `fileNumber`, `fileSize`, `filteredRows` in 
`StreamingJobStatistic`
   
   ### Release note
   
   Fix streaming job S3 offset and statistics (fileNumber, fileSize, 
filteredRows) lost after FE checkpoint restart, which could cause duplicate 
data consumption.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. S3 streaming job offset is now persisted in checkpoint image 
via `offsetProviderPersist`, preventing duplicate data consumption after FE 
checkpoint restart.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to