xy720 opened a new pull request, #67542:
URL: https://github.com/apache/doris/pull/67542
### What problem does this PR solve?
Problem Summary:
在存算分离架构中, CloudTabletStatMgr 尚未从 MetaService 拉到最新 tablet stats
的窗口内,OlapAnalysisTask 会拿到 rowCount=0 的过期快照,走进短路分支,直接把
count=0/ndv=0/min/max=null 的空 col stats
写进__internal_schema.column_statistics,污染 CBO 直到下一次成功 analyze 覆盖。
例子:
T1 : 创建新物化视图 mv_a 并刷新完成,
T2: 触发 ANALYZE,此时 CloudTabletStatMgr 尚未拉取最新rowcount,isEmptyTable 判空,写入空 col
stats
T3: 基于 mv_a 的下游 mv_b 开始刷新,上游 mv 的空 col stats 使估算 cardinality=1,join order
选错,产出 BROADCAST 大表 plan,MEM_LIMIT_EXCEEDED
T4: 手动重跑 analyze 覆盖空 col stats 才恢复
修复:
仅当所有 partition 的 visibleVersion 仍为 PARTITION_INIT_VERSION(真正从未 load 过)才允许写空
stats
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]