Skip to content

test(objectio): cover marshal errors in writer entry points - #27949

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
LeftHandCold:fix/objectwriter-entrypoint-error-regression-26870
Sep 1, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
LeftHandCold:fix/objectwriter-entrypoint-error-regression-26870

Conversation

@LeftHandCold

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #26870
issue #27407

What this PR does / why we need it:

The production error-propagation fix for objectWriterV1.Write and
WriteWithoutSeqnum already landed incidentally in #26616, but its regression
test covered only Write.

Expand the deterministic malformed-vector regression into a table that exercises
both current public AddBlock wrappers. Each entry point must return the
serialization error and a nil block instead of advertising an unaccepted block.

WriteTombstone is intentionally not included: it was removed from the current
writer path by #19075. WriteSubBlock already returns the lower-level error
directly and does not have the swallowed-error wrapper shape.

Tested with:

go test -mod=readonly -v -count=1 -timeout=120s -run '^TestObjectWriterPropagatesMarshalError$' ./pkg/objectio

go test -mod=readonly -count=1 -timeout=120s ./pkg/objectio

Also validated with go build, go vet, and git diff --check for
pkg/objectio.

@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 kind/bug Something isn't working kind/test-ci labels Sep 1, 2026
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Sep 1, 2026

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep review completed on exact head 269e5eb93b5bbc38e06c3fde570779b72bd3e92f.

This is a valid test-only follow-up to the production fix already merged in #26616. The historical failure shape is concrete: AddBlock rejects a malformed varlena vector, while the old wrappers discarded that error and returned a non-nil block with nil error.

Test-quality and counterexample review:

  • The table has one independently named subtest for each active public wrapper with the swallowed-error shape: Write and WriteWithoutSeqnum.
  • Each subtest creates a fresh writer and malformed batch, reaches the real vector marshal validator, and requires both the specific serialization error and a nil block. This catches complete error swallowing as well as a partial fix that returns an unusable block alongside the error.
  • Existing package tests already cover successful writes for both wrappers, so the new cases add the missing negative cells without duplicating the happy path.
  • WriteSubBlock returns the lower-level error directly and has a different three-result contract; WriteTombstone is absent from the current writer path. No active equivalent entry point is omitted.
  • Latest main has no overlapping change in writer_test.go. No production, public API, disk format, hot path, or compatibility behavior changes.

Unhappy path / test lifecycle:

  • Q1: each malformed batch registers cleanup inside its subtest; the shared mpool is deleted after all subtests. No external file/service/process is created.
  • Q2: no goroutine, lock wait, channel, retry, sleep, or timeout behavior is added.
  • Q3: the table has two fixed entries and the in-memory fixture is bounded.

Evidence:

  • Exact-head substantive CI is green, including Ubuntu UT, arm64 SCA, coverage, Proxy BVT, and pessimistic multi-CN BVT.
  • Focused exact-head local test passed with both subtests visibly selected: TestObjectWriterPropagatesMarshalError/{Write,WriteWithoutSeqnum}.

No blocking correctness, test-oracle, resource-lifecycle, performance, compatibility, or scope issue found.

@mergify mergify Bot added the queued label Sep 1, 2026
@mergify

mergify Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-01 22:13 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-01 22:27 UTC · at 065c85fa43cd15f4749578248c21b3c2a9901807

This pull request spent 14 minutes 26 seconds in the queue, with no time running CI.

Waiting for
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]

Reason

Pull request #27949 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 870a3c3 into matrixorigin:main Sep 1, 2026
19 of 20 checks passed
@mergify mergify Bot removed the queued label Sep 1, 2026
@mergify mergify Bot added the dequeued label Sep 1, 2026
XuPeng-SH added a commit that referenced this pull request Sep 2, 2026
## What changed

- give each ordinary MORPC unary request a complete read-timeout window
from admission/flush, instead of charging it for socket-idle time before
the request arrived
- distinguish admitted, successfully flushed, terminal-send-failed, and
expired requests while preserving established idle, internal, and
one-way behavior and giving stream writes their own bounded fallback
window
- make tenant-upgrade tests execute the observable pass directly, bound
every wait, and retain one end-to-end periodic-loop test
- make the merge scheduler test synchronize at the exact
executor/table-check boundary, use deterministic resource admission, and
prevent the test observer from blocking the scheduler
- separate frontend scheduling-preview computation from its production
100 ms best-effort latency policy so correctness tests do not race CI
descheduling

## Root cause and design

The embedded-cluster failure was not a restore or privilege failure.
`CREATE ACCOUNT` began during an already-running socket `Read` window
and inherited only the remainder of a configured 20-second timeout.
Merely increasing the timeout therefore could not guarantee a newly
admitted request a full response window.

For a normal response-expecting unary request, the backend now models
four relevant states:

1. admitted/queued or being flushed: retain the stale idle timeout
because work is already pending;
2. successfully flushed: start one full response window at the
successful flush timestamp;
3. terminal send failure: do not extend the connection lifetime;
4. expired response window: close the stalled backend; a newer admission
cannot rescue it.

The timestamp is published before the terminal send-completion flag. The
timeout scanner reads that flag before the timestamp, so it cannot
observe an old zero timestamp paired with the new success flag. The hot
path adds one atomic store only for normal unary traffic after a
successful flush; the cold timeout path scans the existing
lifecycle-bounded future set. Internal, one-way, probe-enabled,
cancellation, and close semantics remain unchanged. Probe-less streams
use one backend-level last-successful-flush window only when no unary
response window exists; an expired unary remains authoritative.

The other failures had the same broad symptom but different mechanisms:
correctness depended on a 20 ms asynchronous timer, host/cgroup memory
plus 3/5 ms scheduler polling, or a production 100 ms best-effort
preview timeout. Race instrumentation and package-parallel CI load can
delay those operations without changing their business result. Tests now
synchronize on observable state transitions, carry bounded parent
contexts, and explicitly distinguish expected cancellation from a hang
deadline.

The lifecycle audit found no new unbounded state or waits: future
ownership remains reference-counted and backend-close bounded; the
timeout scan covers only existing live futures; merge observation is
nonblocking and overflow-checked; every new test wait has a 10-second
guard.

Fixes #27963

## Test plan

Passed before rebase:

- MORPC state matrix under race:
`TestReadTimeoutDoesNotChargeIdleTimeToNewRequest` (`-count=100`)
- actual MORPC request tracking under race:
`TestReadTimeoutTracksRequestsWithoutLivenessProbe` (`-count=50`)
- merge scheduler under race: `TestScheduler` (`-count=100`)
- frontend strict-pool path under race:
`TestDirectSessionStrictPoolWithoutLabelSelectorFailsClosed`
(`-count=50`)
- all seven tenant-upgrade tests separately under race (`-count=20`
each)
- full package tests: `pkg/common/morpc`, `pkg/bootstrap`,
`pkg/frontend`, and `pkg/vm/engine/tae/db/merge`
- full `pkg/common/morpc` package under race
- targeted `go vet` for all four owning packages
- real embedded-cluster regression under race:
`TestAuthenticatedTestsReuseBaseCluster` and
`TestIssue26640ClusterRestoreRebindsSubscriptionPrivileges`

Rebased cleanly onto current `main` (`3f6856cc5f`). The two new upstream
commits touched only frontend code, so the affected closure was rerun
after rebase:

- full `pkg/frontend`: passed (13.974 s)
- strict-pool frontend counterexample under race, `-count=50`: passed
(1.296 s)
- full `pkg/bootstrap`: passed (18.523 s)
- `go vet ./pkg/frontend ./pkg/bootstrap`: passed
- real embedded-cluster regressions under race: passed (36.040 s)
- `git diff --check`: passed

No SQL result, wire API, or planner contract changes are introduced, so
no SQL BVT case is required; the embedded-cluster tests exercise the
public transport/session path directly.

CI reruns for the unrelated failures on #27949 and #27946 were triggered
separately; this PR does not wait for those reruns.

Post-review deterministic-clock closure (99e9d6c):

- removed the remaining 25/50 ms wall-clock oracle from TestScheduler;
policy composition now uses a lifetime longer than the test hang guard
- added TestSchedulerPolicyPatchExpirationUsesInjectedClock to prove
in-place policy merging, exact-deadline validity, and removal
immediately after the injected clock crosses the deadline
- focused normal tests passed; both scheduler tests passed separately
under race detection with count 100; the full merge package passed

---------

Co-authored-by: Claude Fable 5 <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#27949)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#26870
issue matrixorigin#27407

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

The production error-propagation fix for `objectWriterV1.Write` and
`WriteWithoutSeqnum` already landed incidentally in matrixorigin#26616, but its
regression
test covered only `Write`.

Expand the deterministic malformed-vector regression into a table that
exercises
both current public `AddBlock` wrappers. Each entry point must return
the
serialization error and a nil block instead of advertising an unaccepted
block.

`WriteTombstone` is intentionally not included: it was removed from the
current
writer path by matrixorigin#19075. `WriteSubBlock` already returns the lower-level
error
directly and does not have the swallowed-error wrapper shape.

Tested with:

`go test -mod=readonly -v -count=1 -timeout=120s -run
'^TestObjectWriterPropagatesMarshalError$' ./pkg/objectio`

`go test -mod=readonly -count=1 -timeout=120s ./pkg/objectio`

Also validated with `go build`, `go vet`, and `git diff --check` for
`pkg/objectio`.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What changed

- give each ordinary MORPC unary request a complete read-timeout window
from admission/flush, instead of charging it for socket-idle time before
the request arrived
- distinguish admitted, successfully flushed, terminal-send-failed, and
expired requests while preserving established idle, internal, and
one-way behavior and giving stream writes their own bounded fallback
window
- make tenant-upgrade tests execute the observable pass directly, bound
every wait, and retain one end-to-end periodic-loop test
- make the merge scheduler test synchronize at the exact
executor/table-check boundary, use deterministic resource admission, and
prevent the test observer from blocking the scheduler
- separate frontend scheduling-preview computation from its production
100 ms best-effort latency policy so correctness tests do not race CI
descheduling

## Root cause and design

The embedded-cluster failure was not a restore or privilege failure.
`CREATE ACCOUNT` began during an already-running socket `Read` window
and inherited only the remainder of a configured 20-second timeout.
Merely increasing the timeout therefore could not guarantee a newly
admitted request a full response window.

For a normal response-expecting unary request, the backend now models
four relevant states:

1. admitted/queued or being flushed: retain the stale idle timeout
because work is already pending;
2. successfully flushed: start one full response window at the
successful flush timestamp;
3. terminal send failure: do not extend the connection lifetime;
4. expired response window: close the stalled backend; a newer admission
cannot rescue it.

The timestamp is published before the terminal send-completion flag. The
timeout scanner reads that flag before the timestamp, so it cannot
observe an old zero timestamp paired with the new success flag. The hot
path adds one atomic store only for normal unary traffic after a
successful flush; the cold timeout path scans the existing
lifecycle-bounded future set. Internal, one-way, probe-enabled,
cancellation, and close semantics remain unchanged. Probe-less streams
use one backend-level last-successful-flush window only when no unary
response window exists; an expired unary remains authoritative.

The other failures had the same broad symptom but different mechanisms:
correctness depended on a 20 ms asynchronous timer, host/cgroup memory
plus 3/5 ms scheduler polling, or a production 100 ms best-effort
preview timeout. Race instrumentation and package-parallel CI load can
delay those operations without changing their business result. Tests now
synchronize on observable state transitions, carry bounded parent
contexts, and explicitly distinguish expected cancellation from a hang
deadline.

The lifecycle audit found no new unbounded state or waits: future
ownership remains reference-counted and backend-close bounded; the
timeout scan covers only existing live futures; merge observation is
nonblocking and overflow-checked; every new test wait has a 10-second
guard.

Fixes matrixorigin#27963

## Test plan

Passed before rebase:

- MORPC state matrix under race:
`TestReadTimeoutDoesNotChargeIdleTimeToNewRequest` (`-count=100`)
- actual MORPC request tracking under race:
`TestReadTimeoutTracksRequestsWithoutLivenessProbe` (`-count=50`)
- merge scheduler under race: `TestScheduler` (`-count=100`)
- frontend strict-pool path under race:
`TestDirectSessionStrictPoolWithoutLabelSelectorFailsClosed`
(`-count=50`)
- all seven tenant-upgrade tests separately under race (`-count=20`
each)
- full package tests: `pkg/common/morpc`, `pkg/bootstrap`,
`pkg/frontend`, and `pkg/vm/engine/tae/db/merge`
- full `pkg/common/morpc` package under race
- targeted `go vet` for all four owning packages
- real embedded-cluster regression under race:
`TestAuthenticatedTestsReuseBaseCluster` and
`TestIssue26640ClusterRestoreRebindsSubscriptionPrivileges`

Rebased cleanly onto current `main` (`3f6856cc5f`). The two new upstream
commits touched only frontend code, so the affected closure was rerun
after rebase:

- full `pkg/frontend`: passed (13.974 s)
- strict-pool frontend counterexample under race, `-count=50`: passed
(1.296 s)
- full `pkg/bootstrap`: passed (18.523 s)
- `go vet ./pkg/frontend ./pkg/bootstrap`: passed
- real embedded-cluster regressions under race: passed (36.040 s)
- `git diff --check`: passed

No SQL result, wire API, or planner contract changes are introduced, so
no SQL BVT case is required; the embedded-cluster tests exercise the
public transport/session path directly.

CI reruns for the unrelated failures on matrixorigin#27949 and matrixorigin#27946 were triggered
separately; this PR does not wait for those reruns.

Post-review deterministic-clock closure (99e9d6c):

- removed the remaining 25/50 ms wall-clock oracle from TestScheduler;
policy composition now uses a lifetime longer than the test hang guard
- added TestSchedulerPolicyPatchExpirationUsesInjectedClock to prove
in-place policy merging, exact-deadline validity, and removal
immediately after the injected clock crosses the deadline
- focused normal tests passed; both scheduler tests passed separately
under race detection with count 100; the full merge package passed

---------

Co-authored-by: Claude Fable 5 <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#27949)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#26870
issue matrixorigin#27407

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

The production error-propagation fix for `objectWriterV1.Write` and
`WriteWithoutSeqnum` already landed incidentally in matrixorigin#26616, but its
regression
test covered only `Write`.

Expand the deterministic malformed-vector regression into a table that
exercises
both current public `AddBlock` wrappers. Each entry point must return
the
serialization error and a nil block instead of advertising an unaccepted
block.

`WriteTombstone` is intentionally not included: it was removed from the
current
writer path by matrixorigin#19075. `WriteSubBlock` already returns the lower-level
error
directly and does not have the swallowed-error wrapper shape.

Tested with:

`go test -mod=readonly -v -count=1 -timeout=120s -run
'^TestObjectWriterPropagatesMarshalError$' ./pkg/objectio`

`go test -mod=readonly -count=1 -timeout=120s ./pkg/objectio`

Also validated with `go build`, `go vet`, and `git diff --check` for
`pkg/objectio`.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What changed

- give each ordinary MORPC unary request a complete read-timeout window
from admission/flush, instead of charging it for socket-idle time before
the request arrived
- distinguish admitted, successfully flushed, terminal-send-failed, and
expired requests while preserving established idle, internal, and
one-way behavior and giving stream writes their own bounded fallback
window
- make tenant-upgrade tests execute the observable pass directly, bound
every wait, and retain one end-to-end periodic-loop test
- make the merge scheduler test synchronize at the exact
executor/table-check boundary, use deterministic resource admission, and
prevent the test observer from blocking the scheduler
- separate frontend scheduling-preview computation from its production
100 ms best-effort latency policy so correctness tests do not race CI
descheduling

## Root cause and design

The embedded-cluster failure was not a restore or privilege failure.
`CREATE ACCOUNT` began during an already-running socket `Read` window
and inherited only the remainder of a configured 20-second timeout.
Merely increasing the timeout therefore could not guarantee a newly
admitted request a full response window.

For a normal response-expecting unary request, the backend now models
four relevant states:

1. admitted/queued or being flushed: retain the stale idle timeout
because work is already pending;
2. successfully flushed: start one full response window at the
successful flush timestamp;
3. terminal send failure: do not extend the connection lifetime;
4. expired response window: close the stalled backend; a newer admission
cannot rescue it.

The timestamp is published before the terminal send-completion flag. The
timeout scanner reads that flag before the timestamp, so it cannot
observe an old zero timestamp paired with the new success flag. The hot
path adds one atomic store only for normal unary traffic after a
successful flush; the cold timeout path scans the existing
lifecycle-bounded future set. Internal, one-way, probe-enabled,
cancellation, and close semantics remain unchanged. Probe-less streams
use one backend-level last-successful-flush window only when no unary
response window exists; an expired unary remains authoritative.

The other failures had the same broad symptom but different mechanisms:
correctness depended on a 20 ms asynchronous timer, host/cgroup memory
plus 3/5 ms scheduler polling, or a production 100 ms best-effort
preview timeout. Race instrumentation and package-parallel CI load can
delay those operations without changing their business result. Tests now
synchronize on observable state transitions, carry bounded parent
contexts, and explicitly distinguish expected cancellation from a hang
deadline.

