Skip to content

checker: support TSO microservice config in active active preflight#5092

Open
King-Dylan wants to merge 2 commits into
pingcap:release-8.5-20260213-v8.5.5from
King-Dylan:codex/fix-active-active-tso-compat
Open

checker: support TSO microservice config in active active preflight#5092
King-Dylan wants to merge 2 commits into
pingcap:release-8.5-20260213-v8.5.5from
King-Dylan:codex/fix-active-active-tso-compat

Conversation

@King-Dylan
Copy link
Copy Markdown
Member

@King-Dylan King-Dylan commented May 18, 2026

What problem does this PR solve?

Active-active TSO preflight still reads tso-unique-index and tso-max-index from PD config only. In TSO microservice deployments, that can validate the wrong source of truth and reject or accept changefeed creation incorrectly.

Issue Number: close #5091

What is changed and how it works?

  • read downstream TSO indexes from SHOW CONFIG with type='tso' first and fall back to type='pd' only when no TSO rows are reported
  • read upstream TSO indexes from the TSO microservice config endpoint when the microservice API is available, and fall back to PD config only for legacy deployments
  • keep the validation fail-closed for missing configs, empty TSO membership, inconsistent instance values, and TSO config read failures
  • reuse the HTTP client when reading multiple TSO member configs and keep bounded request timeouts

Check List

Tests

  • Unit test

Questions

Will it cause performance regression or break compatibility?

No. The change keeps the old PD fallback for legacy embedded-TSO deployments, and it reuses the HTTP client when reading multiple TSO member configs.

Do you need to update user documentation, design documentation or monitoring documentation?

No.

Release note

TiCDC active-active TSO preflight now reads TSO microservice config when it is available and falls back to PD config for legacy deployments.

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label May 18, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 18, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign 3aceshowhand for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e31f64ff-04e6-45b8-86fd-65fafaebe5c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pingcap-cla-assistant
Copy link
Copy Markdown

pingcap-cla-assistant Bot commented May 18, 2026

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 18, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for TSO microservices in the active-active TSO index validation logic. It updates both upstream and downstream retrieval processes to prioritize TSO service configurations while maintaining fallbacks to legacy PD configurations. Feedback focuses on optimizing the retrieval of upstream TSO configurations by reusing HTTP clients to avoid connection overhead and improving code clarity by explicitly returning nil in success paths.

Comment thread pkg/check/active_active_tso_indexes.go Outdated
Comment thread pkg/check/active_active_tso_indexes.go Outdated
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for TSO microservices to the active-active TSO index validation logic, updating both upstream and downstream retrieval to prioritize TSO service configurations with a fallback to legacy PD settings. The review feedback identifies a performance optimization to reuse HTTP clients rather than recreating them in loops and suggests a minor refactor to return nil explicitly when no error is present.

Comment thread pkg/check/active_active_tso_indexes.go Outdated
Comment thread pkg/check/active_active_tso_indexes.go Outdated
@ti-chi-bot ti-chi-bot Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant