Skip to content

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Feb 4, 2024

What problem does this PR solve?

Issue Number: close #47029

Problem Summary:

I finally found the root cause of this flacky test. It's easy to understand:

Success Path:

  1. Execute the statement
  2. Enable the failpoint
  3. Fetch the statement
    3.1. The rowContainerReader worker works in the background, and return the error specified by failpoint

Fail Path:

  1. Execute the statement
  2. The rowContainerReader worker works in the background. At this time, the failpoint is still not enabled.
  3. Enable the failpoint
  4. Fetch the result, but get no error.

The rowContainerReader worker can run right after Execute command, because it has a channel buffer whose size is twice as the chunk size. By default, it's just 2048 (equals the whole table size in this test 🤦). Therefore, another fix of this issue is to increase the table size from 2048 to a higher value. But I choose to enable failpoint before executing the statement.

What changed and how does it work?

Enable the failpoint before executing the statement, so that it'll definitely trigger the failpoint.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@YangKeao YangKeao requested a review from hawkingrei February 4, 2024 12:28
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 4, 2024
@YangKeao YangKeao changed the title server/tests/cursor: Fix cursor fetch error flacky test server/tests/cursor: fix cursor fetch error flacky test Feb 4, 2024
@YangKeao YangKeao requested a review from bb7133 February 4, 2024 12:29
@YangKeao YangKeao requested a review from Defined2014 February 4, 2024 12:33
Copy link

codecov bot commented Feb 4, 2024

Codecov Report

Merging #50969 (01ff83f) into master (ba77807) will increase coverage by 2.3746%.
Report is 3 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50969        +/-   ##
================================================
+ Coverage   70.4569%   72.8316%   +2.3746%     
================================================
  Files          1466       1466                
  Lines        434160     436625      +2465     
================================================
+ Hits         305896     318001     +12105     
+ Misses       108961      98684     -10277     
- Partials      19303      19940       +637     
Flag Coverage Δ
integration 49.2747% <ø> (?)
unit 70.4735% <ø> (+0.2290%) ⬆️

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

Components Coverage Δ
dumpling 54.2940% <ø> (ø)
parser ∅ <ø> (∅)
br 51.1373% <ø> (+5.4496%) ⬆️

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 4, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 4, 2024
Copy link

ti-chi-bot bot commented Feb 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-04 13:35:44.841303294 +0000 UTC m=+104670.408073176: ☑️ agreed by bb7133.
  • 2024-02-04 14:03:17.135295803 +0000 UTC m=+106322.702065693: ☑️ agreed by Defined2014.

Copy link

ti-chi-bot bot commented Feb 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, Defined2014, lcwangchao

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:
  • OWNERS [Defined2014,bb7133,lcwangchao]

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 merged commit e528b68 into pingcap:master Feb 4, 2024
@YangKeao YangKeao added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Jun 7, 2024
@YangKeao
Copy link
Member Author

YangKeao commented Jun 7, 2024

/run-cherry-picker

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 7, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #53875.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53876.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 7, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #53877.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 7, 2024
tangenta added a commit to ti-chi-bot/tidb that referenced this pull request Jun 12, 2024
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-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. 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.

flaky test TestCursorFetchErrorInFetch in server pkg
5 participants