Skip to content

test(window): guard prepared execution allocation lifetime - #31126

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue31089-main
Oct 26, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue31089-main

Conversation

@XuPeng-SH

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

Copy link
Copy Markdown
Contributor

What type of PR is this?

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

Which issue(s) this PR fixes:

Related to #31089.

What this PR does / why we need it:

Protect Window's prepared-execution allocation lifetime with small operator and public-interface regressions. Main already contains the inherited-buffer cleanup from #27112, so this PR does not modify production code.

Cause and invariant

Window can copy HashJoin output while inheriting its allocation account. Prepared execution ends through Reset, so clearing logical lengths is insufficient: all backing owned by the ending account must be released before account terminal completion. Ordinary execution additionally calls Free and can hide this lifetime defect.

Regression coverage

  • Three-row self JOIN feeding an unpartitioned cumulative SUM, with equivalent literal and uniform-partition controls.
  • Reuse the same binary prepared handle with changed parameters, empty results, and a subsequent nonempty execution; verify connection usability afterward.
  • Operator coverage checks two fresh account generations, current allocation selections, terminal used/live-allocation zero before Free, cancellation after buffering, direct Free, partial aggregation failure, and unaccounted buffer reuse.
  • Compact SQL PREPARE BVT covers ROWS, default RANGE, changed parameters, DEALLOCATE and database teardown.

Validation

  • Matching native artifacts and branch toolchains (main: Go 1.27.1; 4.2-dev: Go 1.26.4).
  • On the rebased head, the original 206-row fixture succeeds in all three execution modes: 202 result rows, identical SHA-256. The reduced binary-prepared regression also passes.
  • Window normal UT and allocation/error/cancellation race coverage pass. Release also passes the full owning Window package under race; the binary-prepared public regression passes under race on each branch.
  • Standard mo-tester comparison passes twice on the same test-owned embedded instance: 22/22 SQL statements, zero failures/ignored statements per run. Independent connections verify database teardown after each run. This is the new window case, not the full BVT suite.
  • gofmt, go vet, molint and incremental golangci-lint v2.14 pass for the changed packages and their public-test consumer.

The final rebase preserves the reviewed Window/lifecycle and regression files byte-for-byte. Operator race and SQL BVT evidence is reused; original/reduced prepared acceptance and static checks were rerun on the rebased heads. GitHub CI is pending.

One local attempt timed out during tester/shared-cluster initialization before regression SQL execution under host I/O and swap pressure. The recorded bounded retry passed; production code, fixture policy and timeout budgets were not relaxed.

Mergify automatically synchronizes updated main after publication. The PR file set and changed-file blobs were verified identical to the locally reviewed/tested patch (e853127535). Local validation covers that patch; CI verification of the latest bot integration is pending.

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

@mergify mergify Bot added the kind/test-ci label Oct 25, 2026
@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 25, 2026
@XuPeng-SH

XuPeng-SH commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: ccd59b5b001bde4cb5415b0c02d8aa6412477dc0

"interrupted"

@XuPeng-SH

XuPeng-SH commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: ce5b9bef6cc15620ab8f7f2e9cbea7eb9e354329

Review completed. Read the assessment.

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

mo-bot review · mo-bot-local · review

Commit: ce5b9bef6cc15620ab8f7f2e9cbea7eb9e354329

Assessment: approve

Reviewed the complete five-file, test-only delta. The tests strengthen Window’s existing cleanup contract with meaningful generation, cancellation, error, and prepared-execution coverage while reusing established owners and fixtures. No actionable defects or production performance changes found.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Full Window package passed: 226 root tests. Binary-prepared SQL regression passed, including changed parameters, empty results, reuse, and fresh authentication.

  • Reset/account-generation and JSON aggregation-error tests each passed 100 focused race repetitions.

  • Normal mo-tester comparison passed twice on one ready instance: 22/22 statements each, zero failures or ignored statements; independent connections confirmed teardown.

  • Preflight, native-input provenance, formatting, and source cleanliness passed. Commands, source fingerprints, exit receipts, and logs reconciled in /home/xupeng/.local/state/mo-bot/jobs/55d8c13b6e070fcf5bedbab1/attempt-1/validation-audit.json.

Limitations:

  • Frozen CI remained pending. Full integration/distributed suites and the original 206-row issue fixture were not rerun; issue #31089’s body was not supplied.

  • Initial BVT attempt executed no case SQL because of mo-tester absolute-path handling. Its failure evidence was retained separately; the relative-path retry passed without changing SQL or expected results.

This branch had an error being deployed

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

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants