Skip to content

feat(updater): enhance scaling and update logic for TiCDC instances#6488

Merged
ti-chi-bot[bot] merged 3 commits into
pingcap:feature/v2from
fgksgf:huaxi/set-max-surge
Oct 12, 2025
Merged

feat(updater): enhance scaling and update logic for TiCDC instances#6488
ti-chi-bot[bot] merged 3 commits into
pingcap:feature/v2from
fgksgf:huaxi/set-max-surge

Conversation

@fgksgf
Copy link
Copy Markdown
Member

@fgksgf fgksgf commented Oct 11, 2025

What problem does this PR solve?

Similar to TiDB, set maxSurge by default for TiCDC.

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


@fgksgf fgksgf requested a review from Copilot October 11, 2025 02:14
@ti-chi-bot ti-chi-bot Bot requested a review from howardlau1999 October 11, 2025 02:14
@github-actions github-actions Bot added the v2 for operator v2 label Oct 11, 2025
@ti-chi-bot ti-chi-bot Bot added the size/L label Oct 11, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances TiCDC scaling and update logic by implementing maxSurge support similar to TiDB, allowing for more efficient rolling updates. The change introduces intelligent update strategies that can perform rolling updates with zero downtime when configuration changes are reloadable, or fall back to restart-based updates when necessary.

Key changes:

  • Added precheck logic to determine if TiCDC instances need updates and whether they require restarts
  • Implemented dynamic maxSurge/maxUnavailable configuration based on update type
  • Added comprehensive E2E tests for TiCDC scaling and simultaneous scale/update operations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/controllers/ticdcgroup/tasks/updater.go Enhanced updater logic with precheck functionality and dynamic surge/unavailable configuration
tests/e2e/ticdc/ticdc.go Added new E2E test cases for TiCDC scaling and simultaneous operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +79 to +84
maxSurge, maxUnavailable := 0, 1
noUpdate := false
if needRestart {
maxSurge, maxUnavailable = 1, 0
noUpdate = true
}
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the surge/unavailable configuration logic into a separate function like calculateUpdateStrategy(needRestart bool) (maxSurge, maxUnavailable int, noUpdate bool) to improve readability and make the strategy more explicit.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 11, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.15%. Comparing base (7620fa5) to head (25d1c36).

Additional details and impacted files
@@              Coverage Diff               @@
##           feature/v2    #6488      +/-   ##
==============================================
+ Coverage       43.12%   43.15%   +0.02%     
==============================================
  Files             345      345              
  Lines           23855    23878      +23     
==============================================
+ Hits            10287    10304      +17     
- Misses          13568    13574       +6     
Flag Coverage Δ
unittest 43.15% <80.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liubog2008
Copy link
Copy Markdown
Member

/lgtm

@ti-chi-bot ti-chi-bot Bot added the lgtm label Oct 11, 2025
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Oct 11, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-10-11 02:57:33.531672359 +0000 UTC m=+495442.562771677: ☑️ agreed by liubog2008.

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Oct 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liubog2008

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Oct 11, 2025
@fgksgf
Copy link
Copy Markdown
Member Author

fgksgf commented Oct 11, 2025

/retest

@ti-chi-bot ti-chi-bot Bot merged commit 2f5c253 into pingcap:feature/v2 Oct 12, 2025
9 checks passed
@fgksgf fgksgf deleted the huaxi/set-max-surge branch October 13, 2025 02:17
liubog2008 pushed a commit to liubog2008/tidb-operator that referenced this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants