Repository navigation
Conversation
aljoscha
force-pushed
the
aljoscha/ddl-oid-occupancy
branch
from
December 2, 2026 14:21
04bb0bf to
4b7d4e2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #41319.
Motivation
OID allocation scans the durable catalog to reconstruct occupied OIDs, even when a DDL statement changes one object.
Description
Retain OID reference counts with the shared decoded durable state and overlay pending transaction diffs during allocation. Snapshot decoding and incremental replay maintain the same index. Reference counts preserve occupancy when multiple rows share an OID, and pending retractions permit reuse. Temporary OIDs remain caller-supplied exclusions.
This changes no persisted format, allocation order, DDL revalidation or publication barrier. Allocation visits pending transaction history rather than all committed rows.
Verification
Regression coverage compares allocation with a full transaction-view scan. It covers all six indexed collections, cross-collection occupancy, snapshot decoding and replay, pending replacements/deletions, operation boundaries, uniqueness failures, temporary exclusions, wraparound and abort.
Full CI passed at
4b7d4e275256, including both new regression tests.Performance
Comparison against parent
eb24935d, followed by a repeat of the baseline. Same ARM64 node and 2-CPU/16-GiB limits. Mixed 5k/10k/30k catalogs, tables/views/indexes, 1/8 clients, two clean 20-second repetitions per cell. Profiled repetitions are excluded. Both arms use verified stable configuration with periodic configuration sync disabled after initialization.The local cost falls: mean
commit/transact_optime is 30.3–40.5% lower across all 18 cells. Allocation frames fall from 127/6,009 to 1/5,670 workload samples. Source and profile review found no corresponding full-map clone in occupancy maintenance. Sample membership is not CPU time per DDL, and unresolved frames remain.End-to-end improvement is not demonstrated. Throughput is lower in 17/18 cells against the original baseline and 14/18 against its repeat. Each cell below shows throughput change versus original / repeated baseline:
All six 30k cells have worse throughput and CREATE/DROP p95 against both baselines. At 30k/table/c1, baseline → candidate → repeated baseline throughput is 7.66 → 4.96 → 7.23 statements/s. CREATE p95 is 213 → 506 → 219 ms. Process-wide persist CAS mean latency also rises and recovers: 11.12 → 29.35 → 10.89 ms. This does not distinguish a patch effect from workload or shared-system conditions.
There is one candidate deployment, not an independently replicated causal experiment. Baseline throughput itself varies by −11.4% to +12.7% across cells. CPU is partial-window whole-cgroup usage with overlapping attribution bounds. No memory or exact CRDB-call reduction is established. The repeat's 30k/index/c1/repetition2 lacks usable CPU/timer coverage and is not treated as zero.
Keep this PR draft pending investigation of the end-to-end slowdown. The allocator scan removal alone is not a reason to promote it.
Release notes
None.