Repository navigation
perf: reduce checkpoint metadata allocations - #33098
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 61e4920c2887ed907e938d27ef86073f3c45d939
Assessment: approve
The reader uses valid block bounds to skip definite misses and retains the exact ID lookup for in-range IDs and unusable bounds. It reuses the existing column decoder and allocates range results to size while preserving row order and ownership.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
Validation:
-
All 168 test roots in the three owning packages passed under race detection. The concurrent subscriber case passed 100 repetitions, and the focused appendable-object replay test passed.
-
With cache admission disabled, an outside miss dropped from two backend reads to one. The baseline and candidate both used two reads for an in-range miss and four for a hit.
-
Three interleaved benchmark runs per variant used the same 8,192-row fixture. Allocated bytes fell from 31,696 to 18,064 per lookup at 64 matches and from 3,295,720 to 921,256 at 4,096 matches. Zero-match and one-match allocations were stable.
-
Verified the six-file frozen delta, gofmt, native inputs, and isolation preflight. Compared the unsigned bound layout and producer against the available 4.2.8 and hotfix source tags. Commands and receipts are matched to logs in validation-reconciliation.json.
Limitations:
- Local performance checks used synthetic checkpoints and disk-backed storage. Production RSS and GC, remote storage performance, and deployed-image rollout remain in scope for #33097.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #33097. This PR improves the current
mainreader; release rollout and production workload validation are tracked separately in the issue.What this PR does / why we need it:
For v13 checkpoint metadata, use a valid table-ID block zone map to avoid reading the ID column when its bounds prove the requested table is absent. An ID inside the bounds still uses the existing exact lookup, so a gap does not trigger speculative reads of the large metadata columns. Reuse the header already loaded by the reader when reading the ID column; this avoids an additional backing-store request when the metadata cache does not admit the header.
Allocate filtered
TableRangeresults to their exact size in the existing conversion function. This removes repeated growth and copies while preserving row order, nil results, and owned object-stat values.On an 8,192-row synthetic checkpoint using the actual ObjectIO writer and reader, Go 1.27.1, and a warm memory cache:
BenchmarkCheckpointMetadataSelection.The 64-, 4,096-, and 8,192-match cases are dense synthetic stress cases, not measured production frequencies. Each metadata range represents a table/object-type run in a checkpoint data file; with sorted data, each file contributes at most one range per type. The actual request-weighted match count and outside-range miss rates, especially for alphaTask subscriptions, have not been measured.
On an isolated local MinIO server over HTTP, with the same synthetic checkpoint, an outside miss changed from 2 to 1 GET with an unprimed header and from 1 to 0 GET with a primed header. The in-range miss and matching cases kept the same GET and byte counts. These are loopback measurements, not remote-S3 or production replay measurements. The 4.2.9 release source already contains #32894's earlier selective-read fix; the deployed image and its allocation, GC and RSS effects are not established by this PR.
Validation:
-race:./pkg/objectio/ioutil,./pkg/vm/engine/ckputil,./pkg/vm/engine/tae/logtail; focusedlogtailreplaytests cover the existing appendable-object caller.mainmerge base, plus changed-file gofmt andgit diff --check.