Skip to content

fix(cdc): restart snapshot read correctly - #26129

Merged
zwang28 merged 2 commits into
release-3.0from
copilot/release-30-cherry-pick-fix-cdc
Jul 17, 2026
Merged

zwang28 merged 2 commits into
release-3.0from
copilot/release-30-cherry-pick-fix-cdc

Conversation

Copilot AI commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of #26105 onto release-3.0. Fixes incorrect CDC backfill snapshot restart behavior when needs_rebuild_snapshot is set.

What's changed and what's your intention?

cdc_backfill.rs

  • Move should_bypass_snapshot_stream_patch (rate-limit-to-zero check) inside backfill_loop so it is re-evaluated on each restart, not once at startup.
  • Capture old rate_limit_rps state before updating to new value — the bypass flag must reflect whether the previous snapshot stream was ever established.
  • Change barrier staging condition: if can_start_new_snapshot → if can_start_new_snapshot || needs_rebuild_snapshot, so a requested rebuild actually stages the barrier and breaks out to restart the snapshot.
  • Remove the now-redundant if needs_rebuild_snapshot { continue 'backfill_loop; } inside the barrier emit path (was dead code after the condition fix above).
  • Fix snapshot stream patch: resume the valve before consuming when the snapshot is paused, and add a drain arm for the paused case to avoid dropping the resumed chunk.

postgres_schema_check_and_schema_change.slt

  • Rename mood_enum → mood_enum_2 (with DROP TYPE IF EXISTS guard) to avoid type name conflicts across parallel test runs.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

Fixed a bug where CDC table backfill would not correctly restart the snapshot read after a rate-limit change or explicit rebuild request, potentially causing data loss or stalled backfill progress during recovery.

Co-authored-by: risingwave-ci <113648949+risingwave-ci@users.noreply.github.com>
Copilot AI changed the title [WIP] Cherry-pick fix(cdc): Restart snapshot read correctly fix(cdc): restart snapshot read correctly (cherry-pick #26105 to release-3.0) Jul 2, 2026
Copilot AI requested a review from risingwave-ci July 2, 2026 03:42
@cyliu0
cyliu0 requested a review from zwang28 July 14, 2026 12:46
@github-actions github-actions Bot added type/fix Type: Bug fix. Only for pull requests. ci/run-e2e-cdc-source-tests labels Jul 14, 2026
@zwang28
zwang28 marked this pull request as ready for review July 15, 2026 10:06
@zwang28
zwang28 enabled auto-merge July 15, 2026 10:06
@zwang28
zwang28 requested a review from cyliu0 July 15, 2026 10:06
@zwang28 zwang28 changed the title fix(cdc): restart snapshot read correctly (cherry-pick #26105 to release-3.0) fix(cdc): restart snapshot read correctly Jul 15, 2026
@zwang28
zwang28 added this pull request to the merge queue Jul 17, 2026
Merged via the queue into release-3.0 with commit c675cf0 Jul 17, 2026
38 of 41 checks passed
@zwang28
zwang28 deleted the copilot/release-30-cherry-pick-fix-cdc branch July 17, 2026 02:00
wenym1 pushed a commit that referenced this pull request Jul 26, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zwang28 <70626450+zwang28@users.noreply.github.com>
Co-authored-by: risingwave-ci <113648949+risingwave-ci@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/run-e2e-cdc-source-tests type/fix Type: Bug fix. Only for pull requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cherry-pick fix(cdc): restart snapshot read correctly (#26105) to branch release-3.0

4 participants