Skip to content

azure: support managed identity and fix a goroutine hang issue#3094

Merged
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
wlwilliamx:feat/support-azure-managed-identity
Jan 21, 2026
Merged

azure: support managed identity and fix a goroutine hang issue#3094
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
wlwilliamx:feat/support-azure-managed-identity

Conversation

@wlwilliamx
Copy link
Collaborator

@wlwilliamx wlwilliamx commented Nov 13, 2025

What problem does this PR solve?

Issue Number: close #3093

TiCDC writes directly to Azure Blob Storage for the azblob sink. This PR adds Azure Managed Identity / Workload Identity token auth support and fixes a potential goroutine hang in cloud storage uploads.

What is changed and how it works?

  • Support Azure token-based auth (Managed Identity / Workload Identity) for azblob sinks.
  • Add timeout/cancellation handling for streaming/multipart uploads to avoid stuck goroutines.

Check List

Tests

  • Unit test
  • Manual test (E2E on Azure)

Manual test steps:

  1. Deploy TiCDC and TiDB cluster on Azure with Managed Identity / Workload Identity enabled and configure an azblob sink pointing to Azure Blob Storage.
  2. Run a changefeed and generate writes.
  3. Verify objects are uploaded to the target container/prefix and the changefeed continues running over time.

Questions

Will it cause performance regression or break compatibility?

No expected regression; existing SAS-based configs remain supported.

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

N/A

Release note

Support Azure Managed Identity authentication for azblob sinks and avoid potential hangs during cloud storage uploads.

@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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 13, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @wlwilliamx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant upgrade of the Azure SDK and related authentication libraries to enable robust support for Managed Identity. Beyond the Azure-specific updates, it also includes a comprehensive refresh of various other Go module dependencies, ensuring the project benefits from the latest features, performance improvements, and security patches across its entire dependency tree.

Highlights

  • Azure SDK Update: The core Azure SDK (github.com/Azure/azure-sdk-for-go/sdk/azcore) has been updated from v1.16.0 to v1.20.0, and the Azure Identity SDK (github.com/Azure/azure-sdk-for-go/sdk/azidentity) from v1.7.0 to v1.10.1 to support managed identity.
  • Authentication Library Update: The Microsoft Authentication Library for Go (github.com/AzureAD/microsoft-authentication-library-for-go) has been upgraded from v1.2.2 to v1.4.2.
  • General Dependency Upgrades: Numerous other Go module dependencies have been updated to their latest versions, including goccy/go-json, pierrec/lz4/v4, pingcap/kvproto, pingcap/tidb, stretchr/testify, tikv/client-go/v2, google.golang.org/grpc, and various golang.org/x packages, ensuring overall project health and compatibility.
  • New Dependencies: New indirect dependencies github.com/JohnCGriffin/overflow and github.com/spf13/afero have been introduced as part of the dependency resolution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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, titled 'feat(azure): update azure sdk to support managed identity', also includes a large number of dependency updates that go far beyond the stated scope. Most notably, it appears that updating pingcap/tidb and related dependencies has transitively caused major version upgrades for critical libraries like Apache Arrow (from v12 to v18) and the removal of xitongsys/parquet-go.

These are significant, high-risk changes that are not documented in the pull request description. Major dependency upgrades can introduce subtle bugs, performance regressions, or breaking API changes that are hard to catch without dedicated testing.

To manage risk and ensure a focused review, I strongly recommend splitting this pull request:

  1. A PR that only updates the Azure SDK and its direct dependencies to support managed identity.
  2. A separate PR for the pingcap/tidb ecosystem update. This PR must include a detailed description explaining the rationale, an impact analysis of the major version changes (especially for Arrow), and a summary of the testing performed to ensure correctness and performance are not affected.

Bundling these unrelated changes makes the review process difficult and significantly increases the risk of introducing unintended issues.

@wlwilliamx
Copy link
Collaborator Author

/test all

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 15, 2026
@wlwilliamx wlwilliamx changed the title feat(azure): update azure sdk to support managed identity azure: support managed identity and fix a goroutine hang issue Jan 15, 2026
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 15, 2026
@@ -69,14 +69,14 @@ func getExternalStorage(
})
if err != nil {
retErr := errors.ErrFailToCreateExternalStorage.Wrap(errors.Trace(err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

just call errors.WrapError(ErrFailToCreateExternalStorage, err) is the correct usage

if err != nil {
retErr := errors.ErrFailToCreateExternalStorage.Wrap(errors.Trace(err))
return nil, retErr.GenWithStackByArgs("creating ExternalStorage for s3")
return nil, retErr.GenWithStackByArgs("creating ExternalStorage")
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

if cancelCreate != nil {
cancelCreate()
}
err = errors.ErrExternalStorageAPI.Wrap(err).GenWithStackByArgs("Create")
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

cancel()
}
if err != nil {
err = errors.ErrExternalStorageAPI.Wrap(err).GenWithStackByArgs("Close")
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

createCtx context.Context
}

func (w *blockingCreateCtxWriter) Write(_ context.Context, _ []byte) (int, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not also select on the passed in context ?

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 21, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, lidezhu

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:
  • OWNERS [3AceShowHand,lidezhu]

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 21, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 21, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-01-15 12:06:08.463694383 +0000 UTC m=+63596.077651229: ☑️ agreed by lidezhu.
  • 2026-01-21 10:20:04.529286021 +0000 UTC m=+575632.143242878: ☑️ agreed by 3AceShowHand.

@ti-chi-bot ti-chi-bot bot merged commit 8d1b1e1 into pingcap:master Jan 21, 2026
19 checks passed
a-cong pushed a commit to a-cong/ticdc that referenced this pull request Feb 2, 2026
@wlwilliamx wlwilliamx added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Mar 3, 2026
ti-chi-bot pushed a commit to ti-chi-bot/ticdc-1 that referenced this pull request Mar 3, 2026
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #4337.
But this PR has conflicts, please resolve them!

wlwilliamx added a commit to ti-chi-bot/ticdc-1 that referenced this pull request Mar 6, 2026
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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.

make TiCDC support managed identity for Azure

4 participants