Repository navigation
test: isolate quota transaction mode from daemon tasks - #30659
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? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: Review belongs to an older commit; it is not a review of the current head. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
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.
Merge Queue Status
This pull request spent 3 hours 46 minutes 6 seconds in the queue, with no time running CI. ReasonPull 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.
HintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
aptend
left a comment
There was a problem hiding this comment.
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.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30129
What this PR does / why we need it:
TestIssue26087ConcurrentDataBranchQuotatemporarily 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:
TestIssue29400DropDatabaseRCReclaimFailureRollsBackWholeDatabasepasses on Linux (19.42 s).pkg/frontendfull package with-short;pkg/common/runtimefull package in normal and race modes; focused concurrent-setting race test repeated 100 times: passed.go vet,golangci-lint, formatting, and diff checks: passed.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.