Skip to content

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Nov 12, 2024

What problem does this PR solve?

Issue Number: close #56083

Problem Summary:

What changed and how does it work?

We will reuse the memory when to create stats. so we need to copy memory into JsonTbl. but we forget to copy.so it lead to break lower bound and upper bound.

pkg/statistics/handle/storage/json.go:91 (it will try to reuse the memory)-> GenJSONTableFromStats -> dumpJSONCol -> HistogramToProto (it forget to copy it)

image

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.

 fix bad lower bound and upper bound when to dump stats into json

修复在dump stats转json过程中,导致 hist 上下界数据受损的问题 

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 12, 2024
@hawkingrei
Copy link
Member Author

/retest

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.7383%. Comparing base (8832684) to head (70cda9a).
Report is 5 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57314        +/-   ##
================================================
+ Coverage   72.8973%   73.7383%   +0.8409%     
================================================
  Files          1672       1702        +30     
  Lines        461745     470122      +8377     
================================================
+ Hits         336600     346660     +10060     
+ Misses       104426     102140      -2286     
- Partials      20719      21322       +603     
Flag Coverage Δ
integration 46.2096% <100.0000%> (?)
unit 72.3302% <100.0000%> (+0.0582%) ⬆️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 45.1563% <ø> (+0.0214%) ⬆️

@hawkingrei hawkingrei changed the title statistics: try to fix bad lower bound and upper bound statistics: fix bad lower bound and upper bound when to dump stats into json Nov 13, 2024
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@ti-chi-bot ti-chi-bot bot added approved 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. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 13, 2024
@hawkingrei
Copy link
Member Author

/retest

Copy link

ti-chi-bot bot commented Nov 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, 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:

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 Nov 13, 2024
Copy link

ti-chi-bot bot commented Nov 13, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-13 08:08:29.598967335 +0000 UTC m=+430071.789836327: ☑️ agreed by winoros.
  • 2024-11-13 08:28:20.611609762 +0000 UTC m=+431262.802478755: ☑️ agreed by AilinKid.

@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/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 Nov 13, 2024
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 13, 2024
@ti-chi-bot ti-chi-bot bot merged commit 66cb425 into pingcap:master Nov 13, 2024
24 checks passed
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Nov 14, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

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-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to load plan replayer: ERROR 1292 (22007): Truncated incorrect DOUBLE value
4 participants