branch-4.0: [fix](streaming-job) start counting task max interval after the first record is received #63141#63162
Merged
Merged
Conversation
… record is received (#63141) ### What problem does this PR solve? Problem Summary: For PG CDC streaming jobs, when a task creates a fresh logical replication connection, the walsender must re-decode the WAL region from `slot.restart_lsn` up to the client-supplied `startLsn` before any event can be emitted. On high RTT networks (e.g. cross-region Aurora) this catch-up alone can take several seconds. Under the previous behavior the task's `maxInterval` window started the moment the task entered `writeRecords`, so the time spent on WAL position lookup + walsender catch-up was charged against the interval. With `max_interval=10s` this consistently caused tasks to finish with `0 records, 0 heartbeats`, the slot's `confirmed_flush_lsn` never advanced, and every following task repeated the same catch-up — the slot was effectively stuck and replication lag grew indefinitely. This PR delays the start of the `maxInterval` countdown until the first record (or heartbeat) is actually received from the source reader, so the per-task interval governs the real streaming window rather than being consumed by setup. The FE-side `streaming_task_timeout_multiplier * maxIntervalSec` still acts as the hard ceiling.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
yiguolei
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #63141