Skip to content

feat(sql): add durable cluster-scoped UUID_SHORT() - #29805

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:feat/uuid-short
Oct 10, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:feat/uuid-short

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Feature
  • Improvement

Which issue(s) this PR fixes:

Implements only the UUID_SHORT() item in #25107; its other functions and syntax remain separate work. Follows the native UUID contract accepted in #29800. Companion bilingual documentation: https://github.com/matrixorigin/matrixone-doc/pull/374, tracking #29803.

What this PR does / why we need it:

Add volatile UUID_SHORT() returning BIGINT UNSIGNED, backed by the existing durable HAKeeper allocator. Reserve 8,192 IDs per refill for its fixed SQL namespace. This avoids inheriting the metadata allocation default of 100, which needed about 100 synchronous HAKeeper reservations to generate 10,000 SQL values.

Design and behavior

  • Append the function ID and use the existing volatility, unsigned vector and MySQL protocol machinery.
  • All CNs/accounts use one fixed keyed namespace. Existing HAKeeper state/snapshots own durability; the managed client owns its cached range, locking, refill coordination and retries.
  • SQL requests objectio.BlockMaxRows (8,192) through existing AllocateIDByKeyWithBatch. This is a fixed SQL policy, independent of AllocateIDBatch; other consumers retain their configured reservation sizes. Scalar statements reuse the same client cache, and sparse evaluations consume IDs only for selected rows.
  • Lazily create one child context per evaluated vector, retaining an earlier query deadline and otherwise limiting it to 30 seconds. Release it on exit; propagate allocation failures. Empty/ignored evaluations consume no IDs.
  • Reject zero/overflowing reservations before durable mutation or cache publication. Preserve successful request-ID replay and the existing refill wakeup on errors. Consolidate duplicated RSM allocation branches.

Successful values are unique within one preserved cluster allocation history. Gaps and out-of-order observation are allowed. Rollback, cancellation, lost replies and CN restart consume or abandon reserved IDs. A client can leave up to 8,191 unused IDs from its current successful reservation; repeated failures/restarts have no lifetime gap guarantee. A refill errors when the remaining durable range cannot fit the complete 8,192 batch, leaving the counter unchanged. Independent clusters, cloned allocator state and rewound snapshots can repeat values; this differs from MySQL's server/startup bit layout. Values are not secrets.

Upgrade CNs and all HAKeeper replicas before relying on the function and reservation guards. Preserve allocator state on rollback. The existing native UUIDv7 functions retain their accepted contract.

Performance evidence

Paired local SQL measurements use the same embedded two-CN topology, queries and data, with a one-call-site old-API overlay as the baseline. Query:

select count(distinct uuid_short())
from generate_series(1,10000) g;
Workload 100-ID default baseline 8,192-ID SQL reservation
10,000 IDs, cold CN client 419.8 ms 24.3–28.2 ms
10,000 IDs, warm cache 397.4 ms 4.8–5.5 ms
Four UPDATEs assigning UUID_SHORT to 128 rows each 41.2–45.7 ms 21.9–25.5 ms

Persistent prepared scalar calls and ordinary UPDATE controls were also exercised. Cold samples include first-query/CN initialization; timings vary on this shared host. These are local diagnostic results, not a cluster throughput or SLA claim. No wall-clock threshold is added to unit tests. The optimization itself adds 4 production lines and removes 3 test lines net; the complete feature is production +58 / tests +334.

Validation

Base / merge base: 8f48d6fac04bf612be65ed1b44477ef9b32cb88f. Final source: cff322740e48605b5853b6e5fd776d292a4aa359. Go 1.27.1, Linux/amd64 CPU, matching native libraries through mo-cgo-test, disk TMPDIR, GOMAXPROCS=4, package parallelism=2.

  • Full function package: normal PASS 6.500s; -race PASS 11.616s.
  • Existing/new allocation tests with -race: logservice PASS 1.914s, including explicit batch overriding configured batch and first three IDs sharing one RPC / fourth ID causing the second.
  • UUID_SHORT and native UUID public consumers with -race: DML PASS 11.941s. Retain two-CN, repeated/prepared expressions, rollback gaps, invalid-arity connection recovery, unsigned CTAS and text/prepared MaxUint64 controls.
  • Public normal QA PASS 8.958s: DEFAULT / INSERT SELECT / prepared INSERT / UPDATE, generated-column rejection, 16,386 concurrent IDs across two CNs, driver/native controls and the committed 8,193-row count/distinct boundary test in the existing fixture.
  • Workload controls pass, including all 128 affected rows and 128 distinct stored values after each UPDATE sequence. Error/zero/nil client, masks, parent cancellation and child-context cleanup remain covered.
  • Incremental SCA for the complete affected package closure: go vet PASS; configured golangci-lint 2.14.0 reports 0 issues; matching-Go molint has 0 new diagnostics. Its two existing unsafe-import diagnostics are byte-identical to base sources and separately recorded.
  • Reuse unchanged HAKeeper/logservice production owner evidence: full normal/race, snapshot/exhaustion/replay, terminal ranges, cancellation, refill competitors and fresh-client isolation. The revised client test has fresh normal/race evidence.

CI will run on the updated source; no pending CI result is counted as passed.

Reviewed design and QA

Design model: gpt-6.1-sol, reasoning xhigh, session 01a12212-268c-7693-a7de-2fa7a67020aa; design amendment SHA256 02fa7c9b27c83e5b85f30722685c945b5fbb520339cbec2fca5659f24f4457ad. Runtime model/effort selection was verified from the CLI session. The preserved allocator-history contract and existing owner guards follow the accepted base design; the complete approved SQL batch amendment is below.

Final independent overall review: gpt-6.1-sol / xhigh, session 01a12225-0a88-7392-bd26-6540a72565f3, PASS for the complete PR at cff322740e48605b5853b6e5fd776d292a4aa359, no unresolved material blocker. Review artifact SHA256 c8629b1e4d00f53c8d7bfee0204d65576dee2c8b345c53e5009f89210c8eb913. The original reservation-granularity P2 is closed; unchanged allocator evidence was checked against source hashes, and revised function/client/public tests have fresh evidence..

Approved SQL reservation design amendment

Design decision: PASS for a fixed SQL reservation of 8,192 IDs through the existing AllocateIDByKeyWithBatch API. Implement this on the same feat/uuid-short branch and PR #29805. This design supplements head 1e41c466aaa4d6f6ece9cb8ad12d507222374a99, based on 8f48d6fac04bf612be65ed1b44477ef9b32cb88f.

This phase read source and the supplied artifacts. It made no edits, ran no tests, and performed no remote mutations.

Root cause and invariant. The confirmed review evidence (recorded artifact) establishes that the executor’s per-row AllocateIDByKey call inherits the metadata allocation default of 100. Generating 10,000 IDs therefore requires approximately 100 synchronous HAKeeper reservations. The measured original → batch-10,000 overlay → original comparison was 405–428 ms → 4.9–5.8 ms → 426–428 ms, with correct results throughout. The separate counter namespace still shares HAKeeper RPC and Raft capacity.

The correction must amortize reservation work across ordinary SQL batches while retaining these invariants:

  • Every evaluated row consumes one positive uint64 ID; ignored rows and empty evaluations consume none.
  • One fixed namespace, __mo_sql_uuid_short, retains uniqueness within preserved allocator history.
  • HAKeeper owns durable range reservation; the managed client owns cache consumption, refill coordination, publication, retry, and waiting.
  • Errors propagate immediately. Cancellation, failed evaluation, rollback, and restart never reclaim IDs.
  • The executor retains its lazy, cancellable 30-second child context per evaluation and preserves unsigned results.

These retain the ownership and compatibility decisions in the accepted design (recorded artifact).

Exact correction. In func_builtin.go, add a named SQL policy constant beside the allocation key:

// Reserve one normal block of IDs to amortize SQL allocation refills.
const uuidShortAllocationBatchSize uint64 = objectio.BlockMaxRows

Replace only the allocation call:

id, err := client.AllocateIDByKeyWithBatch(
    ctx, uuidShortAllocationKey, uuidShortAllocationBatchSize,
)

Use objectio.BlockMaxRows directly: it is 8,192. options.DefaultBlockMaxRows aliases it, and generate_series also emits 8,192-row batches. This makes one ordinary block the justified SQL reservation lower bound and the fixed refill size. Do not grow it with evaluation length.

SQL owns this policy; managedHAKeeperClient remains the sole mechanism owner. Its cache is keyed by namespace, so cached ranges remain usable regardless of the batch argument that originally reserved them.

Policy challenge and accepted costs. A fixed 8,192 reservation is not a claim of universal optimality. It is the smallest direct policy aligned with the established execution unit and an explicit waste bound.

Using evaluation length alone would leave scalar calls making frequent reservations. Using max(8192, length) would allow unusually large or sparse vectors to reserve much larger ranges. Counting selected rows first adds work without improving cache reuse across evaluations. Larger fixed multiples need evidence beyond this finding.

The selected policy behaves as follows:

Situation Accepted behavior
Scalar-heavy workloads The first uncached call still needs one synchronous reservation. Later statements and evaluations sharing the client consume its existing range. A short-lived client producing one ID can abandon 8,191 cached IDs.
Empty or wholly masked evaluation No allocator or child context is acquired.
Sparse evaluation Only selected rows consume IDs. The refill size remains 8,192, independent of physical vector length.
Large vectors or multiple expressions Reservations follow total evaluated calls. For one cold client without errors or retries, N calls require ceil(N / 8192) refills. A 10,000-call workload requires two rather than 100.
Concurrent calls on one client Existing per-key locking and elected-refiller coordination remain authoritative. A vector does not receive exclusive ownership of a range.
Multiple CNs/clients Each existing client caches disjoint durable reservations. Startup and low utilization incur one reservation per participating cold client; no global call-order guarantee is added.

Memory remains constant per existing keyed cache entry: reserving 8,192 IDs does not materialize an 8,192-element buffer.

The explicit API overrides AllocateIDBatch for this SQL namespace, whether that configuration is smaller or larger than 8,192. Other consumers retain their configured behavior. This is a deliberate SQL policy change and should appear in the implementation description.

Gaps, exhaustion, and compatibility. After a successful refill consumes its first ID, at most 8,191 unused IDs remain cached per client. Restart or client replacement can abandon that remainder. Lost replies can abandon a complete 8,192-ID reservation per successful-but-unobserved proposal; retries and repeated restarts have no cumulative lifetime gap bound. Rollback and failed result publication add their existing consumed-ID gaps.

Preserve full-batch, fail-closed exhaustion. When fewer than 8,192 unreserved values remain, a refill errors even for a scalar request, leaving the durable counter unchanged. Accept the resulting unused tail of at most 8,191 values. Existing cached IDs may still be consumed, and a legal range ending at MaxUint64 remains valid. There is no smaller-batch fallback.

HAKeeper’s range guards and NextIDByKey persistence remain unchanged. The existing error convention and client publication guard remain unchanged. Old and new CNs reserving different positive batch sizes remain disjoint under the guarded owner. Existing rollout requirements for those guards still apply. Rollback must retain the advanced namespace. Native UUIDv7 is outside this correction.

Minimum regression architecture.

  1. Migrate the existing function mock. In uuid_short_test.go, implement AllocateIDByKeyWithBatch and give its callback the batch argument. Assert the namespace and exact named SQL batch size on every allocation. Retain the existing empty, mask, deadline, child-cancel, parent-cancel, nil-client, zero-result, injected-error, and full-uint64 oracles.

  2. Prove refill counts through the real managed client. Extend the existing batch-consumption suite in hakeeper_client_test.go with a named explicit-batch case: configure batch 1, request batch 3 through WithBatch, and allocate four IDs. Assert IDs 1–3 require exactly one RPC and ID 4 causes exactly the second RPC; assert both RPC batch arguments equal 3. Reuse sendCNAllocateIDFunc, restore it immediately through cleanup, and keep the case serialized. This independently proves explicit configuration override and full-range consumption; the function mock proves SQL supplies 8,192. Four allocations suffice.

  3. Add one bounded public workload. Extend TestUUIDShortSQL in its existing fixture with:

    select count(*), count(distinct uuid_short())
    from generate_series(1,8193) g;

    Assert both results are 8,193. This is one reservation quantum plus one, aggregated server-side, without a Go uniqueness loop. The client UT owns the exact refill-count oracle; the SQL assertion must not infer RPC counts or require contiguity. Retain the existing two-CN, prepared execution, rollback, connection reuse, unsigned protocol, and CTAS checks.

