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

   ### What problem does this PR solve?
   
   Related PR: #62449
   
   Problem Summary:
   
   PR #62449 fixed streaming job offset state-loss after FE checkpoint restart 
for the S3 path, but the cdc_stream TVF path has the same root cause and worse 
impact: after a checkpoint restart in the binlog phase, the job replays from 
the very beginning of the binlog (because `currentOffset == null` falls through 
to a fresh `BinlogSplit` with no `startingOffset`).
   
   Root cause: `JdbcTvfSourceOffsetProvider.getPersistInfo()` returns `null`, 
so `offsetProviderPersist` is never written into the FE image. After 
checkpoint, the pre-checkpoint journal is GC'd, neither journal-replayed 
`currentOffset` nor image-persisted state survives, and recovery falls back to 
a fresh provider with empty `chw`/`bop`.
   
   Only the non-cloud mode is affected. Cloud mode is fine because 
`replayOnCloudMode` pulls a cumulative attachment from MS.
   
   Fix — reuse the parent's existing `chw`/`bop`/`ts` `@SerializedName` 
persistence:
   - Drop the `getPersistInfo()` override so the parent's 
`GsonUtils.GSON.toJson(this)` writes `chw/bop/ts` into the image.
   - Add a `restoreFromPersistInfo()` override to read them back on FE startup 
(called from `gsonPostProcess`).
   - In `updateOffset` binlog branch, mirror `startingOffset` into 
`binlogOffsetPersist` so it survives the image (`currentOffset` has no 
`@SerializedName`).
   - In `replayIfNeed` `currentOffset == null` branch, rebuild `BinlogSplit` 
from `bop`, or apply `chw` (using the existing `null.null` remap) when 
restoring snapshot phase.
   
   ### Release note
   
   Fix cdc_stream TVF offset state loss after FE checkpoint restart (non-cloud 
mode).
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test 
(\`test_streaming_job_cdc_stream_postgres_checkpoint_restart_fe.groovy\` covers 
both mid-snapshot and binlog-phase checkpoint restart)
       - [ ] Unit Test
       - [ ] Manual test
       - [ ] No need to test
   
   - Behavior changed:
       - [x] No.
   
   - Does this need documentation?
       - [x] No.
   
   ### 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