You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scope: retire the previous data lease correctly when Shuffle installs replacement data; preserve retained views/shared varlen area; prepare fallible metadata/bitmap changes before publication; invalidate sorted metadata for non-monotonic selections. This issue is the W1 child, not completion of parent [Refactoring]: 收敛 Vector 所有权与语义状态,保留共享收益并保护普通执行路径 #31871 or W2/W3/W7b.
Evidence reviewed remotely: author reports vector/mergeutil suites, the real BETWEEN consumer regression, vector race tests and vet/lint passing at e70a3b3a. The later review reports 343 vector tests without skips and no confirmed actionable findings. The earlier ordinary-path slowdown was addressed by the uniform-metadata fast path; the later review's large-int64 performance result remains inconclusive (+3.30% median, paired interval -2.14% to +17.88%), not proof of equivalence or a current verified regression. Final PR-head checks now show CI Required, UT, SCA, coverage, shared build and COMPOSE/PROXY BVT success; upgrade and several other suites were skipped.
No local test was run by this handoff pass. Final merged-main reproduction, production SQL reachability and end-to-end performance remain unverified. Please retest borrowed/owned/legacy-alias vectors, retained-view lifetime and mpool zero balance; shared varlen area; data/NULL/grouping/sidecar allocation-failure rollback; ascending versus disordered selections and real BETWEEN results; uniform/mixed metadata and zero-allocation buffered controls. Recheck large-int64 throughput with controlled paired measurements, including sorted-consumer tradeoffs.
No current applicable verified counterexample or unfinished development follow-up was found after reviewing the issue and PR discussion. Handing this issue to @Ariznawlll for QA; leave it open until QA decides the outcome.
当前版本:官方 main@d61a7206c16b30baa4efc525eb6067c4364035aa;对照为修复前 b86ddaf607e6502dea4e84f4ce3ea446b2a7c649。本机 Apple M3/macOS arm64、Go 1.27.1、GOMAXPROCS=2;运行时机器还有其他工作负载,未做 CPU 独占或亲和性绑定。
测试不通过。最新 main 中借用内存释放、排序标记和失败回滚的本轮组件用例通过,但升序 Shuffle 的微基准相对修复前仍有重复可见的耗时增加,未满足本 issue 的普通路径性能验收;这不是端到端 SQL 或生产环境回退结论。
关键证据
当前版本:官方 main@dd2499cdcdf2722848851d4debca6cd6c66b4751;修复前对照 b86ddaf607e6502dea4e84f4ce3ea446b2a7c649。macOS / Apple Silicon,Go 1.27.1,GOMAXPROCS=2;机器未做 CPU 独占或亲和性绑定。当前 main 的 vector 相关源码相对此前测试的 d61a7206c16b30baa4efc525eb6067c4364035aa 无变更。
Happy / Unhappy case:最新 main 的 TestShuffleBorrowedDataRetiresOwner、TestShuffleVarlenSharedLeaseAndLegacyAlias、TestShuffleBorrowedLeaseLifecycle、TestShuffleSorted、借用数据及二进制字符串分配失败回滚用例各执行 3 次,通过。此前 完整验收评论 覆盖真实 BETWEEN 消费者和 race;本次不把先前结果当成新跑的测试。
QA re-handoff for W1 follow-up #32168, merged into main as 4bd71af013ab3bcd7480cbea0b21a6efe4e2966d. It folds ordering proof into gather and skips identity copy-back only when actual data and scratch do not overlap, preserving lease, sorted metadata and failure atomicity. The earlier ascending-Shuffle failure on dd2499c is the specific cost addressed by this later merge, not a test result for the new version.
Author reports vector/function tests, focused mergeutil tests, alias/byte-overlap boundaries and vet/lint passing. The shared-host 8192-row ascending component comparison improved 30.52%, not an end-to-end SQL result. A +0.72% small descending control signal remains inconclusive. Review used extracted-function probes and frozen-head CI without a new race run; reviewed head fec2852 differs from final head 2187126. This handoff run checked remote evidence only and ran no local tests or performance measurements.
Please verify borrowed/owned/legacy aliases, shared variable-length area, retained views, mpool cleanup, allocation rollback, real BETWEEN consumers, ascending/descending and identity overlap. Remeasure the original 8192-row case and small controls in a quiet paired setup. Nonidentity scratch/data overlap is not supported in-place gather. This handoff does not complete parent #31871 or W2/W3/W7b, and the issue remains open pending QA acceptance.
Regression and extended verification for #32016 (2026-11-05)
Verification Environment
Frozen latest origin/main at test start, 3820136ff2bdeb0b7f3136fd4a66a00b8d571f55, fix(plan): intersect BETWEEN selectivity with column domain (#32224). The verification worktree was clean and matched that commit.
Rebuilt the native service from this commit with Go 1.27.1, macOS arm64, Apple M2 Pro. Build log, binary version and runtime git_version() identified 3820136ff2.
Fresh topology of 2 CN / 1 TN / 1 Log service / Proxy, local disk file service, service GOMAXPROCS=4. Proxy 127.0.0.1:6001, CN1 127.0.0.1:16001 and CN2 127.0.0.1:16002 all connected and executed the SQL consumer smoke checks through PyMySQL text protocol.
Component tests exercised the Go API directly. Benchmarks used Go 1.27.1, GOMAXPROCS=2 and separately compiled test binaries. The historical comparison used clean b86ddaf607e6502dea4e84f4ce3ea446b2a7c649 with the identical current BenchmarkShuffle supplied through an external Go overlay. Product files remained clean.
What Was Covered
OK — Original borrowed int64 vector containing 4 rows followed by Shuffle([3,1]) produced [4,2], retired this vector's old lease responsibility, preserved the retained view's [1,2,3,4], released the underlying lease exactly once after the final owner and returned mpool usage to zero. TestShuffleBorrowedDataRetiresOwner passed.
OK — Owned storage, borrowed storage, legacy aliases, shared variable-length area, retained-view release order, buffered and unbuffered paths passed. Shared variable-length payload stayed readable until its remaining owner released it.
OK — Data, NULL/grouping bitmap, string metadata/sidecar and borrowed-area allocation failures passed rollback assertions in the complete vector suite. Failed operations preserved valid original data/ownership and released prepared allocations.
OK — Empty, singleton, increasing, repeated, gapped, identity and inverted selections passed sorted-property checks. Identity scratch aliases, offset/last-byte overlap, adjacent ranges, zero-length scratch and scratch growth passed their supported boundary tests.
OK — Real betweenImpl consumer checks passed after destructive reordering, including the original [false,true] result. Buffered variants and integer BETWEEN / variable-length PrefixEq controls matched independent scalar expectations. The full function package passed.
OK — Full vector race tests passed. The exact TestShuffleBorrowedLeaseLifecycle race test then passed 100 repetitions, covering retained-view release interleavings and reuse.
OK — The complete mergeutil consumer suite passed. Caller review found 20 non-random .Shuffle / .ShuffleWithBuf call expressions including forwarding wrappers. Monotonic selections preserve the existing sorted proof. In mergeutil, callers explicitly reestablish sorted status for the sort-key column and clear it for other columns after arbitrary sorting permutations.
OK — At each SQL endpoint, an 8,193-row descending sort/limit followed by BETWEEN returned (8193,false), (8192,true), (8191,true) and the filtered query returned IDs 8191,8192. Version checks, row counts and cleanup passed.
OK — Same-host alternating benchmark measurements completed 6 samples per version for each fixed buffered ascending/descending case at 64 and 8,192 elements. Each sample used 1s per case. All key measurements reported 0 B/op, 0 allocs/op.
OK — The full 24-cell allocation matrix per version covered fixed/variable-length data, buffered/unbuffered operation, both sizes and unsorted/ascending/descending states. Allocation bytes and counts matched exactly between versions. These 100ms samples were used for allocation checks only.
Not covered — Production SQL reachability of the exact borrowed-lease defect remains unestablished, as stated in the original issue. The SQL smoke checks do not establish that path. Live MySQL differential execution, end-to-end performance, CPU-exclusive/affinity-pinned benchmarking, TKE and a single SQL query spanning both CNs were outside this component acceptance.
Follow-up PR Optimize Shuffle ordering proof and identity copy #32168 merged as 4bd71af013ab3bcd7480cbea0b21a6efe4e2966d, Optimize Shuffle ordering proof and identity copy. It folds ordering proof into the gather and avoids identity copy-back only for non-overlapping data and scratch. Both commits are ancestors of the tested main. Performance follow-up
The previous approximately 40% ascending component slowdown was not reproduced after the follow-up. With the issue's original benchmark fixture, the 8,192-element ascending median changed from 4875.5 ns/op to 4749 ns/op, about -2.59%; descending changed from 4871.5 to 4846.5 ns/op. The 64-element ascending and descending medians changed from 84.74 to 49.53 ns/op and 84.465 to 56.865 ns/op respectively.
Measurements alternated versions in ABBA / BAAB / ABBA order. All task-owned builds, other tests and the test service had ended before the key timed samples. The desktop remained a shared OS host with background activity and no affinity pinning. These observations establish the scoped component result on this host, with no production throughput claim or attribution of every version difference to a single function.
The already documented general non-identity scratch/data overlap remains outside supported independent-scratch gather behavior. Identity overlap was directly tested. This acceptance covers W1 only; parent [Refactoring]: 收敛 Vector 所有权与语义状态,保留共享收益并保护普通执行路径 #31871 and W2/W3/W7b retain their own scope.
MOTR / BVT Coverage
Reused existing component tests in shuffle_ownership_regression_test.go, shuffle_sorted_test.go, allocation_account_test.go and the actual consumers in shuffle_between_regression_test.go. Complete vector, function and mergeutil suites passed with -count=1, along with full vector -race and the focused lifecycle repetitions. These runs reported no skipped tests.
Exact ownership and allocation-failure states are directly observable at the component API. Existing tests supply maintained coverage for those contracts. This run added no duplicate MOTR case or commit, and made no weekly MOTR PR change.
Native setup initially rejected a premature historical benchmark compile while its required native library was still building. After that build completed, benchmark compilation and all recorded benchmark runs succeeded. This was a setup ordering error, with no SQL or product assertion failure.
Independent compilation/preparation and component checks used bounded parallelism. Timed key benchmark runs were sequential, isolated from task-owned service/test work. The allocation-only matrix and the final focused race repetitions could overlap because timing from that matrix was outside the performance claim.
Final Conclusion
Fixed for the scoped W1 issue #32016 on 3820136ff2bdeb0b7f3136fd4a66a00b8d571f55. Original ownership and sorted-consumer assertions, supported overlap boundaries, allocation-failure atomicity, race checks and the previously blocking ascending microbenchmark passed this QA run.
Large-data regression is not required for this component contract. Required size-sensitive coverage was completed at 64 and 8,192 elements using the reported benchmark boundary; the ownership and sorted defects have deterministic witnesses of 4 and 3 rows. The three-endpoint SQL smoke used 8,193 rows. Arbitrary data enlargement or a TKE throughput workload would not strengthen these scoped component assertions.
Activity
Fix vector shuffle ownership and sorted metadata (#32020)
XuPeng-SH commentedon Nov 2, 2026
QA handoff for the scoped W1 fix (not acceptance).
cd40f4e15ca44b58c5e81ace48071ee54c483b4f(2026-11-02 18:24 UTC), final PR head08968d088eb211aaa9418ab358e9063a1e0debad.e70a3b3a. The later review reports 343 vector tests without skips and no confirmed actionable findings. The earlier ordinary-path slowdown was addressed by the uniform-metadata fast path; the later review's large-int64 performance result remains inconclusive (+3.30% median, paired interval -2.14% to +17.88%), not proof of equivalence or a current verified regression. Final PR-head checks now show CI Required, UT, SCA, coverage, shared build and COMPOSE/PROXY BVT success; upgrade and several other suites were skipped.Ariznawlll commentedon Nov 3, 2026
结论
测试不通过。原有的 lease 泄漏及 sorted 正确性问题在当前 main 的覆盖路径中未再复现,但升序选择的 Shuffle 组件微基准出现重复的时延回退,尚未满足本 issue 对普通路径性能的验收要求。该测量不是端到端查询或生产性能结论。
关键证据
main@d61a7206c16b30baa4efc525eb6067c4364035aa;对照为修复前b86ddaf607e6502dea4e84f4ce3ea446b2a7c649。本机 Apple M3/macOS arm64、Go 1.27.1、GOMAXPROCS=2;运行时机器还有其他工作负载,未做 CPU 独占或亲和性绑定。-race检查通过;借用 data/retained view、变长共享 area、legacy alias、失败注入和分配回滚等 Shuffle 覆盖三轮。修复前借用 int64 Shuffle 后Free仍留 16 字节,三轮复现;当前对应检查通过。真实 BETWEEN 消费者在修复前把[false,true]错算为[true,true],当前两种 Shuffle 路径均三轮通过。pkg/container/vector/shuffle_sorted_test.go的BenchmarkShuffle;修复前树仅加入同一 benchmark 测试代码,不修改产品代码。对n=8192/varlen=false/buffered=true/ascending,两版以 ABBA/BAAB/ABBA 顺序交替各运行 6 次,每次 1 秒:基线[6116,5598,6535,6032,5511,5446]ns/op,中位数 5815;当前[8280,8068,9926,8546,7994,7719]ns/op,中位数 8174,约 +40.6%。两版均为0 B/op、0 allocs/op。在先前独立三轮采样中,同一升序场景中位数 5852 → 7882 ns/op,方向一致;降序对照中位数 5252 → 5381 ns/op。非缓冲普通路径两版均为 1 次分配。preserveSortedAfterShuffle对原本标记 sorted 的向量遍历选择下标;它与升序场景中额外成本相符,但本次没有 profile,不能断言全部差异的归因。基准入口见 BenchmarkShuffle,可用go test ./pkg/container/vector -run '^$' -bench '^BenchmarkShuffle/n=8192/varlen=false/buffered=true/ascending$' -benchmem -benchtime=1s复测。待解决点
Ariznawlll commentedon Nov 3, 2026
结论
测试不通过。最新 main 中借用内存释放、排序标记和失败回滚的本轮组件用例通过,但升序 Shuffle 的微基准相对修复前仍有重复可见的耗时增加,未满足本 issue 的普通路径性能验收;这不是端到端 SQL 或生产环境回退结论。
关键证据
main@dd2499cdcdf2722848851d4debca6cd6c66b4751;修复前对照b86ddaf607e6502dea4e84f4ce3ea446b2a7c649。macOS / Apple Silicon,Go 1.27.1,GOMAXPROCS=2;机器未做 CPU 独占或亲和性绑定。当前 main 的 vector 相关源码相对此前测试的d61a7206c16b30baa4efc525eb6067c4364035aa无变更。TestShuffleBorrowedDataRetiresOwner、TestShuffleVarlenSharedLeaseAndLegacyAlias、TestShuffleBorrowedLeaseLifecycle、TestShuffleSorted、借用数据及二进制字符串分配失败回滚用例各执行 3 次,通过。此前 完整验收评论 覆盖真实 BETWEEN 消费者和 race;本次不把先前结果当成新跑的测试。BenchmarkShuffle/n=8192/varlen=false/buffered=true,两版按 ABBAABBA 交替运行各 4 次,每次每个方向 1 秒。升序修复前[5480,5284,5408,5321]ns/op,中位数 5364.5;当前[7562,8771,7517,7603]ns/op,中位数 7582.5,约 +41.3%。降序对照中位数 5138.5 → 5061.5 ns/op。两方向两版均为 0 B/op、0 allocs/op;方向与此前 6 轮对照一致。基准代码见 BenchmarkShuffle。待解决点
Optimize Shuffle ordering proof and identity copy (#32168)
XuPeng-SH commentedon Nov 4, 2026
QA re-handoff for W1 follow-up #32168, merged into main as
4bd71af013ab3bcd7480cbea0b21a6efe4e2966d. It folds ordering proof into gather and skips identity copy-back only when actual data and scratch do not overlap, preserving lease, sorted metadata and failure atomicity. The earlier ascending-Shuffle failure on dd2499c is the specific cost addressed by this later merge, not a test result for the new version.Author reports vector/function tests, focused mergeutil tests, alias/byte-overlap boundaries and vet/lint passing. The shared-host 8192-row ascending component comparison improved 30.52%, not an end-to-end SQL result. A +0.72% small descending control signal remains inconclusive. Review used extracted-function probes and frozen-head CI without a new race run; reviewed head fec2852 differs from final head 2187126. This handoff run checked remote evidence only and ran no local tests or performance measurements.
Please verify borrowed/owned/legacy aliases, shared variable-length area, retained views, mpool cleanup, allocation rollback, real BETWEEN consumers, ascending/descending and identity overlap. Remeasure the original 8192-row case and small controls in a quiet paired setup. Nonidentity scratch/data overlap is not supported in-place gather. This handoff does not complete parent #31871 or W2/W3/W7b, and the issue remains open pending QA acceptance.
slyunnn commentedon Nov 5, 2026
Regression and extended verification for #32016 (2026-11-05)
Verification Environment
origin/mainat test start,3820136ff2bdeb0b7f3136fd4a66a00b8d571f55,fix(plan): intersect BETWEEN selectivity with column domain (#32224). The verification worktree was clean and matched that commit.1.27.1, macOSarm64, Apple M2 Pro. Build log, binary version and runtimegit_version()identified3820136ff2.2 CN / 1 TN / 1 Log service / Proxy, local disk file service, serviceGOMAXPROCS=4. Proxy127.0.0.1:6001, CN1127.0.0.1:16001and CN2127.0.0.1:16002all connected and executed the SQL consumer smoke checks through PyMySQL text protocol.1.27.1,GOMAXPROCS=2and separately compiled test binaries. The historical comparison used cleanb86ddaf607e6502dea4e84f4ce3ea446b2a7c649with the identical currentBenchmarkShufflesupplied through an external Go overlay. Product files remained clean.What Was Covered
int64vector containing4rows followed byShuffle([3,1])produced[4,2], retired this vector's old lease responsibility, preserved the retained view's[1,2,3,4], released the underlying lease exactly once after the final owner and returned mpool usage to zero.TestShuffleBorrowedDataRetiresOwnerpassed.betweenImplconsumer checks passed after destructive reordering, including the original[false,true]result. Buffered variants and integerBETWEEN/ variable-lengthPrefixEqcontrols matched independent scalar expectations. The full function package passed.TestShuffleBorrowedLeaseLifecyclerace test then passed100repetitions, covering retained-view release interleavings and reuse.20non-random.Shuffle/.ShuffleWithBufcall expressions including forwarding wrappers. Monotonic selections preserve the existing sorted proof. In mergeutil, callers explicitly reestablish sorted status for the sort-key column and clear it for other columns after arbitrary sorting permutations.8,193-row descending sort/limit followed byBETWEENreturned(8193,false),(8192,true),(8191,true)and the filtered query returned IDs8191,8192. Version checks, row counts and cleanup passed.6samples per version for each fixed buffered ascending/descending case at64and8,192elements. Each sample used1sper case. All key measurements reported0 B/op,0 allocs/op.24-cell allocation matrix per version covered fixed/variable-length data, buffered/unbuffered operation, both sizes and unsorted/ascending/descending states. Allocation bytes and counts matched exactly between versions. These100mssamples were used for allocation checks only.Findings
cd40f4e15ca44b58c5e81ace48071ee54c483b4f,Fix vector shuffle ownership and sorted metadata. Original fix4bd71af013ab3bcd7480cbea0b21a6efe4e2966d,Optimize Shuffle ordering proof and identity copy. It folds ordering proof into the gather and avoids identity copy-back only for non-overlapping data and scratch. Both commits are ancestors of the tested main. Performance follow-up40%ascending component slowdown was not reproduced after the follow-up. With the issue's original benchmark fixture, the8,192-element ascending median changed from4875.5 ns/opto4749 ns/op, about-2.59%; descending changed from4871.5to4846.5 ns/op. The64-element ascending and descending medians changed from84.74to49.53 ns/opand84.465to56.865 ns/oprespectively.ABBA / BAAB / ABBAorder. All task-owned builds, other tests and the test service had ended before the key timed samples. The desktop remained a shared OS host with background activity and no affinity pinning. These observations establish the scoped component result on this host, with no production throughput claim or attribution of every version difference to a single function.MOTR / BVT Coverage
shuffle_ownership_regression_test.go,shuffle_sorted_test.go,allocation_account_test.goand the actual consumers inshuffle_between_regression_test.go. Complete vector, function and mergeutil suites passed with-count=1, along with full vector-raceand the focused lifecycle repetitions. These runs reported no skipped tests.Final Conclusion
Fixed for the scoped W1 issue #32016 on
3820136ff2bdeb0b7f3136fd4a66a00b8d571f55. Original ownership and sorted-consumer assertions, supported overlap boundaries, allocation-failure atomicity, race checks and the previously blocking ascending microbenchmark passed this QA run.Large-data regression is not required for this component contract. Required size-sensitive coverage was completed at
64and8,192elements using the reported benchmark boundary; the ownership and sorted defects have deterministic witnesses of4and3rows. The three-endpoint SQL smoke used8,193rows. Arbitrary data enlargement or a TKE throughput workload would not strengthen these scoped component assertions.