The lifecycle audit found no new unbounded state or waits: future
ownership remains reference-counted and backend-close bounded; the
timeout scan covers only existing live futures; merge observation is
nonblocking and overflow-checked; every new test wait has a 10-second
guard.

Fixes matrixorigin#27963

## Test plan

Passed before rebase:

- MORPC state matrix under race:
`TestReadTimeoutDoesNotChargeIdleTimeToNewRequest` (`-count=100`)
- actual MORPC request tracking under race:
`TestReadTimeoutTracksRequestsWithoutLivenessProbe` (`-count=50`)
- merge scheduler under race: `TestScheduler` (`-count=100`)
- frontend strict-pool path under race:
`TestDirectSessionStrictPoolWithoutLabelSelectorFailsClosed`
(`-count=50`)
- all seven tenant-upgrade tests separately under race (`-count=20`
each)
- full package tests: `pkg/common/morpc`, `pkg/bootstrap`,
`pkg/frontend`, and `pkg/vm/engine/tae/db/merge`
- full `pkg/common/morpc` package under race
- targeted `go vet` for all four owning packages
- real embedded-cluster regression under race:
`TestAuthenticatedTestsReuseBaseCluster` and
`TestIssue26640ClusterRestoreRebindsSubscriptionPrivileges`

Rebased cleanly onto current `main` (`3f6856cc5f`). The two new upstream
commits touched only frontend code, so the affected closure was rerun
after rebase:

- full `pkg/frontend`: passed (13.974 s)
- strict-pool frontend counterexample under race, `-count=50`: passed
(1.296 s)
- full `pkg/bootstrap`: passed (18.523 s)
- `go vet ./pkg/frontend ./pkg/bootstrap`: passed
- real embedded-cluster regressions under race: passed (36.040 s)
- `git diff --check`: passed

No SQL result, wire API, or planner contract changes are introduced, so
no SQL BVT case is required; the embedded-cluster tests exercise the
public transport/session path directly.

CI reruns for the unrelated failures on matrixorigin#27949 and matrixorigin#27946 were triggered
separately; this PR does not wait for those reruns.

Post-review deterministic-clock closure (99e9d6c):

- removed the remaining 25/50 ms wall-clock oracle from TestScheduler;
policy composition now uses a lifetime longer than the test hang guard
- added TestSchedulerPolicyPatchExpirationUsesInjectedClock to prove
in-place policy merging, exact-deadline validity, and removal
immediately after the injected clock crosses the deadline
- focused normal tests passed; both scheduler tests passed separately
under race detection with count 100; the full merge package passed

---------

Co-authored-by: Claude Fable 5 <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#27949)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#26870
issue matrixorigin#27407

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

The production error-propagation fix for `objectWriterV1.Write` and
`WriteWithoutSeqnum` already landed incidentally in matrixorigin#26616, but its
regression
test covered only `Write`.

Expand the deterministic malformed-vector regression into a table that
exercises
both current public `AddBlock` wrappers. Each entry point must return
the
serialization error and a nil block instead of advertising an unaccepted
block.

`WriteTombstone` is intentionally not included: it was removed from the
current
writer path by matrixorigin#19075. `WriteSubBlock` already returns the lower-level
error
directly and does not have the swallowed-error wrapper shape.

Tested with:

`go test -mod=readonly -v -count=1 -timeout=120s -run
'^TestObjectWriterPropagatesMarshalError$' ./pkg/objectio`

`go test -mod=readonly -count=1 -timeout=120s ./pkg/objectio`

Also validated with `go build`, `go vet`, and `git diff --check` for
`pkg/objectio`.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What changed

- give each ordinary MORPC unary request a complete read-timeout window
from admission/flush, instead of charging it for socket-idle time before
the request arrived
- distinguish admitted, successfully flushed, terminal-send-failed, and
expired requests while preserving established idle, internal, and
one-way behavior and giving stream writes their own bounded fallback
window
- make tenant-upgrade tests execute the observable pass directly, bound
every wait, and retain one end-to-end periodic-loop test
- make the merge scheduler test synchronize at the exact
executor/table-check boundary, use deterministic resource admission, and
prevent the test observer from blocking the scheduler
- separate frontend scheduling-preview computation from its production
100 ms best-effort latency policy so correctness tests do not race CI
descheduling

## Root cause and design

The embedded-cluster failure was not a restore or privilege failure.
`CREATE ACCOUNT` began during an already-running socket `Read` window
and inherited only the remainder of a configured 20-second timeout.
Merely increasing the timeout therefore could not guarantee a newly
admitted request a full response window.

For a normal response-expecting unary request, the backend now models
four relevant states:

1. admitted/queued or being flushed: retain the stale idle timeout
because work is already pending;
2. successfully flushed: start one full response window at the
successful flush timestamp;
3. terminal send failure: do not extend the connection lifetime;
4. expired response window: close the stalled backend; a newer admission
cannot rescue it.

The timestamp is published before the terminal send-completion flag. The
timeout scanner reads that flag before the timestamp, so it cannot
observe an old zero timestamp paired with the new success flag. The hot
path adds one atomic store only for normal unary traffic after a
successful flush; the cold timeout path scans the existing
lifecycle-bounded future set. Internal, one-way, probe-enabled,
cancellation, and close semantics remain unchanged. Probe-less streams
use one backend-level last-successful-flush window only when no unary
response window exists; an expired unary remains authoritative.

The other failures had the same broad symptom but different mechanisms:
correctness depended on a 20 ms asynchronous timer, host/cgroup memory
plus 3/5 ms scheduler polling, or a production 100 ms best-effort
preview timeout. Race instrumentation and package-parallel CI load can
delay those operations without changing their business result. Tests now
synchronize on observable state transitions, carry bounded parent
contexts, and explicitly distinguish expected cancellation from a hang
deadline.

The lifecycle audit found no new unbounded state or waits: future
ownership remains reference-counted and backend-close bounded; the
timeout scan covers only existing live futures; merge observation is
nonblocking and overflow-checked; every new test wait has a 10-second
guard.

Fixes matrixorigin#27963

## Test plan

Passed before rebase:

- MORPC state matrix under race:
`TestReadTimeoutDoesNotChargeIdleTimeToNewRequest` (`-count=100`)
- actual MORPC request tracking under race:
`TestReadTimeoutTracksRequestsWithoutLivenessProbe` (`-count=50`)
- merge scheduler under race: `TestScheduler` (`-count=100`)
- frontend strict-pool path under race:
`TestDirectSessionStrictPoolWithoutLabelSelectorFailsClosed`
(`-count=50`)
- all seven tenant-upgrade tests separately under race (`-count=20`
each)
- full package tests: `pkg/common/morpc`, `pkg/bootstrap`,
`pkg/frontend`, and `pkg/vm/engine/tae/db/merge`
- full `pkg/common/morpc` package under race
- targeted `go vet` for all four owning packages
- real embedded-cluster regression under race:
`TestAuthenticatedTestsReuseBaseCluster` and
`TestIssue26640ClusterRestoreRebindsSubscriptionPrivileges`

Rebased cleanly onto current `main` (`3f6856cc5f`). The two new upstream
commits touched only frontend code, so the affected closure was rerun
after rebase:

- full `pkg/frontend`: passed (13.974 s)
- strict-pool frontend counterexample under race, `-count=50`: passed
(1.296 s)
- full `pkg/bootstrap`: passed (18.523 s)
- `go vet ./pkg/frontend ./pkg/bootstrap`: passed
- real embedded-cluster regressions under race: passed (36.040 s)
- `git diff --check`: passed

No SQL result, wire API, or planner contract changes are introduced, so
no SQL BVT case is required; the embedded-cluster tests exercise the
public transport/session path directly.

CI reruns for the unrelated failures on matrixorigin#27949 and matrixorigin#27946 were triggered
separately; this PR does not wait for those reruns.

Post-review deterministic-clock closure (99e9d6c):

- removed the remaining 25/50 ms wall-clock oracle from TestScheduler;
policy composition now uses a lifetime longer than the test hang guard
- added TestSchedulerPolicyPatchExpirationUsesInjectedClock to prove
in-place policy merging, exact-deadline validity, and removal
immediately after the injected clock crosses the deadline
- focused normal tests passed; both scheduler tests passed separately
under race detection with count 100; the full merge package passed

---------

Co-authored-by: Claude Fable 5 <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — 065c85fa Deployed Sep 1, 2026 by mergify[bot] via Matrixone Utils CI / Coverage #49984
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/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.

3 participants