Previous DEFAULT, INSERT SELECT, UPDATE, generated-column, and concurrent correctness probes inform coverage. Their old executions do not certify the changed executor.

Risk-to-validation map.

Risk Required evidence
Wrong API, mask side effects, cancellation or unsigned-result regression Updated TestUUIDShort; fresh full function normal/race evidence.
Explicit batch ignored or early refill Four-ID real-client regression, normal/race. Reuse unchanged allocator concurrency and failure-path evidence.
Public execution across the reservation boundary Fresh TestUUIDShortSQL normal/race, including the aggregate above; applicable owning DML normal evidence for the final inputs.
Reservation throughput and scalar/update behavior Final-policy local SQL comparison and controls described below.
Durable uniqueness, terminal range, restart, refill synchronization Reuse the deep review’s complete HAKeeper/logservice normal/race evidence: those production owners remain unchanged. Run newly changed client tests separately.
Static correctness Incremental gofmt, vet, configured golangci, and molint over the final changed package closure relative to the supplied PR base. Preserve documented unchanged base diagnostics; require zero new diagnostics.

Use the established CGo setup for later validation. Relevant function and DML evidence becomes stale when their source or tests change; unchanged owner evidence does not.

For performance acceptance, record a bounded paired comparison of the original head and the final 8,192 policy using the same 10,000-row SQL query, topology, and build mode. Record cold-client and warm-cache conditions, correctness, and ordinary UUID controls. Include repeated scalar SELECT/prepared calls on a persistent connection, a few separate sessions, and a modest real-table UPDATE ... SET id = uuid_short() with affected-row and distinct-count checks. Investigate any unexplained scalar/update regression. The diagnostic 10,000 overlay is causal evidence, not final-policy validation.

Acceptance requires the deterministic API/refill oracles, fresh affected checks, zero new static findings, and a reproducible material SQL latency reduction consistent with fewer reservations. Neither 4.9–5.8 ms nor UUID control latency becomes a promised target. Ordinary tests receive no timing thresholds.

Blockers and suggestions. No unresolved design blocker remains. PR acceptance still requires the correction and final validation above; the confirmed performance finding remains open until then. Constant naming, comment wording, and broader cluster throughput characterization are subjective suggestions, not additional blockers. Changes to allocator ownership, reservation fallback, or the selected bound require a new design decision.

@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

Copy link
Copy Markdown
Contributor Author

Independent final QA: PASS

Model explicitly selected: gpt-6.1-sol, reasoning xhigh; reviewer session /root/uuid_remaining_review. Reviewed kernel 1e41c466aaa4d6f6ece9cb8ad12d507222374a99 and canonical docs e9925d232a38b63f2d6eaf172168fe3d658ce08a. No unresolved material blocker. Final review artifact SHA256: 94048ab2474b31df1366007854ac6262b04accd768cc5063eba46366e2ee2c79.

Kernel: matrixone#29805. Docs: matrixone-doc#374; merge docs after its kernel dependency.

Complete independent QA record

Independent review — remaining UUID delivery

Status: overall PASS. Kernel 1e41c466aaa4d6f6ece9cb8ad12d507222374a99; canonical docs e9925d232a38b63f2d6eaf172168fe3d658ce08a. No open confirmed correctness, lifecycle, compatibility, design-artifact or validation blocker remains. Approval is for the reviewed delivery scope; CI/merge/publication are separate and are not claimed complete.

Reviewed design: revision 2, SHA-256 6860578e1b0eeb6f25fd14efb2740d753a8a76ea9ef35a6171c1061fb224e065, design.md in this directory. The public function/distributed durable allocator boundary triggers the design gate; the recorded design PASS selects uniqueness within one preserved allocation history. Native UUIDv7 remains unchanged. Independent or rewound histories and mixed-version exhaustion guarantees remain outside that accepted contract.

Scope and change map

Read-only review against explicit bases: kernel /home/xupeng/.cache/mo-uuid-short HEAD/base/merge-base 8f48d6fac04bf612be65ed1b44477ef9b32cb88f; docs /home/xupeng/.cache/mo-uuid-doc-canonical HEAD/base/merge-base fb75c6b734b158860c7dc760551fe6763508f11d. No committed delta at review intake. Final kernel HEAD 1e41c466aaa4d6f6ece9cb8ad12d507222374a99 and docs HEAD e9925d232a38b63f2d6eaf172168fe3d658ce08a are clean; reviewer checked committed delivery diffs against the same bases and reread final added UT/public tests. Kernel scope includes every tracked dirty hunk plus untracked pkg/sql/plan/function/uuid_short_test.go and pkg/tests/dml/uuid_short_test.go. Docs scope is precisely four bilingual UUID source pages. Corrections made during review were reread; source files were not edited by this reviewer.

Closure Owners and consumers Risk Review result
Function registry and ID map function_id.go, function_id_test.go, list_builtIn.go; binder/folder and expression executor R2 public type/arity/volatility and persisted function IDs ID 587 is appended, historical IDs preserved, fixed zero-argument uint64 overload marked volatile. Existing ID stability map corrected. Folding and row execution consume CannotFold() consistently.
UUID_SHORT execution func_builtin.go, function UT; process-owned HAKeeper client and vector wrapper R3 shared allocator/cancellation, R2 masks/errors One fixed key, no SQL-provided keys or retained function state; ignored/empty rows acquire no allocator or child context; selected rows allocate separately. One child deadline/context per vector with immediate defer; zero and allocator errors stop the loop. uint64 stays unsigned.
Durable reservation hakeeper/rsm.go, RSM tests; store RPC result and snapshots/recovery R3 durable range/replay/upgrade Batch zero and overflow reject with Value zero before counter mutation. Replay of an existing keyed RequestID precedes capacity checks. Exact terminal reservations and snapshot replay retain existing encoding.
Reservation publication logservice/hakeeper_client.go, client tests; cached IDs, competing waiters and refill RPC R3 shared state/liveness Invalid first/range becomes an error before publication; every return closes the elected refill channel through the existing epilogue. A valid terminal batch emits MaxUint64 once and zero nextID means exhausted cache.
SQL/protocol integration shared two-CN embedded fixture, driver/prepared execution and information_schema R2/R3 public volatility, unsigned metadata, topology Tiny two-row/two-expression/repeated prepared calls cover independent evaluation and cross-CN uniqueness. Rollback/error followed by a query checks reuse and consumed IDs. MaxUint64 cast controls exercise unchanged text/binary unsigned renderer without altering the shared allocator.
Canonical bilingual docs four existing source pages, MyST/YAML/generated HTML R0 content with R2 source dependency Native v7/type/casts, deterministic boundaries, mixed value expressions and NULL/prefix swap coercion agree with accepted merged behavior. UUID_SHORT documents allocator history, gaps, restart and full upgrade requirement. Fixed v7 boundary/swap/UNION examples added during review; fractional datetime pin uses explicit DATETIME(3).

All changed hunks have been read. Correctness, contract, state, control, lifecycle, boundedness, compatibility, performance, delivery and test architecture lenses apply to the closures above. Auth/privilege changes, new background owners, new wire/disk fields, operator Reset/Call transitions, index-format/migration work, GPU/build-tag selection and independent algorithm dispatch are N/A because no corresponding owner or artifact changes. Existing UINT64 protocol paths were traced through column extraction, unsigned MySQL column metadata and text/binary encoders.

Ownership, wait and bound closure

Dimension Path and terminal owner Result
Q1 child context First selected row -> one WithTimeout(proc.Ctx, 30s) -> immediate defer cancel() on all subsequent exits Closed; no context for all ignored/empty vectors.
Q1 HAKeeper/vector Process owns HAKeeper lifetime; function borrows it. Expression executor/test owns result wrapper cleanup on success and error. Closed; function never closes the shared client.
Q2 refill wait Allocation mutex is released before RPC; non-refillers select on context cancellation or elected refill-channel close; invalid-reservation guard reaches identical error cleanup epilogue. Closed at existing owner.
Q2 transport/discovery Elected refiller uses existing bounded context/retry/transport owner; discovery RPC has its existing one-second local bound. No new retry owner or worker.
Q3 retained state Fixed SQL key adds one durable keyed entry and one existing client cache entry, independent of accounts/rows/queries. Vector result is bounded by selected input vector and existing allocation policy. Closed; no new cardinality source.
Generation/restart Durable reservation commit precedes publication; client restart abandons cached IDs and reserves ahead of persistent counter; snapshot preserves keyed counter. Correct for accepted preserved-history contract.

No namespace collision was found: existing consumers use index_key, ____server_conn_id, view admission keys and the NUL-prefixed bootstrap request namespace. The SQL key __mo_sql_uuid_short is distinct and fixed. No caller-controlled key is exposed.

Resource/test economy: no new fixture, background goroutine, function cache, counter, tombstone or durable request identity was added. Production work is constant-time range validation plus one existing allocator call and fixed-width append per selected row. No throughput/zero-allocation claim is made. FunctionResult[uint64].Append always returns nil after caller preallocation, so an artificial append-error injection cannot prove a reachable production behavior and is not required. Invalid-reservation waiters use the unchanged error epilogue already exercised by the existing refill-failure test; that composition does not require another heavy fixture.

Findings and corrections

No open confirmed production finding.

  1. The first implementation omitted UUID_SHORT: 587 and the updated end marker in predefinedFunids, causing the existing Test_funids to fail. Owner corrected the map; current diff reread confirms historical ID values are unchanged.
  2. Initial lazily assigned mutable cancel closure triggered go vet lostcancel. Owner replaced it with immediate defer cancel() at first child-context creation. Current code reread confirms one defer per vector.
  3. Initial CTAS test expected lowercase bigint unsigned; the service returns BIGINT UNSIGNED. This was a test-oracle failure, not a metadata defect. Owner corrected it and added immediate rows cleanup.
  4. Initial docs omitted the approved fixed v7 timestamp/swap/UNION examples and metadata coercion/UUID_SHORT differences. Both function pages now include the fixed controls and metadata entries. Final public example execution/build must match these additions.
  5. The first pinned fractional boundary example inherited the design literal CAST AS DATETIME, which is DATETIME(0) and rounds .678 to the next second. The public probe returned 019b7ca9-9070-7000-8000-000000000000 instead of the millisecond pin. Independent UTC arithmetic verifies 0x019b7ca98f2e and a 322ms rounding difference. Both pages and the probe now use DATETIME(3); this corrects an example precision error without changing the approved UUID semantics or ownership decisions.

Evidence audit

