Skip to content

*: update tidb dep#4289

Open
Leavrth wants to merge 2 commits intopingcap:masterfrom
Leavrth:upgrade_tidb_dep
Open

*: update tidb dep#4289
Leavrth wants to merge 2 commits intopingcap:masterfrom
Leavrth:upgrade_tidb_dep

Conversation

@Leavrth
Copy link

@Leavrth Leavrth commented Feb 27, 2026

What problem does this PR solve?

Issue Number: ref #4244

What is changed and how it works?

update tidb dep to support startAfter of listobjectV2 of s3

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

None

Summary by CodeRabbit

  • Improvements

    • Enhanced TLS ALPN negotiation to favor HTTP/2 for gRPC.
  • Refactor

    • Migrated many storage integrations to a new object-store API; several public-facing types and helpers now use the new storage/reader/writer abstractions.
    • Added a commit timestamp parameter to chunk decoding paths affecting checksum/decoding behavior.
  • Chores

    • Bumped Go toolchain to 1.25.6 and updated numerous dependencies.
  • Tests

    • Updated and added tests to align with the new storage abstractions and AWS v2 error handling.

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. release-note-none Denotes a PR that doesn't merit a release note. labels Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

📝 Walkthrough

Walkthrough

Updated Go toolchain to 1.25.6, migrated external storage usage from storage.ExternalStorage to storeapi.Storage (and related objstore/objectio types) across the codebase, embedded pdgc.GCStatesClient into several test mock structs, and tweaked gRPC/TLS ALPN and buffer-pool imports.

Changes

Cohort / File(s) Summary
Go toolchain & module files
README.md, deployments/integration-test.Dockerfile, deployments/next-gen-local-integration-test.Dockerfile, go.mod, tests/integration_tests/debezium01/go.mod, tools/check/go.mod, tools/workload/go.mod
Bump Go version from 1.25.51.25.6 in docs, Dockerfiles, and module files.
Global storage API migration
pkg/util/external_storage.go, pkg/util/external_storage_test.go, pkg/redo/*, pkg/sink/*, downstreamadapter/sink/*, cmd/storage-consumer/consumer.go, pkg/redo/writer/*, pkg/redo/reader/file.go, pkg/sink/cloudstorage/path.go, pkg/sink/kafka/claimcheck/claim_check.go
Replace legacy github.com/pingcap/tidb/br/pkg/storage usage with github.com/pingcap/tidb/pkg/objstore(/storeapi) and change types from storage.ExternalStoragestoreapi.Storage; update option types (WalkOption, WriterOption, ReaderOption), Create/Open/Walk calls, and many constructor/signature sites.
Tests & mocks adapting to storeapi/objectio
pkg/redo/writer/file/file_test.go, pkg/redo/writer/file/file_test.go, pkg/util/external_storage_test.go, pkg/redo/writer/file/file_test.go, pkg/redo/writer/file/file_test.go
Adjust test imports, mock types, and method signatures to new storeapi/objectio types; add AWSv2-specific error test.
GCStatesClient embedding in mocks
coordinator/coordinator_test.go, coordinator/ensure_gc_cleanup_async_test.go, coordinator/gccleaner/cleaner_test.go, pkg/txnutil/gc/gc_service_test.go
Add embedded pdgc.GCStatesClient field to multiple mock GC state clients to align mocks with the GCStatesClient interface.
gRPC/TLS & buffer-pool updates
logservice/logpuller/grpc_conn.go, pkg/security/credential.go, pkg/tcpserver/tcp_server.go
Switch buffer pool usage to mem.DefaultBufferPool() and update TLS/ALPN: set NextProtos to explicitly include "h2" (and "http/1.1" where applicable).
Event decoding change
pkg/common/event/chunk.go, pkg/common/event/mounter.go
Add commitTS parameter to rawKVToChunkV2 and propagate commit timestamp into V2 chunk decoding calls.
Misc import/path updates
pkg/sink/codec/common/ddl_test.go, pkg/sink/codec/simple/encoder_test.go, pkg/sink/mysql/mysql_writer_test.go, other small formatting edits
Update import path disttask/framework/handledxf/framework/handle and minor formatting/comment adjustments.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

lgtm, approved

Suggested reviewers

  • wk989898
  • lidezhu
  • asddongmen
  • flowbehappy

Poem

🐰 I hopped through modules, line by line,
I nudged storage types to a newer vine,
GC mocks now wear a client charm,
ALPN hums and buffers keep warm,
A tidy hop — code gardens align.

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is incomplete. Missing required issue number link, insufficient technical details, and unanswered critical questions. Provide a valid issue link (close/ref #XXXX), explain the technical changes in detail (how storeapi replaces ExternalStorage, reason for Go upgrade from 1.25.5 to 1.25.6), and answer whether there are compatibility impacts or documentation needs.
Title check ❓ Inconclusive The PR title ': update tidb dep' is vague and does not clearly summarize the main changes. The title uses an unclear scope indicator '' and abbreviated term 'dep' without specifying the nature or impact of the dependency update. Consider revising the title to be more specific and descriptive, such as 'Update TiDB dependency to new version and migrate storage interfaces to storeapi' or similar, capturing the primary changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@ti-chi-bot ti-chi-bot bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 27, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 primarily focuses on updating the project's core dependencies, most notably the Go language version and the tidb library. These updates necessitate widespread changes across the codebase, particularly in how external storage is managed and how gRPC connections are configured. The changes ensure compatibility with newer library versions and incorporate improved practices for buffer handling and protocol negotiation.

Highlights

  • Go Version Update: The project's Go language version has been upgraded from 1.25.5 to 1.25.6 across the main module and various integration test and tool modules.
  • TiDB Dependency Update and Storage API Refactoring: The tidb dependency has been updated, leading to significant refactoring of external storage-related code. Imports from github.com/pingcap/tidb/br/pkg/storage have been replaced with github.com/pingcap/tidb/pkg/objstore/storeapi and github.com/pingcap/tidb/pkg/objstore, affecting cloud storage sinks, redo logs, and utility functions.
  • Dependency Updates: Numerous direct and indirect Go module dependencies have been updated, including cloud.google.com/go/storage, github.com/aws/aws-sdk-go, github.com/google/uuid, github.com/prometheus/client_golang, github.com/tikv/client-go/v2, and various golang.org/x and google.golang.org/grpc packages.
  • gRPC Configuration Enhancements: gRPC client connections now utilize mem.DefaultBufferPool() for improved buffer management and enforce ALPN 'h2' protocol negotiation for TLS connections, while TLS listeners prefer 'http/1.1' for non-gRPC traffic.
  • Row Codec Update: The rawKVToChunkV2 function signature in pkg/common/event/chunk.go and its calls in pkg/common/event/mounter.go have been updated to include a commitTS parameter, reflecting changes in row data decoding.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Updated the recommended GoLang version from 1.25.5 to 1.25.6 in installation instructions.
  • cmd/storage-consumer/consumer.go
    • Updated import path for storage from github.com/pingcap/tidb/br/pkg/storage to github.com/pingcap/tidb/pkg/objstore/storeapi.
    • Modified the type of externalStorage field from storage.ExternalStorage to storeapi.Storage.
    • Updated the type of opt in getNewFiles function from storage.WalkOption to storeapi.WalkOption.
  • coordinator/coordinator_test.go
    • Added pdgc.GCStatesClient embedding to mockGCStatesClient struct.
  • coordinator/ensure_gc_cleanup_async_test.go
    • Added pdgc.GCStatesClient embedding to blockingGCStatesClient struct.
  • coordinator/gccleaner/cleaner_test.go
    • Added pdgc.GCStatesClient embedding to errorGCStatesClient and countingGCStatesClient structs.
  • deployments/integration-test.Dockerfile
    • Updated GOLANG_VERSION environment variable from 1.25.5 to 1.25.6.
  • deployments/next-gen-local-integration-test.Dockerfile
    • Updated GOLANG_VERSION environment variable from 1.25.5 to 1.25.6.
  • downstreamadapter/sink/cloudstorage/dml_writers.go
    • Updated import path for storage from github.com/pingcap/tidb/br/pkg/storage to github.com/pingcap/tidb/pkg/objstore/storeapi.
    • Modified the type of storage parameter in newDMLWriters function from storage.ExternalStorage to storeapi.Storage.
  • downstreamadapter/sink/cloudstorage/sink.go
    • Updated import path for storage from github.com/pingcap/tidb/br/pkg/storage to github.com/pingcap/tidb/pkg/objstore/storeapi.
    • Modified the type of storage field from storage.ExternalStorage to storeapi.Storage.
  • downstreamadapter/sink/cloudstorage/writer.go
    • Updated import path for storage from github.com/pingcap/tidb/br/pkg/storage to github.com/pingcap/tidb/pkg/objstore/storeapi.
    • Modified the type of storage field and parameter in newWriter function from storage.ExternalStorage to storeapi.Storage.
    • Updated the type of WriterOption in writeDataFile function from storage.WriterOption to storeapi.WriterOption.
  • downstreamadapter/sink/redo/meta.go
    • Updated import paths for objstore and storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of extStorage field from storage.ExternalStorage to storeapi.Storage.
    • Updated calls to storage.ParseRawURL to objstore.ParseRawURL.
  • go.mod
    • Updated Go version from 1.25.5 to 1.25.6.
    • Updated numerous direct and indirect dependencies, including cloud.google.com/go/storage, github.com/BurntSushi/toml, github.com/aws/aws-sdk-go, github.com/goccy/go-json, github.com/google/uuid, github.com/klauspost/compress, github.com/pierrec/lz4/v4, github.com/pingcap/kvproto, github.com/pingcap/tidb, github.com/pingcap/tiflow, github.com/prometheus/client_golang, github.com/tikv/client-go/v2, github.com/tikv/pd/client, and various golang.org/x and google.golang.org/grpc modules.
    • Removed explicit gRPC downgrade replacements.
  • logservice/logpuller/grpc_conn.go
    • Imported google.golang.org/grpc/mem.
    • Replaced experimental.WithRecvBufferPool(grpc.NewSharedBufferPool()) with experimental.WithBufferPool(mem.DefaultBufferPool()).
  • pkg/common/event/chunk.go
    • Modified the signature of rawKVToChunkV2 function to include a commitTS uint64 parameter.
  • pkg/common/event/mounter.go
    • Updated calls to m.rawKVToChunkV2 to pass the commitTS parameter.
  • pkg/config/consistent.go
    • Updated import path for objstore from github.com/pingcap/tidb/br/pkg/storage.
    • Updated call to storage.ParseRawURL to objstore.ParseRawURL.
  • pkg/redo/config.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the return type of InitExternalStorage and initExternalStorageForTest functions from storage.ExternalStorage to storeapi.Storage.
  • pkg/redo/config_test.go
    • Updated import path for objstore from github.com/pingcap/tidb/br/pkg/storage.
    • Updated call to storage.ParseRawURL to objstore.ParseRawURL.
  • pkg/redo/reader/file.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of extStorage parameter in selectDownLoadFile and sortAndWriteFile functions from storage.ExternalStorage to storeapi.Storage.
    • Updated the type of WalkOption in selectDownLoadFile function from storage.WalkOption to storeapi.WalkOption.
  • pkg/redo/writer/factory/factory.go
    • Updated import path for objstore from github.com/pingcap/tidb/br/pkg/storage.
    • Updated call to storage.ParseRawURL to objstore.ParseRawURL.
  • pkg/redo/writer/file/file.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field and extStorage variable from storage.ExternalStorage to storeapi.Storage.
  • pkg/redo/writer/file/file_test.go
    • Updated import paths for objstore, mockobjstore, and storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Updated call to storage.New to objstore.New and its options type to storeapi.Options.
    • Modified the type of mockStorage from mockstorage.NewMockExternalStorage to mockstorage.NewMockStorage.
  • pkg/redo/writer/memory/file_worker.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of extStorage field and parameter in newFileWorkerGroup function from storage.ExternalStorage to storeapi.Storage.
    • Updated the type of WriterOption in multiPartUpload function from storage.WriterOption to storeapi.WriterOption.
  • pkg/security/credential.go
    • Added logic to clone TLS config and set NextProtos to ["h2"] for gRPC client connections, ensuring HTTP/2 over TLS.
  • pkg/sink/cloudstorage/path.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field and parameter in NewFilePathGenerator function from storage.ExternalStorage to storeapi.Storage.
    • Updated the type of WalkOption in CheckOrWriteSchema and RemoveExpiredFiles functions from storage.WalkOption to storeapi.WalkOption.
  • pkg/sink/codec/canal/canal_json_decoder.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field and externalStorage variable from storage.ExternalStorage to storeapi.Storage.
  • pkg/sink/codec/common/ddl_test.go
    • Updated import path for handle from github.com/pingcap/tidb/pkg/disttask/framework/handle to github.com/pingcap/tidb/pkg/dxf/framework/handle.
  • pkg/sink/codec/open/decoder.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field and externalStorage variable from storage.ExternalStorage to storeapi.Storage.
  • pkg/sink/codec/simple/decoder.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field and externalStorage variable from storage.ExternalStorage to storeapi.Storage.
  • pkg/sink/codec/simple/encoder_test.go
    • Updated import path for handle from github.com/pingcap/tidb/pkg/disttask/framework/handle to github.com/pingcap/tidb/pkg/dxf/framework/handle.
  • pkg/sink/kafka/claimcheck/claim_check.go
    • Updated import path for storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the type of storage field from storage.ExternalStorage to storeapi.Storage.
  • pkg/sink/mysql/mysql_writer_test.go
    • Updated import path for handle from github.com/pingcap/tidb/pkg/disttask/framework/handle to github.com/pingcap/tidb/pkg/dxf/framework/handle.
  • pkg/tcpserver/tcp_server.go
    • Modified ALPN negotiation for TLS listener to prefer http/1.1 then h2.
  • pkg/txnutil/gc/gc_service_test.go
    • Added pdgc.GCStatesClient embedding to mockGCStatesClient struct.
  • pkg/util/external_storage.go
    • Updated import paths for objstore, objectio, and storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the return type of GetExternalStorageWithDefaultTimeout, getExternalStorage, and getExternalStorageFromURI functions from storage.ExternalStorage to storeapi.Storage.
    • Updated the retryerWithLog struct and its methods to align with aws-sdk-go-v2 retryer interfaces.
    • Modified the extStorageWithTimeout struct to embed storeapi.Storage instead of storage.ExternalStorage and updated its methods accordingly.
    • Modified the readerWithCancel struct to embed objectio.Reader instead of storage.ExternalFileReader.
    • Modified the writerWithCancelAndTimeout struct to embed objectio.Writer instead of storage.ExternalFileWriter.
  • pkg/util/external_storage_test.go
    • Updated import paths for objectio and storeapi from github.com/pingcap/tidb/br/pkg/storage.
    • Modified the mockExternalStorage struct to embed storeapi.Storage.
    • Updated the Open method signature in mockExternalStorage to return objectio.Reader and accept storeapi.ReaderOption.
    • Modified extStorageWithTimeout initialization to use Storage field.
    • Modified mockCreateExternalStorage struct to embed storeapi.Storage and its Create method to return objectio.Writer and accept storeapi.WriterOption.
  • tests/integration_tests/debezium01/go.mod
    • Updated Go version from 1.25.5 to 1.25.6.
  • tools/check/go.mod
    • Updated Go version from 1.25.5 to 1.25.6.
  • tools/workload/go.mod
    • Updated Go version from 1.25.5 to 1.25.6.
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 updates the TiDB dependency and other related dependencies. The changes primarily involve adapting to new APIs from the updated dependencies, especially the external storage API which moved from pingcap/tidb/br/pkg/storage to pingcap/tidb/pkg/objstore. The changes also include updates to the Go version, gRPC handling, and some DML/DDL decoding logic. The modifications appear to be correct and consistent with the dependency updates. The code migration to the new APIs seems to be thorough and correct across the codebase.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
downstreamadapter/sink/redo/meta.go (1)

319-323: ⚠️ Potential issue | 🔴 Critical

Move redo.FixLocalScheme(uri) after the error check to prevent nil dereference.

At line 320, redo.FixLocalScheme(uri) is called before checking the error from objstore.ParseRawURL at line 321. If parsing fails, uri will be nil, causing a panic when FixLocalScheme accesses uri.Scheme. Additionally, wrap the error with errors.Trace() per the coding guidelines for third-party library calls.

Fix
if m.extStorage == nil {
	uri, err := objstore.ParseRawURL(util.GetOrZero(m.cfg.Storage))
-	redo.FixLocalScheme(uri)
	if err != nil {
-		return err
+		return errors.Trace(err)
	}
+	redo.FixLocalScheme(uri)
	m.extStorage, err = redo.InitExternalStorage(ctx, *uri)
	if err != nil {
		return err
	}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@downstreamadapter/sink/redo/meta.go` around lines 319 - 323, Move the call to
redo.FixLocalScheme(uri) so it runs after checking the error returned by
objstore.ParseRawURL(util.GetOrZero(m.cfg.Storage)) to avoid a nil dereference;
specifically, call objstore.ParseRawURL first, check if err != nil and return
errors.Trace(err), then call redo.FixLocalScheme(uri). Ensure the returned error
from ParseRawURL is wrapped with errors.Trace() per guidelines.
pkg/config/consistent.go (1)

114-118: ⚠️ Potential issue | 🟠 Major

Preserve parse error cause and mask storage URI.

Line 115-117: The error handling drops the original ParseRawURL error cause and exposes the raw storage URI in the error message, creating a credential/token leak risk. This violates the coding guideline requiring third-party errors to be wrapped with WrapError().

Replace with error wrapping that preserves the cause:

🔧 Proposed fix
-	uri, err := objstore.ParseRawURL(util.GetOrZero(c.Storage))
+	storageURI := util.GetOrZero(c.Storage)
+	uri, err := objstore.ParseRawURL(storageURI)
 	if err != nil {
-		return cerror.ErrInvalidReplicaConfig.GenWithStackByArgs(
-			fmt.Sprintf("invalid storage uri: %s", util.GetOrZero(c.Storage)))
+		return cerror.WrapError(
+			cerror.ErrInvalidReplicaConfig,
+			fmt.Errorf("invalid storage uri: %s: %w", util.MaskSensitiveDataInURI(storageURI), err),
+		)
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/config/consistent.go` around lines 114 - 118, The current error handling
for objstore.ParseRawURL drops the original parse error and prints the raw
storage URI; instead wrap the original err using WrapError (preserving the
cause) and avoid leaking credentials by masking the URI (e.g., do not include
util.GetOrZero(c.Storage) verbatim). Update the error return for ParseRawURL
failures around objstore.ParseRawURL/util.GetOrZero to call WrapError(err,
cerror.ErrInvalidReplicaConfig) (or use the project WrapError helper) and
produce a safe message that masks the storage URI (like
"<redacted-storage-uri>") while preserving the original err as the cause.
🧹 Nitpick comments (1)
deployments/next-gen-local-integration-test.Dockerfile (1)

31-35: Pin the Go tarball checksum to improve supply-chain security.

Go 1.25.6 is available and the SHA256 checksum can be obtained from go.dev. Consider adding checksum verification: f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a

This ensures the downloaded artifact matches the official release and reduces risk from tampering or CDN issues.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deployments/next-gen-local-integration-test.Dockerfile` around lines 31 - 35,
Add SHA256 verification for the downloaded Go tarball: define a GOLANG_SHA256
variable (use the provided value
f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a) alongside
GOLANG_VERSION/GOLANG_DOWNLOAD_URL and update the RUN that downloads
golang.tar.gz to verify the checksum (e.g., echo "$GOLANG_SHA256  golang.tar.gz"
| sha256sum -c -) and abort the build on mismatch before extracting; update
references to GOLANG_DOWNLOAD_URL and GOLANG_VERSION where needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@downstreamadapter/sink/redo/meta.go`:
- Around line 98-107: The objstore.ParseRawURL call needs its error wrapped and
the subsequent "noop://" parse must not discard errors: change the first
ParseRawURL error return to return errors.Trace(err), and when handling the
blackhole case call objstore.ParseRawURL("noop://") into (newURI, err) and only
assign uri = newURI if err == nil; if parsing fails, return errors.Trace(err)
instead of silently keeping the stale uri; references: objstore.ParseRawURL,
util.GetOrZero, redo.FixLocalScheme, redo.IsBlackholeStorage, and use
errors.Trace(err) for wrapping.

In `@go.mod`:
- Around line 95-96: The go.mod replace rule for google.golang.org/grpc is
stale: the require block lists google.golang.org/grpc v1.77.0 but the replace
maps v1.67.1 => v1.65.0, so the replace has no effect; update the replace
directive to target v1.77.0 (e.g., replace google.golang.org/grpc v1.77.0 =>
<desired-version>) or remove the replace entry entirely if it's no longer
needed, ensuring the replace/require versions for google.golang.org/grpc are
consistent.
- Line 56: The go.mod currently pins github.com/pingcap/tidb to a vulnerable
commit (the require line containing github.com/pingcap/tidb
v1.1.0-beta.0.20260205093021-1eb3d0a8c7a9) — update the require entry for module
github.com/pingcap/tidb to v8.2.0 or later, remove any replace directives that
force the old revision, run `go mod tidy` to refresh go.sum, and ensure CI
passes; check for any code changes needed to accommodate TiDB v8.2.0 API changes
after updating the require in go.mod.

In `@logservice/logpuller/grpc_conn.go`:
- Line 30: The new import "google.golang.org/grpc/mem" and use of
experimental.WithBufferPool() require gRPC v1.66.0+ but the repo forces v1.65.0
via the go.mod replacement (google.golang.org/grpc v1.67.1 =>
google.golang.org/grpc v1.65.0); fix by either updating the go.mod replacement
to a gRPC version >= v1.66.0 (so the mem package and experimental.WithBufferPool
are available) OR revert the code in grpc_conn.go to the older buffer-pool API
(remove the mem import and replace experimental.WithBufferPool usage with the
pre-1.66 approach used previously in this codebase). Ensure you update only the
go.mod replacement or the grpc_conn.go references to mem and
experimental.WithBufferPool accordingly so imports and build align.

In `@pkg/redo/writer/factory/factory.go`:
- Around line 34-36: Wrap the error returned by objstore.ParseRawURL using
errors.Trace before returning and add the pingcap errors import; specifically,
in the block calling objstore.ParseRawURL(util.GetOrZero(lwCfg.Storage)) replace
the direct return of err with return nil, errors.Trace(err) and add an import
for "github.com/pingcap/errors" at the top of the file so the stack trace is
preserved.

---

Outside diff comments:
In `@downstreamadapter/sink/redo/meta.go`:
- Around line 319-323: Move the call to redo.FixLocalScheme(uri) so it runs
after checking the error returned by
objstore.ParseRawURL(util.GetOrZero(m.cfg.Storage)) to avoid a nil dereference;
specifically, call objstore.ParseRawURL first, check if err != nil and return
errors.Trace(err), then call redo.FixLocalScheme(uri). Ensure the returned error
from ParseRawURL is wrapped with errors.Trace() per guidelines.

In `@pkg/config/consistent.go`:
- Around line 114-118: The current error handling for objstore.ParseRawURL drops
the original parse error and prints the raw storage URI; instead wrap the
original err using WrapError (preserving the cause) and avoid leaking
credentials by masking the URI (e.g., do not include util.GetOrZero(c.Storage)
verbatim). Update the error return for ParseRawURL failures around
objstore.ParseRawURL/util.GetOrZero to call WrapError(err,
cerror.ErrInvalidReplicaConfig) (or use the project WrapError helper) and
produce a safe message that masks the storage URI (like
"<redacted-storage-uri>") while preserving the original err as the cause.

---

Nitpick comments:
In `@deployments/next-gen-local-integration-test.Dockerfile`:
- Around line 31-35: Add SHA256 verification for the downloaded Go tarball:
define a GOLANG_SHA256 variable (use the provided value
f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a) alongside
GOLANG_VERSION/GOLANG_DOWNLOAD_URL and update the RUN that downloads
golang.tar.gz to verify the checksum (e.g., echo "$GOLANG_SHA256  golang.tar.gz"
| sha256sum -c -) and abort the build on mismatch before extracting; update
references to GOLANG_DOWNLOAD_URL and GOLANG_VERSION where needed.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8e6236 and bdf8394.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (39)
  • README.md
  • cmd/storage-consumer/consumer.go
  • coordinator/coordinator_test.go
  • coordinator/ensure_gc_cleanup_async_test.go
  • coordinator/gccleaner/cleaner_test.go
  • deployments/integration-test.Dockerfile
  • deployments/next-gen-local-integration-test.Dockerfile
  • downstreamadapter/sink/cloudstorage/dml_writers.go
  • downstreamadapter/sink/cloudstorage/sink.go
  • downstreamadapter/sink/cloudstorage/writer.go
  • downstreamadapter/sink/redo/meta.go
  • go.mod
  • logservice/logpuller/grpc_conn.go
  • pkg/common/event/chunk.go
  • pkg/common/event/mounter.go
  • pkg/config/consistent.go
  • pkg/redo/config.go
  • pkg/redo/config_test.go
  • pkg/redo/reader/file.go
  • pkg/redo/writer/factory/factory.go
  • pkg/redo/writer/file/file.go
  • pkg/redo/writer/file/file_test.go
  • pkg/redo/writer/memory/file_worker.go
  • pkg/security/credential.go
  • pkg/sink/cloudstorage/path.go
  • pkg/sink/codec/canal/canal_json_decoder.go
  • pkg/sink/codec/common/ddl_test.go
  • pkg/sink/codec/open/decoder.go
  • pkg/sink/codec/simple/decoder.go
  • pkg/sink/codec/simple/encoder_test.go
  • pkg/sink/kafka/claimcheck/claim_check.go
  • pkg/sink/mysql/mysql_writer_test.go
  • pkg/tcpserver/tcp_server.go
  • pkg/txnutil/gc/gc_service_test.go
  • pkg/util/external_storage.go
  • pkg/util/external_storage_test.go
  • tests/integration_tests/debezium01/go.mod
  • tools/check/go.mod
  • tools/workload/go.mod

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
go.mod (1)

57-57: ⚠️ Potential issue | 🔴 Critical

Blocker: pinned TiDB revision is flagged with critical advisories.

Line 57 still pins github.com/pingcap/tidb v1.1.0-beta.0.20260205093021-1eb3d0a8c7a9, which OSV flags (GHSA-7fxj-fr3v-r9gj, GHSA-9g6g-xqv5-8g5w / GO-2024-3284). Please move to a patched TiDB revision before merge.

#!/bin/bash
set -euo pipefail

# Verify currently pinned TiDB version in go.mod
awk '/github.com\/pingcap\/tidb / {print "go.mod line", NR ":", $0}' go.mod

# Query OSV for the pinned version
cat >/tmp/osv_tidb_query.json <<'JSON'
{
  "package": {"name": "github.com/pingcap/tidb", "ecosystem": "Go"},
  "version": "1.1.0-beta.0.20260205093021-1eb3d0a8c7a9"
}
JSON

curl -sS https://api.osv.dev/v1/query -d `@/tmp/osv_tidb_query.json` | jq '{vulns: [.vulns[]?.id]}'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` at line 57, The go.mod currently pins the vulnerable TiDB revision
"github.com/pingcap/tidb v1.1.0-beta.0.20260205093021-1eb3d0a8c7a9"; update
go.mod to reference a patched TiDB release/commit (replace that exact module
version string) by choosing a non-vulnerable tag or commit known to include the
fixes for GHSA-7fxj-fr3v-r9gj / GHSA-9g6g-xqv5-8g5w (verify via OSV or TiDB
release notes), run `go get github.com/pingcap/tidb@<patched-version>` and then
`go mod tidy` to update go.sum and vendor as needed, and re-run tests/build to
confirm no breakage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@go.mod`:
- Line 57: The go.mod currently pins the vulnerable TiDB revision
"github.com/pingcap/tidb v1.1.0-beta.0.20260205093021-1eb3d0a8c7a9"; update
go.mod to reference a patched TiDB release/commit (replace that exact module
version string) by choosing a non-vulnerable tag or commit known to include the
fixes for GHSA-7fxj-fr3v-r9gj / GHSA-9g6g-xqv5-8g5w (verify via OSV or TiDB
release notes), run `go get github.com/pingcap/tidb@<patched-version>` and then
`go mod tidy` to update go.sum and vendor as needed, and re-run tests/build to
confirm no breakage.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdf8394 and 1eb48c4.

📒 Files selected for processing (4)
  • go.mod
  • pkg/common/kv_entry.go
  • pkg/util/external_storage.go
  • pkg/util/external_storage_test.go

@Leavrth
Copy link
Author

Leavrth commented Feb 27, 2026

/test check-issue-triage-complete

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 27, 2026

@Leavrth: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test pull-build
/test pull-cdc-kafka-integration-heavy
/test pull-cdc-kafka-integration-light
/test pull-cdc-mysql-integration-heavy
/test pull-cdc-mysql-integration-light
/test pull-cdc-storage-integration-heavy
/test pull-cdc-storage-integration-light
/test pull-check
/test pull-error-log-review
/test pull-unit-test

The following commands are available to trigger optional jobs:

/test pull-build-next-gen
/test pull-cdc-kafka-integration-heavy-next-gen
/test pull-cdc-kafka-integration-light-next-gen
/test pull-cdc-mysql-integration-heavy-next-gen
/test pull-cdc-mysql-integration-light-next-gen
/test pull-cdc-pulsar-integration-heavy
/test pull-cdc-pulsar-integration-heavy-next-gen
/test pull-cdc-pulsar-integration-light
/test pull-cdc-pulsar-integration-light-next-gen
/test pull-cdc-storage-integration-heavy-next-gen
/test pull-cdc-storage-integration-light-next-gen
/test pull-unit-test-next-gen

Use /test all to run the following jobs that were automatically triggered:

pull-error-log-review
Details

In response to this:

/test check-issue-triage-complete

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 27, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: asddongmen
Once this PR has been reviewed and has the lgtm label, please assign flowbehappy 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

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 27, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-27 06:49:28.499431807 +0000 UTC m=+424041.014226417: ☑️ agreed by asddongmen.

@Leavrth
Copy link
Author

Leavrth commented Feb 27, 2026

/check-issue-triage-complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. 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.

2 participants