Skip to content

test: isolate quota transaction mode from daemon tasks - #30659

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-30129-iscp
Oct 20, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-30129-iscp

Conversation

@iamlinjunhong

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:

Fixes #30129

What this PR does / why we need it:

TestIssue26087ConcurrentDataBranchQuota temporarily changed one CN's default transaction mode while the shared cluster's daemon task connections remained active. Existing task connections retained RC isolation, so they could run optimistic RC transactions alongside pessimistic task claims. The original CI logs show overlapping daemon admissions during this interval, followed by oversized task-table writes and the later ISCP lease-cardinality failure.

Replace that CN-wide mutation with an account-scoped mode setting in the existing testing context. Only the test's dedicated tenant uses optimistic mode; system/task connections keep their normal defaults. Apply the setting before lifecycle-specific transaction options, preserve the existing SI sessions, explicitly initialize the eight creator connections to SI, and restore the setting on cleanup.

The quota test now checks active transactions from both accounts on the same CN: the tenant must be optimistic/SI while the system account remains pessimistic/RC. This assertion deterministically fails with the original test implementation and passes with this change. Runtime tests cover scope, restoration, and concurrent access.

Investigation also reproduced two committed claims for one primary key under the old mixed-mode setup, then heartbeat updates affecting 2, 4, and 16 rows. This PR removes the test-induced configuration contamination; it does not change the engine's general mixed-mode conflict-validation semantics or relax the ISCP lease check.

Validation:

  • Deterministic negative control: original quota test plus the new system-mode assertion fails (expected pessimistic, observed optimistic).
  • Updated quota test passes on macOS and Linux; original TestIssue29400DropDatabaseRCReclaimFailureRollsBackWholeDatabase passes on Linux (19.42 s).
  • pkg/frontend full package with -short; pkg/common/runtime full package in normal and race modes; focused concurrent-setting race test repeated 100 times: passed.
  • Scoped go vet, golangci-lint, formatting, and diff checks: passed.
  • Independent GPT-6 Astra medium design and integrated final review: no unresolved blockers.

Linux validation used Go 1.27.1 and eight CPUs. It was a focused pair run, not a full-module coverage replay. CI remains 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 →

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 81d5d098244f6f20ce3ed712c58ae2cb01ef70d8

Review completed. Read the assessment.

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: 81d5d098244f6f20ce3ed712c58ae2cb01ef70d8

Review belongs to an older commit; it is not a review of the current head.

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

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

Commit: 81d5d098244f6f20ce3ed712c58ae2cb01ef70d8

Assessment: approve

Reviewed the complete four-file delta with no actionable findings. Reusing TestingContext for an account-scoped override cleanly removes CN-wide test contamination while preserving session isolation and lifecycle-option precedence. Cleanup, concurrent access and existing quota assertions remain sound. Ordinary transaction creation adds bounded runtime lookups, with no additional SQL or object I/O.

Model: gpt-6-astra / xhigh

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

Validation:

  • Verified frozen HEAD, merge-base, clean source, supplied patch equality and git diff --check.

  • Traced runtime registration, transaction-option application, system task connections, shared-fixture serialization and creator connection cleanup.

  • Isolation preflight passed. All seven pkg/common/runtime tests passed under -race; TestTxnModeTestConfigConcurrentAccess then passed 100 focused repetitions through the supplied test-exec.

  • Reused the supplied exact-head successful Ubuntu UT, SCA, coverage, shared-build and proxy/pessimistic multi-CN BVT results. Skipped checks were excluded.

  • Commands, source fingerprints, terminal events, exits and log hashes are reconciled in /home/xupeng/.local/state/mo-bot/jobs/1f0817ac3947b8f357f3744b/attempt-1/review-validation.json. Final audit receipt checks/1792490713558502214-3.json records exit 0; review-map.json records coverage and design reasoning.

Limitations:

  • Frontend and embedded quota tests were not repeated locally; exact-head CI was reused. Author negative-control and platform-specific claims lack retained raw artifacts and were treated as supplementary.

  • The linked issue's full text and original daemon/ISCP logs were unavailable. General mixed-mode engine conflict semantics remain outside this repair.

  • No latency benchmark was run; the ordinary-path cost assessment is source-based.

@mergify mergify Bot added the queued label Oct 20, 2026
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-20 10:07 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-20 13:53 UTC · at 2d6a78bb19e7406361275e6624c8a92598c18ef0

This pull request spent 3 hours 46 minutes 6 seconds in the queue, with no time running CI.

Reason

Pull request #30659 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.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

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

  • Requeue this pull request

@aptend aptend 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-reviewed all four changed files at exact head 81d5d09 against base/merge-base 743e749, issue #30129 and complete review/discussion history. No blocking issue found.

The override is copied under the existing TestingContext mutex and qualified by both Enabled and the dedicated account ID. It is inert without a registered configuration; system/task connections keep their original defaults. Transaction creation applies it before the existing forced lifecycle mode/isolation options, so those still win. The quota test explicitly initializes both retained sessions and all eight creator sessions to SI and checks actual tenant/system transactions with positive counts, retaining the quota/error/snapshot oracles. This removes the test-induced contamination; it does not purport to repair the engine's general mixed-mode conflict semantics or relax ISCP lease checks.

Lifecycle check Verified closure
Ownership Scoped previous-config restore, immediate connection cleanup and system-probe rollback remain paired on assertion failures.
Wait termination Configuration locks cover copies only; creator cleanup cancels and drains before closing connections/restoring scope.
Bounds One configuration per runtime and eight bounded creators/results; no new worker, SQL/I/O or retained growth on ordinary transaction creation.

Reused exact-head raw CI evidence: UT 118537268127 passes the changed quota root (16.23s) and the previously affected ISCP rollback root (21.01s); normal coverage 118537327812 completes with exit 0/no failing events; SCA 118537268284 reports zero issues. Independently measured TestTxnModeTestConfigConcurrentAccess under -race, then ran its adaptive 100 exact-root repetitions in one process: 100 passes, zero failures, terminal exit 0. The controlled wrapper verified native-artifact reuse; no primary-workspace changes, product edits or duplicate embedded-cluster run were needed.

This branch was previously deployed

1 inactive deployment
ci — 2d6a78bb Deployed Oct 20, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/bug Something isn't working 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.

[CI]: initial ISCP consumer stalls in TestIssue29400DropDatabaseRCReclaimFailureRollsBackWholeDatabase

4 participants