Repository navigation
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? |
90d60d9 to
3403168
Compare
b0a6909 to
6551997
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed head 6551997865b616b07fa50eecf53e2c124604b604 against base 0d701bb966f3dbc313d6659baec1c47762d1c186. No blocking issue found in this review.
I traced input-row allocation through batch offsets, local partial producers, ordered/unordered DISTINCT state, finalization, and spill/rebuild. The source-row metadata stays separate from DISTINCT identity; the logical grouped context survives singleton spill buckets. Warning retention is bounded, counts are accumulated separately, and publication consumes the diagnostics to avoid duplicate reporting during cleanup. Failed finalization clears pending diagnostics.
The v66 gate preserves v65 for ASCII. Remote and marker-free partials downgrade provenance, including empty/NULL-only partials, and mixed state does not re-export partially trusted source rows. This deliberately provides fallback aggregate ordinals for those paths, rather than claiming globally ordered source positions across independent CN streams.
The additional row metadata and bounded warning sorting have a real GROUP_CONCAT memory/CPU cost; this review does not establish a measured performance delta. The new per-process cursor lock is limited to counter lookup/allocation, with no downstream I/O under the lock, and counters are cleared at query reset.
Validation reused: current-head CI run 34690713442, with UT, SCA, shared build, coverage, both active BVT jobs, and CI Required successful. Also inspected the focused regression tests for partial merge, NULL/DISTINCT handling, offsets, spill boundaries, warning retention, and protocol gates. No redundant broad local test run was performed.
Submitting COMMENT because this is a self-authored PR.
What type of PR is this?
Which issue(s) this PR fixes:
Closes #28665
What this PR does / why we need it:
GROUP_CONCAT()truncation diagnostics used local aggregate-finalization order as the warning row number. With multiple groups, partial aggregation, or spill/rebuild, that order can differ from input order, so the result can be correct whileSHOW WARNINGSreports the wrong source row.The fix carries source-row metadata across batches, ordered and unordered DISTINCT state, partial merges, and local spill/rebuild. It combines warnings across spill buckets before publication and preserves existing H0/single-group behavior and NULL handling.
Distributed provenance is explicit. Independent remote CN processes mark their row ordinals untrusted instead of exporting local ordinals. The coordinator and legacy readers fall back to a deterministic aggregate ordinal domain for untrusted or marker-free partials, including empty and NULL-only partials. Mixed state is never re-exported with partially trusted row metadata.
Upstream main now contains #28746, which assigns MORPC v65 to ASCII's signed INT result. This PR uses MORPC v66 for the GROUP_CONCAT source-row diagnostics extension and gates the payload and provenance marker on v66. The duplicate ASCII compatibility commit is no longer part of this branch.
Validation
mainat0d701bb966f3dbc313d6659baec1c47762d1c186; MORPC v65 remains assigned to ASCII and GROUP_CONCAT metadata requires v66.pkg/sql/colexec/aggexec,pkg/sql/colexec/group,pkg/vm/process,pkg/sql/compile, andpkg/sql/plan/function;TestIssue28665WarningRowsFollowInputOrderpassed inpkg/tests/issues.6551997865b616b07fa50eecf53e2c124604b604, GPT-6 medium final review passed andgit diff --checkpassed. CI reruns are in progress; local runtime tests were not rerun after this rebase.pkg/sql/colexec/aggexec,pkg/sql/colexec/group,pkg/vm/process,pkg/sql/compile,pkg/sql/plan/function, andpkg/pb/planpassed; the public distributed BVT, focused-racecases,make cgo -j12, and incrementalgolangci-lint --new-from-rev=origin/mainalso passed.TestIssue26640ClusterRestoreRebindsSubscriptionPrivilegesdeadline failure; the same test passed on the next run of that exact SHA and in another run. Issue [Bug]: Race UT restore case intermittently hits deadline under CI load #28763 tracks this intermittent restore-test behavior. That later run failed overall in the separateTestBackupProtectionCheckpointProtectioncase; that checkpoint timeout is not classified as flaky.Compatibility and performance
The local path adds a small state-level marker at the v66 partial boundary. Trusted local values retain source rows; remote or legacy mixed states use a bounded fallback counter. No new goroutine, RPC wait, or unbounded retention path is introduced.