columnar hub: share process-global ColumnarMetaCache across snaps - #11022
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesColumnar metadata cache sharing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CloudHelper
participant ColumnarReader
participant SharedSnapshot
participant SnapCtx
CloudHelper->>ColumnarReader: provide shared ColumnarMetaCache
ColumnarReader->>SharedSnapshot: pass shared ColumnarMetaCache
SharedSnapshot->>SnapCtx: pass shared ColumnarMetaCache
SharedSnapshot->>SnapCtx: pass shared cache to leader requests
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contrib/tiflash-columnar-hub/hub-runtime/src/cloud_helper.rs`:
- Around line 392-395: Update the process-global cache initialization using
SysQuota::memory_limit_in_bytes() so ColumnarMetaCache::new receives mem_limit
divided by 50 instead of 500, and revise the adjacent comment to document the
/50 capacity requirement.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3e7f74ff-b43f-4b84-8ac6-0353aa03ecd3
📒 Files selected for processing (1)
contrib/tiflash-columnar-hub/hub-runtime/src/cloud_helper.rs
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
a55ae19 to
d445149
Compare
|
/cherry-pick release-nextgen-202603 |
|
@JaySon-Huang: once the present PR merges, I will cherry-pick it on top of release-nextgen-202603 in the new PR and assign it to you. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@metrics/grafana/tiflash_summary.json`:
- Around line 9147-9161: Update the legendFormat values for the cache-hit and
cache-miss queries in panel 381 to include the grouped {{type}} label alongside
{{$additional_groupby}}. Apply the same legend change to the corresponding
queries in panels 382, 386, and 387; alternatively, remove type from each by
(...) clause only if it is not meaningful for those metrics.
- Around line 9611-9638: Update the histogram_quantile expressions in the
cache-hit panel to query the registered COLUMNAR_PREFETCH_CACHE_HIT_HISTOGRAM
metric name, including its bucket suffix, instead of
tiflash_proxy_kv_engine_columnar_prefetch_cache_hit_bucket. Apply the corrected
metric name consistently to refs A, B, and C while preserving their existing
filters and quantiles.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b95622e9-05f9-455b-bb7a-aa52d8177457
📒 Files selected for processing (1)
metrics/grafana/tiflash_summary.json
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JinheLin, yongman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test pull-integration-test |
1 similar comment
|
/test pull-integration-test |
|
@JaySon-Huang: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/test pull-integration-test |
1 similar comment
|
/test pull-integration-test |
|
@JaySon-Huang: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #11021
Problem Summary:
On disagg columnar CN Hub, each snap historically constructed its own
ColumnarMetaCacheviaColumnarMetaCache::default()(mem_limit/500per snap). Concurrent region snaps therefore held independent meta caches, amplifyingTableMetamemory even when keys(file_id, table_id)overlap. This diverges from WN's process-global meta cache.What is changed and how it works?
ColumnarMetaCacheonCloudHelperandclone()it into eachSnapCtx(same pattern ascolumnar_file_cache/ other process-global caches).SysQuota::memory_limit_in_bytes() / 500(~0.2% of process memory). Per-snapdefault()usedmem/500each.contrib/cloud-storage-engineweight/metrics changes; those can land separately.Check List
Tests
Manual test (lab CN
tiflash-5035/5036, tablewidecol.widecol_test_wide_500gb):reported_size_bytes≈ 1.2GB for ~5070 parses while last-instanceweighted_size/entriesonly reflected one snap (~7MiB / ~30).weighted≈cap, sameentrieson both CNs) and thrash (parse≫ unique files).Side effects
Documentation
Release note
Summary by CodeRabbit
Performance Improvements
Observability