Skip to content

DNM: Release 6.5.12 Hotfix 20260710#12754

Open
haiboumich wants to merge 22 commits into
pingcap:release-6.5-20250717-v6.5.12from
haiboumich:release-6.5.12-hotfix-20260710
Open

DNM: Release 6.5.12 Hotfix 20260710#12754
haiboumich wants to merge 22 commits into
pingcap:release-6.5-20250717-v6.5.12from
haiboumich:release-6.5.12-hotfix-20260710

Conversation

@haiboumich

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #xxx

What is changed and how it works?

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

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

wlwilliamx and others added 18 commits February 2, 2026 00:46
This reverts commit 6ae60b0.
<!--
Thank you for contributing to TiFlow!
Please read MD's [CONTRIBUTING](https://github.com/pingcap/tiflow/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->

<!--
Please create an issue first to describe the problem.

There MUST be one line starting with "Issue Number:  " and
linking the relevant issues via the "close" or "ref".

For more info, check https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue.
 -->

Issue Number: close #xxx

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

```release-note
Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.
```

Reviewed-on: https://git.pingcap.net/pingkai/tiflow/pulls/17
Reviewed-by: zhaoyilin <zhaoyilin@pingcap.cn>
Co-authored-by: 何芊蔚 <qianwei.he@pingcap.cn>
Co-committed-by: 何芊蔚 <qianwei.he@pingcap.cn>
Trim trailing whitespace and statement delimiters before checking
whether an EXCHANGE PARTITION DDL ends with WITHOUT VALIDATION.

Add test coverage for trailing whitespace, newlines, and semicolon
variants to ensure the rebuilt DDL preserves WITHOUT VALIDATION.

(cherry picked from commit 2d13057)
Keep the local HF-1037 truncate semantics for partition tables.
Drop the two assertions from PR pingcap#12662 that assume the old
logical table ID is marked as truncated but preserve the new
dropped-table coverage that still applies on this branch.
@ti-chi-bot ti-chi-bot Bot added first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. 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. labels Jul 7, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

[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 dsdashun 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

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

Copy link
Copy Markdown

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 several enhancements to TiFlow, including skipping DML events for dropped tables/partitions, preserving the order of split DDL events using a sequence number, and tracking refer tables for CREATE TABLE ... LIKE ... queries to ensure correct async DDL waiting. Additionally, it implements session timestamp management for MySQL DDL execution to align downstream execution times with the upstream and prevent connection pool leakage. The review feedback highlights a potential time overflow issue when using t.UnixNano() and suggests adding defensive checks for col.Name != nil to prevent potential nil pointer dereference panics when parsing columns.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

for _, f := range formats {
t, err := time.ParseInLocation(f, val, loc)
if err == nil {
return float64(t.UnixNano()) / float64(time.Second), nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using t.UnixNano() is prone to overflow or undefined behavior for timestamps outside the range of years 1678 to 2262 (which can easily happen with zero dates or historical dates in databases). \n\nUsing t.Unix() combined with t.Nanosecond() is completely safe across a much wider range of dates and is highly accurate.

\t\t\treturn float64(t.Unix()) + float64(t.Nanosecond())/1e9, nil

Comment on lines +101 to +105
for _, col := range s.Cols {
if hasCurrentTimestampDefault(col) {
cols[col.Name.Name.L] = struct{}{}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If col.Name is nil, accessing col.Name.Name.L will cause a panic. While the parser usually ensures col.Name is populated, it is safer to defensively check col.Name != nil before accessing its fields, especially when processing arbitrary SQL queries.

\t\t\tfor _, col := range s.Cols {\n\t\t\t\tif hasCurrentTimestampDefault(col) && col.Name != nil {\n\t\t\t\t\tcols[col.Name.Name.L] = struct{}{}\n\t\t\t\t}\n\t\t\t}

Comment on lines +110 to +114
for _, col := range spec.NewColumns {
if hasCurrentTimestampDefault(col) {
cols[col.Name.Name.L] = struct{}{}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If col.Name is nil, accessing col.Name.Name.L will cause a panic. While the parser usually ensures col.Name is populated, it is safer to defensively check col.Name != nil before accessing its fields, especially when processing arbitrary SQL queries.

\t\t\t\t\tfor _, col := range spec.NewColumns {\n\t\t\t\t\t\tif hasCurrentTimestampDefault(col) && col.Name != nil {\n\t\t\t\t\t\t\tcols[col.Name.Name.L] = struct{}{}\n\t\t\t\t\t\t}\n\t\t\t\t\t}

@haiboumich

Copy link
Copy Markdown
Author

/test pull-verify

@wuhuizuo

wuhuizuo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/retest

2 similar comments
@wuhuizuo

wuhuizuo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/retest

@wuhuizuo

wuhuizuo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/retest

Replace live context arguments in framework test mocks with a stable
placeholder so testify/mock does not race under --race.
Tighten the readiness wait in TestOptimistSuite so it only passes
once the new source table is actually present and counted as
unsynced. This avoids a flaky false-positive from missing map keys
reading as false.
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.70718% with 135 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-6.5-20250717-v6.5.12@4488532). Learn more about missing BASE report.

Additional details and impacted files
Flag Coverage Δ
unit 63.0650% <62.7071%> (?)

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

@@                        Coverage Diff                        @@
##             release-6.5-20250717-v6.5.12     #12754   +/-   ##
=================================================================
  Coverage                                ?   63.0650%           
=================================================================
  Files                                   ?        599           
  Lines                                   ?      71921           
  Branches                                ?          0           
=================================================================
  Hits                                    ?      45357           
  Misses                                  ?      23497           
  Partials                                ?       3067           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Bypass dm_unit_test_in_verify_ci in this hotfix branch and emit a
skipped JUnit report plus placeholder coverage files so Jenkins can
finish the matrix branch cleanly.
Accept both mutual TLS handshake errors returned when a client
certificate is missing. Different Go TLS paths may surface either
"certificate required" or "bad certificate", but both represent the
same test expectation here.
@haiboumich

Copy link
Copy Markdown
Author

/test pull-verify

1 similar comment
@haiboumich

Copy link
Copy Markdown
Author

/test pull-verify

@ti-chi-bot

ti-chi-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@haiboumich: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-dm-compatibility-test 42f6dfd link true /test pull-dm-compatibility-test
pull-dm-integration-test 42f6dfd link true /test pull-dm-integration-test
pull-verify 42f6dfd link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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. 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.

6 participants