Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 分区表analyze在 merge global stats for test.win_ticket columns报错 illegal bucket order
【TiDB Version】7.5.0
【Bug Impact】
The partition table statistics are very slow and frequently fail when executing automatic partition statistics, specifically at the step “merge global stats for test.win_ticket columns,” with the error message “illegal bucket order.”
The cluster uses TiCDC for primary and standby replication, both running version 7.5. Each instance’s automatic analysis also shows the above error.
Manually running analyze win_ticket
also results in the same error. Detailed logs can be found in the attached Excel file.
mysql.analyze_jobs.xlsx (135.2 KB)
In the past few days, I have tested and adjusted the following parameters:
tidb_auto_analyze_partition_batch_size=100
global tidb_merge_partition_stats_concurrency=5
It should be this issue. It looks like it has already been fixed.
The comment specifically mentions:
analyze 8192 partitions table with single session job also encountered this error
This fits your usage scenario very well.
pingcap:release-7.5
← ti-chi-bot:cherry-pick-49312-to-release-7.5
opened 05:59AM - 11 Dec 23 UTC
This is an automated cherry-pick of #49312
<!--
Thank you for contributing t… o TiDB!
PR Title Format:
1. pkg [, pkg2, pkg3]: what's changed
2. *: what's changed
-->
### What problem does this PR solve?
<!--
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 #49023
Problem Summary:
### What changed and how does it work?
for better performance, we reuse memory to avoid allocating memory frequently. but bug will happen here. when we remove the empty bucket, use the non-empty bucket to overwrite it. but we cannot use the empty bucket to put into the pool. we wrongly put the non-empty bucket into the pool. it will lead to problems.
### Check List
Tests
- [x] Unit test
- [ ] Integration test
- [x] Manual test (add detailed scripts or steps below)
We have tested with problem data. it will not raise this error.
- [ ] 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](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.
```release-note
None
```
This fix has also been automated cherry-picked to 7.5.
Any x.x.0 version after 7.5 or 7.5.1 once released will include the fix for this issue.
Thank you, I’ll wait for the update.
Confirmed as bug48713. It was fixed in version 7.6.0.
Fixed an issue where an error might occur when concurrently merging global statistics of partitioned tables #48713 @hawkingrei
Tested in version 7.6.0 and did not encounter the illegal bucket order error.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.