Skip to content

Conversation

@wk989898
Copy link
Collaborator

@wk989898 wk989898 commented Dec 2, 2025

What problem does this PR solve?

Issue Number: ref #442

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

@ti-chi-bot ti-chi-bot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Dec 2, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @wk989898, 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 modifies an existing integration test by adjusting a timing parameter. The change extends a sleep duration within the fail_over_ddl_mix test, likely to enhance its stability and reliability by providing more time for asynchronous operations to complete before subsequent test assertions.

Highlights

  • Integration Test Modification: The fail_over_ddl_mix integration test script (run.sh) has been updated.
  • Increased Sleep Duration: A sleep command within the test script was extended from 30 seconds to 60 seconds.
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.

@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 2, 2025
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 modifies an integration test by increasing a sleep duration, likely to fix a flaky test. While this might resolve an immediate issue, I've suggested a more robust approach that involves polling for a specific condition (changefeed checkpoint advancement) instead of a fixed wait. This will make the test more reliable and potentially more efficient.

kill -9 $NORMAL_TABLE_DDL_PID $DML_PID_1 $DML_PID_2 $DML_PID_3 $DML_PID_4 $DML_PID_5

sleep 30
sleep 60

Choose a reason for hiding this comment

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

medium

Increasing the sleep time can make the test more stable, but it's not a robust solution and it slows down the test execution. A better approach is to actively wait for the changefeed to replicate all data up to the point where DMLs were stopped. This can be achieved by polling the changefeed's checkpoint TSO until it surpasses the TSO captured after killing the DML processes. This makes the test both more reliable and potentially faster, as it waits only as long as necessary.

Suggested change
sleep 60
# Wait for replication to catch up before checking diff.
# This is more robust than a fixed sleep time.
current_tso=$(run_cdc_cli_tso_query ${UP_PD_HOST_1} ${UP_PD_PORT_1})
i=0
while [ $i -lt 60 ]; do
checkpoint_tso=$(cdc_cli_changefeed query -c "test" 2>&1 | grep -v "Command to ticdc" | jq '.checkpoint_tso')
if [[ "$checkpoint_tso" != "null" && "$checkpoint_tso" -ge "$current_tso" ]]; then
echo "Changefeed checkpoint ($checkpoint_tso) has passed target TSO ($current_tso)."
break
fi
sleep 2
i=$((i+1))
done
if [ $i -ge 60 ]; then
echo "Timed out waiting for changefeed checkpoint to advance."
cdc_cli_changefeed query -c "test"
exit 1
fi

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 2, 2025
kill -9 $NORMAL_TABLE_DDL_PID $DML_PID_1 $DML_PID_2 $DML_PID_3 $DML_PID_4 $DML_PID_5

sleep 30
sleep 60
Copy link
Collaborator

Choose a reason for hiding this comment

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

not the root cause, we need to find the root cause or a better way to avoid it failed

@ti-chi-bot ti-chi-bot bot removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 2, 2025
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 2, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongyunyan

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

The pull request process is described here

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 Dec 2, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 2, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-02 07:11:45.998583619 +0000 UTC m=+333850.812361191: ☑️ agreed by wlwilliamx.
  • 2025-12-02 07:28:38.615932536 +0000 UTC m=+334863.429710108: ✖️🔁 reset by wlwilliamx.
  • 2025-12-02 07:47:27.525711271 +0000 UTC m=+335992.339488843: ☑️ agreed by hongyunyan.

@hongyunyan
Copy link
Collaborator

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants