Repository navigation
test(iscp): prepare sink fixtures and avoid redundant target DDL - #29051
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Astra medium deep review at exact head 9f5aa57. COMMENT ONLY (self-authored PR).\n\nNo actionable P0/P1/P2 findings. Reviewed target readiness and tenant-scoped lookup, cold-DLL fallback/error propagation, partial-acquisition rollback, bounded cancellation cleanup, fixture setup/isolation, transaction ownership, teardown, and bidirectional row correctness oracles. No new shared cache, goroutine, unbounded accumulation, leak, or lifecycle issue found.\n\nTwelve deterministic scenarios cover warm/cold targets, fresh consumers, target removal, tenant context, acquisition/lookup/commit/DDL failures, and cancellation. Exact-head CI passed; Ubuntu race logs show Executor7, Executor8, and InvalidTimestamp passing, and engine shards succeeded. git diff --check passed.\n\nResidual note: removing fixture DDL from propagation waits reduces timing coupling, but unchanged 10-second waits were not independently stress-tested under arbitrary commit stalls.
## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes #28655 Related to #28419 ## What this PR does / why we need it: `TestCheckLeaseFailed` can exhaust its initial 10-second watermark wait before it reaches the lease-rejection scenario. In the reported CI failure, cold sink database/table commits consumed about five seconds, followed by a roughly 3.45-second data commit. The sink preparation introduced by #29051 did not cover this test. Prepare the empty sink before registering the job using the existing single-transaction fixture helper. Keep real data propagation and all lease-rejection deadlines/assertions, and add a bidirectional source/sink comparison before injecting the failure. Generate only the two rows the test uses. Defer executor Stop so it joins background work before the earlier lease-stub reset and engine/RPC teardown. Previously, testing cleanup ran Stop after those function defers, allowing background requests against closed dependencies on early failures. This changes one test only. It removes cold DDL from the propagation budget and combines two setup commits into one; it does not promise elimination of unrelated slow-commit watermark failures. Cold-target coverage remains in the existing engine tests. Validation (macOS arm64, Go 1.26.4, repository CGo wrapper, `matrixone_test`, `-short`): - Exact test under race: PASS, then 21/21 same-process repetitions PASS (`-count=21`). - Full `./pkg/vm/engine/test`, normal `-count=1`: PASS, 151.836s, including the changed test and unchanged cold-target `TestISCPExecutor3`. - Incremental golangci-lint for the changed package: 0 issues; default test vet, gofmt and diff checks passed. - Same-host single-run race test body: 1.49s before / 1.40s after. This is a smoke comparison, not a statistical CI speedup claim. Logs confirm sink DDL moved before registration and uses one transaction instead of two. Historical Ubuntu/x86 CI supplied the timeout evidence; it was not reproduced locally. CI for this PR has not been awaited.
What type of PR is this?
Which issue(s) this PR fixes:
Follow-up to #28967 and #28969, already closed by #28976. Related to #28419.
What this PR does / why we need it:
In PR #29043's race UT failure,
TestISCPExecutor7exhausted its 10-second watermark wait while the mock consumer was still creating its destination database. The Running-status commit took 2.60 seconds, followed by a target-database commit taking 7.21 seconds. Engine/heavy-wave isolation from #28976 was already active. The iteration log printed during teardown is a deferred producer-exit log, not evidence that the worker only started then.Prepare empty sink tables before registration in Executor7/8 and UpdateJobSpec, sharing the existing InvalidTimestamp setup pattern. Batch database/table creation into one executor-owned transaction, with rollback on statement errors. Keep the original watermark targets, deadlines, deletion/job-type transitions and fault barriers. Extend Executor7/8 with bidirectional source/sink data checks; retain cold-start, non-system-tenant and cancellation integration controls.
Fresh CN mock consumers now check the target in a tenant-scoped metadata transaction. An existing target bypasses two redundant DDL statements on every iteration. Confirmed absence retains the original idempotent cold DDL; lookup/commit/cancellation errors propagate. The lookup transaction finishes before DDL, with no cache or readiness state shared across consumer instances, so a later dropped target is checked again.
Performance and limits
Warm initialization replaces two SQL DDL paths with one metadata transaction. Cold initialization adds that lookup; the four prepared fixtures still perform real schema creation with one fewer write commit each. Executor7/8 add six read-only comparison queries in total. The observed UpdateJobSpec target DDL count falls from six to two. No shard concurrency, test timeout, retry, WAL durability or IndexSync consumer behavior changes.
The CI trace establishes the delayed fixture DDL, not the underlying cause of slow TN commits. This removes that avoidable dependency from functional progress waits; it does not guarantee that arbitrary status/data commit stalls cannot exceed the original deadline. Local timings are smoke comparisons, not a prediction of total Ubuntu CI duration.
Validation
macOS/arm64, Go 1.26.4, isolated native build:
pkg/iscpnormal/race: PASS (0.928s / 2.336s).a warm target must not execute DDL; the candidate passes 100 race repetitions. This reproduces the redundant-DDL contract violation, not the historical CI slow-commit timeout (the unmodified local Executor7 baseline also passed).No new BVT: the changed consumer is the CN test consumer; existing real engine integration supplies the data, transaction, tenant and recovery oracles. CI will remain pending at delivery.