Evidence is reused from the implementation owner after inspecting the listed artifacts and receiving explicit terminal-status/mode/source-freshness handoff. No duplicate test processes were started by this reviewer.

  • function-race-final.log: full pkg/sql/plan/function package PASS 16.559s, terminal exit 0, including stable ID inventory and new function tests after ID/cancel corrections.
  • consumer-race.log: bounded existing/new allocator and public consumer selections PASS HAKeeper 1.168s, logservice 2.019s, DML 17.717s, terminal exit 0. Cancellation/refill/disjoint-batch tests are included at their existing owner boundary.
  • normal-final.log: final normal focused function/HAKeeper/logservice checks PASS 0.033s / 0.023s / 0.518s, terminal exit 0. Remaining valid-range ownership behavior reuses existing implementation and owner tests; no unrelated allocator or universal restart suite is required by the approved design.
  • public-race-corrected.log: final public selection PASS 10.074s, terminal exit 0, at final UUID_SHORT inputs. Owner confirms the selected run includes TestUUIDShortSQL after MaxUint64 text/prepared controls and the corrected DATETIME(3) doc pin, timezone, v7 swap and round-trip examples. One existing two-CN fixture; no new service startup mechanism.
  • doc-sql.log: earlier PASS 8.428s for nine native SQL controls plus existing native semantics. Reused only for unchanged native UUID behavior.
  • vet-final.log and vet-dml-final.log: owner confirms final terminal exit 0 after relevant cancel/SQL-test corrections.
  • golangci-final.log and golangci-dml-final.log: configured golangci-lint 2.14.0 reports 0 issues, terminal exit 0, including final public test additions.
  • molint-final.log plus molint-comparison.json: matching Go 1.27.1 checker run has zero new diagnostics. Two checkunsafe findings point to unchanged base imports in byte_like_wildcard_search.go and func_cast_integer_assignment.go; exact source hashes and prior base comparison are recorded. Reviewer also read both imports from base and verified no diff in either file. This is baseline debt, not a new blocker, and the log is not described as globally diagnostic-free.
  • CPU native artifacts were rebuilt by owner with make cgo; final linked tests used matching artifacts, Go 1.27.1, disk TMPDIR and GOMAXPROCS=4. No GPU claim.
  • lint-final.log: final scoped Markdown lint PASS, zero errors. sql-syntax-final.log: final English source parser PASS, 52 statements across two pages, including corrected datetime precision. Bilingual source SQL examples match; all four YAML/link checks are owner-attested PASS.
  • focused.log, uuid-short-ut.log, function-race.log, and public-race-final.log: earlier oracle/ID/fractional-precision failures are retained as diagnosis only and never treated as green.
  • Reviewer ran git diff --check in both trees, then kernel committed range, with exit 0. Both final working trees are clean; final two new kernel tests are tracked in the committed diff.
  • build.log: required make html-version VERSION=latest completed with terminal exit 0. Three pre-existing Chinese warnings refer only to unchanged release notes v22.0.2.0; English has zero warnings. Final source-sensitive build-zh-final.log and build-en-final.log both show build succeeded, terminal exit 0 and zero warnings.
  • render-check.log: owner inspected all four generated articles and recorded hashes. Reviewer independently parsed the actual four generated articles, verified native v7/type and CTAS content, fixed DATETIME(3)/boundary/swap values and UUID_SHORT on both function pages, and verified reciprocal UUID local links exist. render-review.json records final source and HTML hashes with PASS for all four pages.

Delivery artifact gate

The complete exact design revision 2 is included in the published kernel PR body, with a clearly marked DATETIME(3) example amendment; reviewer verified the full original design text is present and its SHA matches. Kernel PR: #29805 at reviewed head 1e41c466aaa4d6f6ece9cb8ad12d507222374a99. Companion docs PR body links the accessible kernel design and exact reviewed commits. The final QA record can be published as a concise PR comment/link by the authorized delivery owner. No source change is requested and no review blocker remains.

Delivery remains through non-default feature branches and review PRs. No remote mutation was performed by this reviewer. Issue closure must preserve the design's finite boundaries: #29803 canonical docs; #28382 accepted native contract decision; only UUID_SHORT for #25107; #27800 conditional P1 is not activated.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code review for cff322740e48605b5853b6e5fd776d292a4aa359: no blocking correctness, design, or performance findings; I recommend approval.

The earlier reservation-granularity performance finding is addressed by reserving 8,192 IDs for the fixed SQL namespace through the existing managed HAKeeper client. The durable allocator remains the authority for ranges and exhaustion; the client remains the owner of cache refill and waiter release. The fixed batch and its gap/exhaustion tradeoffs are documented. Paired local SQL measurements show the 10,000-ID query improving from about 420 ms cold / 397 ms warm to 24–28 ms cold / 4.8–5.5 ms warm. These are local measurements, not a cluster throughput guarantee.

One non-blocking cleanup: pkg/hakeeper/rsm.go:515's assignIDByKey has no production callers after this change; only TestAllocateIDByKeyCmd still calls it. Please consider making those two single-ID test reservations through Update(GetAllocateIDCmd(...)), preserving the existing expected IDs, and deleting the obsolete helper. This is P3 maintenance cleanup; I found no reachable production failure from it.

The final-source normal/race tests, two-CN public QA, and incremental static checks were reviewed and their source/diff fingerprints match this head. CI status is tracked separately from this code review.

This branch had an error being deployed

1 failed deployment
ci — 35fc2045 Deployed Oct 10, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/enhancement kind/feature size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants