Skip to content

test(plan): cover mixed-width CHAR set operations - #28956

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28952-pad-space-set-20260916
Sep 16, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28952-pad-space-set-20260916

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Test and CI
  • Feature
  • Code Refactoring

Which issue(s) this PR fixes:

Refs #28952

What this PR does / why we need it:

The current base already contains the common-width CHAR set-operation implementation and PAD SPACE key normalization. This PR adds focused planner coverage for the issue shape: mixed CHAR(8)/CHAR(4) UNION, INTERSECT, MINUS, and reversed UNION operands.

The assertions verify that both branches use the common CHAR(8) type, preventing a future regression where physical padding width changes set-operation results.

Validation:

  • Focused mixed CHAR/VARCHAR and mixed-width CHAR planner tests passed.
  • git diff --check passed.
  • No production change, BVT, or full/slow UT was added or run.

@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 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.

Deep-reviewed exact head 1b66f886a8bc5eb08008e79ad4daf78039a77bb4 against base/merge-base 76e1a9bd9f75480ee76f686c43994f938a15a8d5 with GPT-6 medium. COMMENT-only because this is the author PR.

No concrete P1/P2 blocker found. The added tests correctly cover common CHAR(8) planner typing and both branch types across UNION, INTERSECT, MINUS, and reversed UNION. Existing cast UTs, adjacent planner tests, and the unchanged pad_char_to_full_length BVT cover runtime padding/equality, DISTINCT keys, and visible UNION/INTERSECT/MINUS results. No production code or existing oracle was changed.

Exact-head planner UT CI and SCA passed. BVT was skipped, so this review does not claim an exact-head public SQL execution pass. GitHub currently reports mergeable_state=blocked, so the PR is not merge-ready despite green executable checks.

@XuPeng-SH
XuPeng-SH merged commit 3a50d04 into matrixorigin:main Sep 16, 2026
23 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/issue-28952-pad-space-set-20260916 branch September 16, 2026 16:19
XuPeng-SH added a commit that referenced this pull request Sep 17, 2026
## Summary

- Consolidate the two static Arrow policy scenarios into one test-scoped
four-CN fixture.
- Keep ForceMaterialize borrow/materialize and
GateDisabled/distributed-fallback on separate CNs and databases.
- Keep BVT, restart, and rollout/drain tests on their existing dedicated
lifecycles.

## Why

Race UT evidence from #28956 and #28885 shows that the apparently slow
Arrow cases spend most of their time waiting for embedded-cluster
admission and service startup. The global cluster admission lock is an
intentional resource-safety boundary; this change reduces one compatible
lifecycle instead of bypassing that lock or increasing default cluster
concurrency.

The two static policy matrices are independent, have no restart/fault
boundary, and use disjoint state. Sharing their lifecycle removes one
cluster admission/start/close cycle without removing a policy mode,
assertion, or behavioral case.

## Coverage and lifecycle safety

- CN0: Arrow enabled, S3 enabled, distributed enabled, borrow path.
- CN1: Arrow enabled, S3 enabled, distributed enabled, ForceMaterialize
path.
- CN2: Arrow disabled, S3 enabled, distributed enabled, gate-disabled
path.
- CN3: Arrow enabled, S3 enabled, distributed disabled, soft-fallback
path.
- The fixture is owned by the combined test and closed with `t.Cleanup`
before later package tests acquire the global admission lock.
- Startup rollback retains cleanup ownership when `StartTestCluster`
returns a non-nil cluster with an error.

The former focused test names are preserved as nested subtests:

`TestArrowLoadStaticPolicyModes/TestArrowLoadForceMaterializeFallback`

`TestArrowLoadStaticPolicyModes/TestArrowLoadGateModes`

## Validation

- Baseline, two independent race lifecycles: package elapsed `32.538s`.
- Combined static-policy race test: `15.867s` in the final focused run;
earlier A/B package elapsed `17.39s`.
- Full `pkg/tests/arrowload` race run on the lifecycle consolidation:
passed, package elapsed `74.612s`, wall `90.21s`.
- Final focused command: `GOWORK=off go test -mod=readonly -race -json
./pkg/tests/arrowload -run '^TestArrowLoadStaticPolicyModes$' -count=1`.

This PR does not claim that one local package run proves the entire
70-minute race-UT suite improvement; CI should measure the
constrained-runner effect and memory impact of the four-CN fixture.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [x] Test and CI
- [ ] Feature
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Refs matrixorigin#28952

## What this PR does / why we need it:

The current base already contains the common-width CHAR set-operation
implementation and PAD SPACE key normalization. This PR adds focused
planner coverage for the issue shape: mixed CHAR(8)/CHAR(4) UNION,
INTERSECT, MINUS, and reversed UNION operands.

The assertions verify that both branches use the common CHAR(8) type,
preventing a future regression where physical padding width changes
set-operation results.

Validation:
- Focused mixed CHAR/VARCHAR and mixed-width CHAR planner tests passed.
- git diff --check passed.
- No production change, BVT, or full/slow UT was added or run.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## Summary

- Consolidate the two static Arrow policy scenarios into one test-scoped
four-CN fixture.
- Keep ForceMaterialize borrow/materialize and
GateDisabled/distributed-fallback on separate CNs and databases.
- Keep BVT, restart, and rollout/drain tests on their existing dedicated
lifecycles.

## Why

Race UT evidence from matrixorigin#28956 and matrixorigin#28885 shows that the apparently slow
Arrow cases spend most of their time waiting for embedded-cluster
admission and service startup. The global cluster admission lock is an
intentional resource-safety boundary; this change reduces one compatible
lifecycle instead of bypassing that lock or increasing default cluster
concurrency.

The two static policy matrices are independent, have no restart/fault
boundary, and use disjoint state. Sharing their lifecycle removes one
cluster admission/start/close cycle without removing a policy mode,
assertion, or behavioral case.

## Coverage and lifecycle safety

- CN0: Arrow enabled, S3 enabled, distributed enabled, borrow path.
- CN1: Arrow enabled, S3 enabled, distributed enabled, ForceMaterialize
path.
- CN2: Arrow disabled, S3 enabled, distributed enabled, gate-disabled
path.
- CN3: Arrow enabled, S3 enabled, distributed disabled, soft-fallback
path.
- The fixture is owned by the combined test and closed with `t.Cleanup`
before later package tests acquire the global admission lock.
- Startup rollback retains cleanup ownership when `StartTestCluster`
returns a non-nil cluster with an error.

The former focused test names are preserved as nested subtests:

`TestArrowLoadStaticPolicyModes/TestArrowLoadForceMaterializeFallback`

`TestArrowLoadStaticPolicyModes/TestArrowLoadGateModes`

## Validation

- Baseline, two independent race lifecycles: package elapsed `32.538s`.
- Combined static-policy race test: `15.867s` in the final focused run;
earlier A/B package elapsed `17.39s`.
- Full `pkg/tests/arrowload` race run on the lifecycle consolidation:
passed, package elapsed `74.612s`, wall `90.21s`.
- Final focused command: `GOWORK=off go test -mod=readonly -race -json
./pkg/tests/arrowload -run '^TestArrowLoadStaticPolicyModes$' -count=1`.

This PR does not claim that one local package run proves the entire
70-minute race-UT suite improvement; CI should measure the
constrained-runner effect and memory impact of the four-CN fixture.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [x] Test and CI
- [ ] Feature
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Refs matrixorigin#28952

## What this PR does / why we need it:

The current base already contains the common-width CHAR set-operation
implementation and PAD SPACE key normalization. This PR adds focused
planner coverage for the issue shape: mixed CHAR(8)/CHAR(4) UNION,
INTERSECT, MINUS, and reversed UNION operands.

The assertions verify that both branches use the common CHAR(8) type,
preventing a future regression where physical padding width changes
set-operation results.

Validation:
- Focused mixed CHAR/VARCHAR and mixed-width CHAR planner tests passed.
- git diff --check passed.
- No production change, BVT, or full/slow UT was added or run.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## Summary

- Consolidate the two static Arrow policy scenarios into one test-scoped
four-CN fixture.
- Keep ForceMaterialize borrow/materialize and
GateDisabled/distributed-fallback on separate CNs and databases.
- Keep BVT, restart, and rollout/drain tests on their existing dedicated
lifecycles.

## Why

Race UT evidence from matrixorigin#28956 and matrixorigin#28885 shows that the apparently slow
Arrow cases spend most of their time waiting for embedded-cluster
admission and service startup. The global cluster admission lock is an
intentional resource-safety boundary; this change reduces one compatible
lifecycle instead of bypassing that lock or increasing default cluster
concurrency.

The two static policy matrices are independent, have no restart/fault
boundary, and use disjoint state. Sharing their lifecycle removes one
cluster admission/start/close cycle without removing a policy mode,
assertion, or behavioral case.

## Coverage and lifecycle safety

- CN0: Arrow enabled, S3 enabled, distributed enabled, borrow path.
- CN1: Arrow enabled, S3 enabled, distributed enabled, ForceMaterialize
path.
- CN2: Arrow disabled, S3 enabled, distributed enabled, gate-disabled
path.
- CN3: Arrow enabled, S3 enabled, distributed disabled, soft-fallback
path.
- The fixture is owned by the combined test and closed with `t.Cleanup`
before later package tests acquire the global admission lock.
- Startup rollback retains cleanup ownership when `StartTestCluster`
returns a non-nil cluster with an error.

The former focused test names are preserved as nested subtests:

`TestArrowLoadStaticPolicyModes/TestArrowLoadForceMaterializeFallback`

`TestArrowLoadStaticPolicyModes/TestArrowLoadGateModes`

## Validation

- Baseline, two independent race lifecycles: package elapsed `32.538s`.
- Combined static-policy race test: `15.867s` in the final focused run;
earlier A/B package elapsed `17.39s`.
- Full `pkg/tests/arrowload` race run on the lifecycle consolidation:
passed, package elapsed `74.612s`, wall `90.21s`.
- Final focused command: `GOWORK=off go test -mod=readonly -race -json
./pkg/tests/arrowload -run '^TestArrowLoadStaticPolicyModes$' -count=1`.

This PR does not claim that one local package run proves the entire
70-minute race-UT suite improvement; CI should measure the
constrained-runner effect and memory impact of the four-CN fixture.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants