Skip to content

perf(storage): attribute column cache admission and reconstruction - #30884

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
aunjgr:perf/column-cache-attribution
Oct 22, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
aunjgr:perf/column-cache-attribution

Conversation

@aunjgr

@aunjgr aunjgr commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #30849; umbrella #30838.

Approved versioned design.

What this PR does / why we need it:

Attribute repeated decoded-column work to reader write bypasses, cache admission decisions and column construction. Add fixed per-codec calls, successful decoded bytes and errors, plus memory-cache update outcomes. Counters aggregate per block, IOVector or column construction and reset with the existing CounterSet. Cache policy, capacity, decoding and ownership remain unchanged.

Make the existing HTML counter reporter load live atomic leaves without copying enclosing containers or reading atomic fields through reflect.IsZero. A concurrent writer/reporter regression test reproduced the old race; the complete perfcounter race suite passes with the fix.

Validation: full perfcounter, fileservice, objectio and readutil package tests; focused cache/constructor race coverage; cold versus hit reconstruction, threshold boundary, policy bypass, every admission rejection stage, codec errors and counter reset tests. Constructor microbenchmarks show ~79 ns extra for an uncompressed 16 KiB column (~8.6%) and ~1.6% for LZ4, with unchanged allocations. This is an attribution step, not a cache-policy optimization.

Comparison protocol: optimized SIMD builds, eight physical CPUs, a private retained SF10 native image, 32 GiB application limit including the image, no swap, and a 16 GiB CN SHARED memory cache verified from running-process metrics. Query cold warmups are excluded; CPU profiling is separate from latency. All query evidence uses main with #30880 merged. No dataset or query-result verification runs in benchmark scripts.

With the effective 16 GiB cache, three warm Q6 calls reconstruct 4.03 GiB in 75,516 LZ4 constructions; memory-cache reads/hits are 87,900/12,384, reader-policy bypasses and FileService policy skips are both 18,879, and no decoded-entry admission attempts or pressure skips occur in the measured window. Cache use is only ~260 MiB. Q10 similarly shows 21,279 reader-policy bypasses, 7.21 GiB reconstructed and ~859 MiB cache use. These counters distinguish policy bypass from insufficient cache capacity; changing that policy is follow-up work.

Separate CPU/PMU diagnostic (one process generation per variant, two warm query calls, excluded from the latency comparison): user instructions per call 18.188G → 18.309G, user cycles 6.476G → 6.406G. The recordings have no lost samples. This single diagnostic pair is not a significance test or a query speedup claim.

Isolated kernel microbenchmarks used the pre-#30880 main snapshot; that cast-only merge does not change the timed constructor, multiplication or SUM kernel closures. The retained-image query comparisons and profiles were rebuilt and rerun with #30880 included.

@aunjgr aunjgr added the severity/s0 Active / top priority for current sprint. Owner has committed to working on it now. label Oct 22, 2026
@aunjgr aunjgr self-assigned this Oct 22, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 83075e850d3613553db4ad8c6f6f5844f0872328

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-xupeng · review

Commit: 83075e850d3613553db4ad8c6f6f5844f0872328

Assessment: approve

Reviewed the complete 11-file delta, design, callers, ownership, error paths, concurrency, and tests. The attribution counters preserve existing cache behavior, and HTTP reporting reads live counters atomically. No actionable defect remains.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • Verified the frozen patch and unchanged source at the assigned HEAD. Preflight and repository native-provenance verification passed.

  • Full perfcounter, objectio, and readutil package tests passed, including all changed tests.

  • The complete perfcounter race suite and 100 concurrent-reporting repetitions passed.

  • Focused cache/constructor race tests, independent concurrent attribution probes, and 42 additional cache/shared-decode tests passed.

  • Sequential constructor controls retained identical allocations: 96 B/op and one allocation. Warm median overhead was 35 ns for uncompressed data and 79 ns for LZ4.

  • Commands, fingerprints, exit receipts, log hashes, and test selections were reconciled in /home/xupeng/.local/state/mo-bot/jobs/b812ebfcf442eac2800cad0d/attempt-1/validation-audit.json; final audit receipt checks/1792704165716470763-3.json exited successfully.

Limitations:

  • The full FileService suite timed out after 240 seconds in TestFuzzingDiskS3 while waiting on fsync. It is not claimed as passing; three opt-in OOM/RSS tests also skipped.

  • Performance checks were standalone constructor controls using CPU release artifacts with SIMSIMD=0, not SQL workload measurements. Author SF10/PMU claims lacked retained raw evidence and were not independently verified.

  • Full linked-issue bodies were absent from the frozen evidence; their broader scope was not inferred beyond the supplied PR and versioned design.

@mergify mergify Bot added the queued label Oct 22, 2026
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-22 21:24 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-22 22:01 UTC · at d1418abc9c14b3f4ad28bb07952b1f9f40aeba0c

This pull request spent 37 minutes 10 seconds in the queue, with no time running CI.

Reason

Pull request #30884 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/enhancement severity/s0 Active / top priority for current sprint. Owner has committed to working on it now. size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants