Skip to content

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #60514

What problem does this PR solve?

Issue Number: close #60567

Problem Summary:

What changed and how does it work?

Based on the flaky test results, sometimes the column status is missing, and other times it’s uninitialized.

This status is generated from here:

if recordForTbl.ColAndIdxStatus != nil && recordForTbl.ColAndIdxStatus.(*statistics.ColAndIdxExistenceMap).HasAnalyzed(id, isIndex) {

The root cause is that sometimes the DDL notifier handles the CREATE TABLE DDL event, which triggers the initialization of statistics histograms for all columns, resulting in the column status being uninitialized. However, if the DDL notifier hasn’t processed the event yet, the column status remains missing.

Since DDL events are handled asynchronously and this is an integration test, there’s no reliable way to stabilize the test by forcing the DDL events to be processed in time.

In this PR, I use the ANALYZE command to explicitly create histogram metadata for all columns, ensuring consistent behavior for the test.

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

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Apr 15, 2025
Copy link
Member

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

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

Thanks! :shipit:

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 15, 2025
Copy link

ti-chi-bot bot commented Apr 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Rustin170506, winoros

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 [Rustin170506,winoros]

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 15, 2025
Copy link

ti-chi-bot bot commented Apr 15, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-15 10:40:18.875263147 +0000 UTC m=+2771312.559499243: ☑️ agreed by Rustin170506.
  • 2025-04-15 10:45:31.281453046 +0000 UTC m=+2771624.965689139: ☑️ agreed by winoros.

Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-8.5@9fc6e57). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #60584   +/-   ##
================================================
  Coverage               ?   57.5174%           
================================================
  Files                  ?       1770           
  Lines                  ?     628747           
  Branches               ?          0           
================================================
  Hits                   ?     361639           
  Misses                 ?     242549           
  Partials               ?      24559           
Flag Coverage Δ
integration 38.0619% <ø> (?)
unit 72.6788% <ø> (?)

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

Components Coverage Δ
dumpling 52.8711% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 62.9823% <0.0000%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@0xPoe
Copy link
Member

0xPoe commented Apr 15, 2025

/retest

@fixdb
Copy link
Contributor

fixdb commented Apr 16, 2025

/retest

@ti-chi-bot ti-chi-bot bot merged commit a582b87 into pingcap:release-8.5 Apr 16, 2025
13 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants