Repository navigation
fix(iscp): deliver trailing delete so a branch delete shadows a copied index - #29863
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? |
72e9da8 to
b69b054
Compare
6d4e293 to
59e2ba9
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review at 59e2ba9c18e605b1db524040251c1c24aea9fe2d against 42d42546fd2c2b2449cb81cea47f81d300139753: REQUEST_CHANGES for one P2 boundedness regression in the all-consumer opt-in.
The core FULLTEXT2 fix is well placed: the existing ISCP collection boundary owns the policy, the existing recovery filter supplies the needed semantics, and immutable policy capture carries it across sub-handles. This is a focused bug fix, exempt from a separate feature-design document. I traced RestoreTable -> the FULLTEXT2 no-op InitSQL -> the retained initial watermark -> collection/filtering -> sink -> persisted frames -> query, including the default CDC/publication callers and the other index sinkers. No duplicate filtering state machine, catalog format, or per-algorithm SQL dispatch was added. No earlier human review comments existed at intake.
The blocking issue is downstream: an unknown DELETE is not a resource no-op for the append-only cuVS sinks. Repeated insert/delete pairs that previously disappeared now generate permanent delete-only history, while the unchanged rebuild policy counts only insert/upsert traffic. The inline comment supplies the concrete workload, owners and required closure.
| Audit | Result |
|---|---|
| Q1: change batches -> refcounted fanout -> consumer Done / handle Close; spill outputs -> handle cleanup | Existing owners retained; focused real-reader probe covers returned data and spill release. |
| Q2: producer/retriever and SQL send waits -> context/error selection -> cancel/join | No new wait or lock; caller cancellation remains attached. |
| Q3: extra deletes -> cuVS persistent tail -> replay deleted set -> rebuild gate | Fails: the tail grows while the automatic reclamation metric remains zero. |
Validation: the exact-head Linux UT job and multi-CN proxy BVT job succeeded. The BVT execution artifact explicitly selects branch_fulltext2_inherited_delete.sql: 32/32, 16.414s, with no ignored cases. I reused that result and the author's exact-head owning-package results. The local CPU retention probe uses the real cuVS encoder, replay and CuvsUpdatable gate (only SQL row retrieval is injected): 1 then 3 distinct absent-key deletes produce deleted-set sizes 1 then 3, zero counted growth and rebuild=false even with threshold 2. This is a structural CPU reproduction, not a GPU end-to-end or load test. A separate four-row probe checks real normal/range/spill readers with the option off/on and a fresh Next context; the first normal-reader fixture attempt was rejected because its start frontier was uninitialized, after initializing its covered range, all six reader controls passed (0.01s test body, command exit 0). The retention package also passed its explicit observation assertions; those assertions confirm the undesired zero-growth accounting.
The probes overlay all differing Go sources from this head onto an existing native-built checkout; Makefile, native inputs and module files were verified identical. No production files were edited. Test quality was assessed separately: copied-base INCLUDE/result controls are useful, but manually feeding a tombstone to TailBuilder does not prove collection, and the new literal-boolean spill helper test does not exercise constructor wiring. The real-reader probe closes that immediate wiring uncertainty. The BVT waits for durable completion but does not force clone and DELETE into the same range; retain a deterministic collection-boundary regression when revising.
Accounting: implementation +95/-11; UT +644/-0; SQL case/result +215/-0; documents +0/-0. The remaining blocker concerns retained work and cleanup ownership, not line count. No subagents were used.
59e2ba9 to
4cd18d9
Compare
4cd18d9 to
a5a73f8
Compare
Unrelated CI blocker #27739 — RESOLVED and verified on head
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of d36ea83ad59ad67609f0720ce94cdbc17f61a077 against merge-base 61d8e2887f0ae5b63e3baa7b399e3b10b9c47d6a: REQUEST_CHANGES. One P2 correctness blocker remains in the new seed-window gate; one separate P3 test cleanup defect is also confirmed.
The architectural direction is appropriate for this focused bug fix (no separate feature-design document required). ISCP owns the consumer-specific decision, CollectChanges remains a passthrough, and the engine reuses its existing recovery/net-effect implementation. The option survives ordinary, checkpoint, deferred range and spill constructors. There is no duplicate filtering state machine, per-algorithm dispatch, catalog field or persistent format. However, the new predicate treats a selected range's JobStatus.To as evidence of committed consumption. Existing Running persistence writes that field before consumers run. The inline P2 describes the resulting recovery counterexample and the authoritative progress boundary to use instead.
Prior comments: I read the original retention finding and all five author replies. Moving the opt-in out of the shared wrapper and disabling it after successful steady-state progress addresses the original healthy-workload cuVS insert/delete-history regression. The new real collection test also addresses the requested deterministic seed-range/churn controls. The thread being resolved does not close the new recovery hole introduced by its replacement gate. A copied FULLTEXT2 job uses startFromNow=true, hence a nonempty initial watermark: its first collected range is a tail, not the empty-watermark Snapshot path. Its success boundary is the sink transaction's UpdateWatermark, not merely a populated To or the Snapshot final-flush branch. Seeded tail jobs can also share a range; I checked that shared-read opt-in intentionally applies to every member.
| Closure | Audit result |
|---|---|
| R3: InitSQL / durable status / recovery / scheduler | Fails at abandoned Running: selection becomes nonempty without consumption, restart retains it, and the retry disables trailing-delete delivery. |
| R2: context capture / normal, checkpoint and spill filtering | Existing owners and defaults preserved; no new wait, lock or algorithmic scan. |
| R3: copied index -> tail frames -> covered query / other sinks | Happy-path public oracle verified; missing delete remains observable because the covered query has no base join. Successful ordinary churn coalesces again. |
| Q1: batches and reader/spill resources | Production ownership is unchanged. The new engine test omits cleanup of caller-owned returned batches (P3). |
| Q2: read/fanout/consumer waits | Existing cancellation, retriever cleanup and worker joins retained; no new blocking dependency. |
| Q3 / performance | The unconditional steady-state emission is removed. Seed/retry work still has additional delete traffic; no new foreground TP execution path. This is source/functional analysis, not a TP throughput or GPU load benchmark. |
Evidence reused: exact-head CI run 38146548803 is terminal success. The UT checkout log identifies this head; its checkpoint artifact selects iscp, fulltext2, engine, disttae, and logtailreplay in the Linux -short -race -tags matrixone_test stage, which exits 0, and both engine/test shards exit 0. The multi-CN proxy BVT job execution artifact explicitly records branch_fulltext2_inherited_delete.sql: 32/32, 14.43s, zero failed/ignored cases. This proves the public happy path; it does not select interruption between Running persistence and consumption.
New discriminating checks on this head:
- A local probe runs production
ExecuteIteration,GetJobSpecsdecoding,FlushJobStatusOnIterationState/FlushStatus, recovery reconstruction and candidate scheduling. SQL storage/transaction boundaries and the unused sink are injected; this is not a process-kill integration test. It stops immediately after the Running write/commit boundary, before consumer execution. First read:keep=true, durable watermark10-0, selectedTo=30-0,ErrorCode=0. Recovered read: range10-1..30-0,keep=false. The explicit-error control remains true. The required recovery oracle fails (test body <0.01s, package 0.769s, exit 1). - The author's real engine seed-range test, with only a dedicated read mpool and an end-of-drain allocation assertion, fails with 96 bytes retained after all handles close (body 0.13s). The control adds cleanup of the returned batches: 0 bytes, all original behavioral assertions pass (body 0.22s, exit 0).
These probes overlay the exact Go sources onto an existing native-built checkout after verifying identical Makefile/CGo/third-party/module inputs. No production files were changed. The implementation, tests and SQL artifacts were reviewed separately: implementation +136/-11, Go tests +938/-0, SQL case/result +215/-0, documents +0/-0. The tests provide useful collection and query controls, but helper-policy truth tables miss the actual interrupted state transition, and returned batches need caller cleanup. No subagents were used.
…d index RestoreTable copies a special index's already-built state and re-registers its CDC with startFromNow=true, which registerJob resolves to the DDL transaction's PRE-commit snapshot TS. The clone's own row appends therefore commit inside the first change range the copy is maintained from, sharing that range with the branch's DELETE of a row inherited from the copied base. filterBatch Case 2.2 (first op INSERT, last op DELETE) cancels such a pair as "no net change". That is only sound while the consumer's materialized state equals the table state at the range start, because the leading INSERT is then proof the key was absent before the range. A copied index violates the precondition by construction: its base segment already holds the key from the source generation, at recency 0. No tombstone is written, nothing outranks the copied posting, and a covered FULLTEXT2 query keeps returning the deleted row. The joined query only looks correct because its INNER join against the base table filters the ghost, so two equivalent predicates disagree and REINDEX "fixes" it merely by discarding the copied base. Add engine.WithCollectChangesKeepTrailingDeletes and request it from the ISCP iteration that owns the durable job state, only for the ranges where that precondition is broken. collectChangesCtxForJobs opts an iteration in while an InitSQL-seeded job generation may still lag the range start: it is retrying a failed range (ErrorCode set), no range has been selected yet (To empty), or the durable mo_iscp_log.watermark has not reached the persisted job_status.To. A selected range is not a consumed range. The executor commits job_status.To with ISCPJobState_Running before the consumers start, and recovery turns such an abandoned row into Completed without applying anything, so To alone cannot prove consumption. The watermark can: only the sink transaction's UpdateWatermark, or the Snapshot path's final flush, advances it to that To, and it is the same column the scheduler reads back to pick the next range start. GetJobSpecs now selects it and returns it, decoded with the same types.StringToTS the replay path uses. The ErrorCode arm stays separate because a maintenance watermark flush advances the column without replacing job_status, which would otherwise drop a failed range's retry opt-in. Every later range starts after the clone's appends, where coalescing is sound again, so steady-state insert-then-delete churn keeps cancelling out and no append-only sink accumulates extra durable deletes. That bound matters: the cuVS sinks retain every distinct deleted pk in their cdc_tail while CuvsUpdatable counts inserts and upserts only, so an unconditional opt-in would grow retained history without ever arming the rebuild that reclaims it. All three ChangeHandler constructors honour the option, and the range-spill path now receives the same flag instead of a hard-coded false so it cannot disagree with the in-memory path. PartitionChangesHandle captures and re-attaches the option across range splits, and collectChangesContext now chains both options instead of early-returning on the first. CollectChanges stays a plain pass-through for its other caller, the ISCP log apply path in executor.go; cdc, publication, data_branch and table_changes keep their own wrappers. The insert side is unchanged, so the option cannot resurrect or duplicate rows, and every sinker treats a delete of a key it does not hold as a no-op: hnsw skips an unknown key, the SQL sinkers delete zero rows, cuvs encodes a lookup-free record, and fulltext2 liveness only consults deletes for pks present in a segment. Related to matrixorigin#28847
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review at 7590df0d880a35659f6d21d8e4ee4d40b3358382, base/merge-base 6af999e7b812ced6ef226665a09f9956fe58db9b: APPROVE. No remaining confirmed implementation blocker. Reviewed the full 15-file diff, issue #28847, all prior review threads, actual owners/callers and adjacent failure controls; no subagents.
The previous P2 is fixed at the existing durable owner: GetJobSpecs now reads watermark in the same catalog snapshot as job_spec/job_status, and the seed gate compares committed progress with the selected range. No new persistent field or duplicate state machine was introduced. I replayed the prior failing probe through production ExecuteIteration, Running persistence, recovery reconstruction, candidate scheduling and the next real iteration (SQL storage/transaction boundaries injected). On this head the sequence is first read=true, recovered abandoned read=true, committed-progress control=false; the probe passes. This closes the selected-versus-consumed gap rather than only adjusting the predicate truth table.
The P3 batch leak is fixed: every returned data/tombstone batch is released in a deferred caller owner, and the dedicated pool returns to baseline. The real-engine seed-range test passes locally under race with the memory oracle intact. The original cuVS healthy-churn finding remains closed: the shared wrapper injects no policy, steady-state successful consumption turns the option off, and collection still coalesces ordinary insert/delete churn. A shared Tail iteration intentionally uses the strongest required policy for its members; exposure is bounded by the uncommitted/retry range.
Design/performance: ISCP owns this decision, while ordinary, checkpoint, deferred and spill readers reuse existing net-effect filtering. Default CDC/publication readers remain unchanged. Failure/cancel still follows existing retriever/fanout/reader cleanup; no new lock, worker, retry loop or storage format. Incremental cost is an additional column in an existing SELECT, per-job timestamp decoding/comparison and opt-in tombstone traffic during seed/retry. No foreground TP route is added; no TP/GPU performance percentage is claimed.
Test quality and scope were assessed separately: implementation 5 files +159/-15; Go tests 8 files +1133/-9; SQL case/results 2 files +215/-0; documentation files 0. Filter/index helper tests have appropriately narrower claims than the real reader and public SQL case; independent off/on, committed/abandoned and absent-key controls preserve the important distinctions.
New local evidence: Darwin arm64, Go 1.27.1, repository CGo runner, matching verified native inputs, GOMAXPROCS=4, count=1. Four focused ISCP roots pass under race (package 2.647s); TestCollectChangesSeedRangeDeliversInheritedDelete passes under race (body 0.32s/package 2.949s); the production-path recovery probe passes in normal mode. Production source is unchanged and the temporary probe was removed.
Reused exact-head evidence: CI 38167943515 is terminal success. The UT artifact records successful relevant race stages and both engine/test shards. The actual multi-CN BVT artifact selects branch_fulltext2_inherited_delete.sql: 32/32, 14.367s, zero failed/ignored. No local full-cluster rerun or GPU campaign is claimed.
Non-blocking description correction: the PR body still says the copied seed read is Snapshot and cannot share a range. RestoreTable/fulltext2 uses startFromNow=true, so its initial watermark is nonempty and the collection is Tail; after InitSQL it can share an identical range. The implementation is reviewed against that actual path, including sink-transaction UpdateWatermark. Please correct the explanatory text so future maintenance does not rely on the wrong premise.
Merge Queue Status
This pull request spent 16 seconds in the queue, including 1 second running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28847
What this PR does / why we need it:
After
DATA BRANCH CREATE TABLEcopies a table with a synchronizedFULLTEXT2index, deleting a row inherited from the copied index does not shadow the copied posting. A covered full-text query (one that projects only columns stored by the index) keeps returning the deleted primary key, while the equivalent query that projects a base-table column returns the correct rows, because itsINNERjoin against the base table happens to filter the ghost. Two equivalent predicates disagree, and the wrong answer survives a cold restart, so it is persisted index state rather than a cache/visibility delay.Root cause
RestoreTable(pkg/sql/compile/ddl.go) copies each special index's hidden tables and then re-registers its CDC withstartFromNow=true.registerJob(pkg/iscp/watermark_updater.go:212) resolves that to:So the clone's own row appends commit strictly after
startTsand land inside the first change range the copied index is maintained from — sharing that one range with the user's branchDELETEof an inherited row.filterBatch(pkg/vm/engine/disttae/logtailreplay/change_handle.go) classifies a key whose first op in the range is anINSERTand whose last is aDELETEas Case 2.2, and withisRecoveryMode=falsedrops both as "no net change":That cancellation is only sound when the consumer's materialized state equals the table state at the range start, because the leading
INSERTis then proof the key was absent before the range. A copied index violates that precondition by construction: its base segment already holdspk1from the source generation, at recency0. With no tombstone written, nothing outranks the copied posting andIndex.resolvekeeps reportingpk1as live. The covered path projects straight out of the index, so the ghost reaches the user; the joined path only looks correct.ALTER ... REINDEX ... FORCE_SYNC"fixes" it merely by discarding the copied base.This is the same precondition break that
isRecoveryModealready exists for on CDC restart-from-checkpoint — the cloned generation was simply never covered by it.Decoded persisted state before the fix: one tail chunk,
n_inserts=2 (pk2,pk3),n_deletes=0— the delete never reached the sink at all.The fix
One opt-in engine option, requested only for the ranges where the Case 2.2 precondition is actually broken:
pkg/vm/engine/change_handle_net_effect.go(new) —WithCollectChangesKeepTrailingDeletes(ctx)/CollectChangesKeepTrailingDeletesFromContext(ctx), mirroring the existingWithCollectChangesPreserveAllVersionspattern, with explicitnil-context handling.pkg/iscp/util.go— the sharedCollectChangeswrapper stays a plain pass-through for the caller'sctxand injects no policy of its own (skipDeletesunchanged; only the doc comment differs frommain). This keeps the other caller — themo_iscp_logself-scan inapplyISCPLogWithRel(executor.go:794), which maintains no copied index — on the default net effect.pkg/iscp/iteration.go— newcollectChangesCtxForJobs(ctx, jobSpecs, prevStatus, committedWatermark)+jobStateMayLagRangeStart(jobSpec, status, committed), applied at the one index-maintenance read site (iteration.go:238). A job generation is opted in only while it was seeded byInitSQLand its materialized state may still predate the range start:prevStatus.ErrorCode != 0(the last attempt may have been applied only partially, so its range is retried from the same lagging state),prevStatus.To.IsEmpty()(no range selected yet), orcommitted < prevStatus.To(a range was selected but its consumption never committed). All three inputs come from the durablemo_iscp_logrow, so the window is bounded by durable consumption — not by the index algorithm, and not by a range the executor merely selected.pkg/iscp/iteration.go—GetJobSpecsnow also selects the durablemo_iscp_log.watermarkcolumn and returns it as a third value, decoded with the sametypes.StringToTSthe replay path already uses (executor.go:1148). That column is the authoritative commit boundary: only the sink transaction'sUpdateWatermark(data_retriever.go:166, reached fromfulltext2_consumer.go:121,cuvs_writer.go:403,index_consumer.go:242/:383) or the Snapshot path's final flush (iteration.go:331, persistingwatermark = status.Toat:336-338) advances it to a range'sTo, and it is the same column the scheduler reads back to choose the next range'sfrom(consumer_entry.go:153-154,job_config.go:88). Its fivepkg/iscpcall sites initeration_test.go, the twogostubstubs inpkg/vm/engine/test/change_handle_test.go, and the fakemo_iscp_logresult (one addedvarcharcolumn) were updated to match; no production caller other thaniteration.go:112exists.pkg/vm/engine/disttae/logtailreplay/change_handle.go— all threeChangeHandlerconstructors honour the option.NewChangesHandlerWithPartitionStateRangeAndPrimaryIdxnow passesisRecoveryModeintoprepareRangeNetEffectSpillinstead of a hard-codedfalse, so the spill path and the in-memory path apply the same rule (previously a range too large to coalesce in memory silently disagreed).newChangesHandlerWithCheckpointEntriesORs it with its explicit parameter. Comments onisRecoveryModeand Case 2.2 now name the cloned-generation trigger. No filtering logic was rewritten.pkg/vm/engine/disttae/change_handle.go—PartitionChangesHandlecaptureskeepTrailingDeletesat construction and re-attaches it incollectChangesContext, so a range split into successive sub-handles cannot lose the policy.collectChangesContextwas also fixed to chain both options rather than early-return on the first.installSnapshotStateRangeHandlepropagates it to the sub-handle it builds.Why the window closes. A selected range is not a consumed range.
ExecuteIterationWithRuntimefillsstatuses[i].Toand commits it withISCPJobState_Running(iteration.go:292) before the consumers start (:311), and a stop inside that window leaves a row thatrepairAbandonedJobs(executor.go:430-443) andaddOrUpdateRecoveredJob(:1013-1030) both turn intoCompletedwhileToand the zeroErrorCodestay intact — so a populatedTocannot be the proof, and the durablewatermarkis used instead.The seed range is
typ == ISCPDataType_Snapshot(iteration.go:287-290), so its final flush always runs (:331) and commitswatermark = status.TowithErrorCode = 0; the next range then readscommitted >= Toand the option is off. Every later range starts after the clone's appends, where coalescing is sound again.The
ErrorCodearm stays separate and is load-bearing rather than a second test of the same fact: a failed attempt persistswatermark = status.From(iteration.go:336-338), but two maintenance passes advance that column without replacingjob_status—ISCPLogAdvanceWatermarkSQL(sql_builder.go:1225, called fromconsumer_entry.go:233) and the clean-table pass (executor.go:618). Either can later move the watermark past a range that was never applied, and only the retry flag keeps that tombstone alive. A success clears it (statuses[i]is rebuilt fresh each iteration,SetError(nil)is a no-op), and a permanently failed job goes terminal and stops being a candidate (iteration.go:976-994setsPermanentErrorThresholdand flushesISCPJobState_Error;table_entry.go:148then skips it viaIsInitedAndFinished,consumer_entry.go:164-166). The seed read also cannot leak into an unrelated job:getCandidateappends the empty-watermark iteration andcontinues before the shareable pool (table_entry.go:163-174), and anInitSQLjob inJobStage_Initis forced unshared (:182-183).The option keeps the trailing
DELETEand still drops the redundantINSERT, so it cannot resurrect or duplicate rows. Deliberately not changed: recency rules, the CDC start boundary, the frame format, and query plans. MovingregisterJob'sstartTsto a post-commit timestamp was considered and rejected —startFromNow = snapshotTSis intentionally at-least-once forCREATE INDEX, where the index is built from the snapshot and CDC must not miss anything committed between the snapshot and the DDL commit; shifting that boundary risks losing updates for every index type.Blast radius
iscp.CollectChangeshas exactly two callers (pkg/iscp/executor.go:794,pkg/iscp/iteration.go:238), and only the second — the index-maintenance read — can opt in, and only for the bounded seed/retry window above.pkg/cdc,pkg/publication,pkg/frontend/data_branch.goandcolexec/table_function/table_changes.goall use their own wrappers and are untouched, so no downstream-CDC or publication behaviour changes.iscp.GetJobSpecsgained one return value, and it has exactly one production caller (pkg/iscp/iteration.go:112) plus seven test call/stub sites, all updated here. The addedwatermarkcolumn is already part of the row's DDL (pkg/frontend/predefined.go:307,watermark VARCHAR NOT NULL) and is already selected by the replay snapshot (cdc.CDCSQLBuilder.ISCPLogSelectSQL()), so no schema, migration or CDC-replication change is involved —pkg/cdc'smo_iscp_logsinker templates are untouched. The gate itself adds no new state: it reads a column the scheduler already reads, and no generation metadata is plumbed throughCollectChanges.Keeping the delete means a sink can be handed a tombstone for a key it never received. Verified per sinker family:
pkg/vectorindex/hnsw/sync.go:511(cannot find key from existing models. ignore it) and:392DELETE FROM <idx> WHERE <pk> IN (...)(pkg/iscp/index_sqlwriter.go:309,:720) — affects zero rowspkg/vectorindex/cuvs/cdc.go:283)Verification
Live single-process cluster built from this branch, data dir wiped and re-bootstrapped so no state carries over. Readiness was gated on the ISCP watermark, never on
MATCHand never onREINDEX, so the per-CN search cache was never pre-warmed:EXPLAINof the covered query contains 0Joinlines and 1Table Function on fulltext2_search, so the correct answer comes from the index itself, not from a join masking a still-stale posting.Decoded persisted index state after the fix (
tbl=leaf):Tombstone recency
2> copied base recency0— exactly the "tombstone newer than the copied base posting" the issue asks for. The same results and the same three frames were retained across a cold service restart.Issue-to-test proof
TestCopiedBaseShadowedByBranchDelete, BVT coveredselect id/select id,tagTestCopiedBaseWithoutDeleteFrameReturnsGhost— no tombstone ⇒ covered search returns exactly{1,3}with pk1 liveTestCopiedBaseTailRecencyIsAboveBase— also asserts a delete ranked below the base must not shadow itTestFilterBatchKeepsTrailingDeleteForCopiedIndexBase— OFF ⇒ tombstoneEMPTY; ON ⇒ tombstone{1}, data side{2,3}unchangedTestFilterBatchKeepTrailingDeletesIsScopedToInsertThenDelete— delete-then-insert, +skipDeletes, delete-then-delete, reinsert, lone insert, lone delete, update-then-delete, independent keysTestSelectRangeNetEffectRowsKeepsTrailingDeleteInRecovery— incl. nil/degenerate inputs and thefirst==lastshortcutTestPartitionChangesHandlePreservesKeepTrailingDeletesContextTestCollectChangesForwardsCallerPolicy,TestCollectChangesCtxForJobs,TestCollectChangesCtxForJobsKeepsCallerContextRunningrow must keep the window openTestCollectChangesCtxForJobs/"seeded generation stopped before any sink work"⇒true; andTestSeedWindowAcrossAbandonedRunningRowround-trips the durable row through the production encoder (MarshalJobSpec/MarshalJobStatus/normalizeJobStatuses),GetJobSpecs' real SELECT + decode and the real gate:watermark == From⇒true,watermark == To⇒falseTestCollectChangesCtxForJobs/"failed range whose watermark a maintenance flush already passed"⇒true(a clean-table pass moved the column past ajob_statusthe failed flush left behind)TestCollectChangesCtxForJobs/"seeded generation after its first committed range"⇒false, plus the real-engine control belowTestCollectChangesSeedRangeDeliversInheritedDeletereads from a dedicatedmpooland ends onrequire.Equal(readBaseline, readMP.Stats().NumCurrBytes)⇒ 0 outstanding bytes after all six range reads and handle closesskipDeletes=false)TestCollectChangesSeedRangeDeliversInheritedDelete(pkg/vm/engine/test) — seed range: OFF ⇒0deletes, ON ⇒1tombstone for the inherited row; delete-only range delivered either way; steady-state churn ⇒0either way; steady-state delete of an earlier row ⇒1TestCollectChangesKeepTrailingDeletesContextRoundTripTestDeleteOfKeyAbsentFromIndexIsNoOp+ BVTphantom⇒EMPTY(pk9 created and destroyed inside the branch window)TestCopiedBaseDeleteThenReinsertAcrossFramesUPDATEof an inherited row still correct (#27950 regression)TestCopiedBaseUpdateInheritedRow+ live branch UPDATE/INSERT run (incl. an HNSW index on the same table through the same wrapper)@regexassertions: covered requiresfulltext2_searchpresent andJoinabsent; joined requiresJoin Type: INNERThe BVT case gates readiness with
@wait_expect(2, 90)onmo_catalog.mo_iscp_log.watermarkagainst a timestamp captured after the DML committed, and issues noMATCHwhile waiting.Test commands
Results on the current head
7590df0d88(all via the CGo wrapper, every commandrc=0, zero--- FAILlines): all focused testsPASS—TestCollectChangesSeedRangeDeliversInheritedDelete0.17s including its 0-outstanding-bytes assertion,TestSeedWindowAcrossAbandonedRunningRow, and all 12TestCollectChangesCtxForJobssubcases. All six suitesok:pkg/iscp1.569s,pkg/vm/engine0.760s,logtailreplay2.634s,disttae8.448s,fulltext24.065s,pkg/vm/engine/testchange-handle subset 58.617s. Self-checks:golangci-lintv2.14.0 0 issues;license-eye6184 files / 0 invalid;make err-checkpass;go vetclean over all ten packages that importpkg/iscp.gofmt -l -sreports onlypkg/vm/engine/test/change_handle_test.go, whose two findings are byte-identical onorigin/mainat the same offsets (@@ -4378/@@ -4484, pre-existinggostubcontinuation-indentation); reformatting them would add churn to lines this PR does not need to touch, so they are left as upstream has them.molintreports only its two pre-existingunsafe recover()findings (pkg/iscp/fulltext2_sqlwriter.go:102,pkg/iscp/iteration.go:1175— both present onorigin/main, both outside every hunk here). BVT32/32twice locally, and green in CI five times — on59e2ba9c18,a5a73f8e6f,caa62ac8ca,d36ea83ad5and5b432ef87a; this head'stest/distributed/blobs are unchanged from all five (.sqlddcc68433a6de25fe29f2d991572bb2a082b3ead,.result2d9a89425020a8783e7ed3374df1b7e8b577b493).Review response — P2 cuVS delete-only history (
r4241023375)Accepted, and fixed by scoping the opt-in rather than by arguing the frame size. Both cited owners were re-verified in code and the review is right about each:
pkg/vectorindex/cuvs/cdc.go:623— theCdcOpDeletebranch doesdelete(overflow, rec.Pkid); deleted[rec.Pkid] = struct{}{}, and theCdcOpInsertbranch immediately below deliberately does not clear the pkid fromdeleted. Every distinct deleted pk is therefore retained for the index generation's lifetime.pkg/vectorindex/cuvs/idxcron/cuvs_updatable.go:259-260—_ = totalDeletes; return totalInserts + totalUpserts, so a delete-only workload can never arm the rebuild that would reclaim it.Under the previous unconditional opt-in the reviewer's workload (base rows unchanged, one fresh pk inserted and deleted inside each maintenance range) emits permanent delete-only history while the reclamation metric stays zero forever. That is an unbounded retained-history regression, and neither documenting a ~72-byte frame nor proving DELETE idempotence bounds it — so that argument was not made.
The fix takes the review's second option, scope policy through an existing consumer ownership boundary, and leaves the cuVS retention/rebuild contract alone (changing it is outside this PR's purpose). The boundary is the durable
JobStatusthe ISCP iteration already reads and writes, so the option is live only while a consumer's materialized state can genuinely predate the range start — see Why the window closes under The fix. The reviewer's exact workload now reads with the option off and coalesces exactly as before;TestCollectChangesCtxForJobs/"seeded generation after its first collected range"pins the gate, andTestCollectChangesSeedRangeDeliversInheritedDeletepins the observable read on the real engine.Also addressed from the review body:
TestCollectChangesSeedRangeDeliversInheritedDeletedrives the realdisttaeEngineread thatiscp.CollectChangesperforms (skipDeletes=false) over the exact ranges a copied index's consumer sees: seed range OFF ⇒0deletes / ON ⇒1tombstone for the inherited row, delete-only range delivered either way, steady-state churn ⇒0either way, steady-state delete of an earlier row ⇒1. This supplies the collection-and-wiring proof that hand-feeding a tombstone toTailBuilderand the literal-boolean spill helper could not; both are kept as unit-level controls.pkg/iscpwrapper test was renamedutil_collect_changes_test.go→collect_changes_policy_test.gobecause it no longer tests a policy baked intoutil.go;TestCollectChangesForwardsCallerPolicynow asserts the wrapper injects no policy (which also keeps themo_iscp_logself-scan atexecutor.go:794on the default net effect).Review response — P2 durable-watermark gate + P3 fixture ownership (
PRR_kwDOFEPiGM8AAAABRt6qIg)Both accepted. Both were re-verified in the source before anything was changed, and the P2 counterexample reproduces from it.
[P2]
To != empty && ErrorCode == 0did not prove consumption. Three facts, each checked in code:ExecuteIterationWithRuntimestampsstatuses[i].Toand commits it withISCPJobState_Runningatiteration.go:292, whilerunISCPTaskIterationConsumersonly starts at:311. A stop in between persists a range that nothing applied.repairAbandonedJobs(executor.go:430-443) rewrites onlyjob_state(Pending/Running→Completed), andaddOrUpdateRecoveredJob(:1013-1030) normalizes the same two states in memory. Neither touchesjob_status, soTostays populated andErrorCodestays0.fromis derived from the durable watermark (consumer_entry.go:153-154→job_config.go:88), so an abandoned row re-reads a range the old gate had already declared consumed. Case 2.2 cancels the clone's append with the inherited delete again, and the retry can commit its watermark while the copied FULLTEXT2 posting stays queryable — the exact bug this PR exists to fix, reintroduced on a crash path.The old gate was wrong, and the persisted-nonzero-error control could not cover it, precisely because that path leaves
ErrorCode == 0.The gate now keys off the existing durable consumption boundary.
GetJobSpecsselectsmo_iscp_log.watermarkand returns it as a third value;jobStateMayLagRangeStartopts in whenErrorCode != 0, orTo.IsEmpty(), orcommitted < To. That column reaches a range'sToonly through the sink transaction'sUpdateWatermark(data_retriever.go:166, reached fromfulltext2_consumer.go:121,cuvs_writer.go:403,index_consumer.go:242/:383) or the Snapshot path's final flush (iteration.go:331,:336-338), and it is the same column the scheduler already reads back to pick the nextfrom— so this is the contract the review asked to base the gate on, not a new one, and no generation metadata is plumbed throughCollectChanges.The
ErrorCodearm was kept, and is now demonstrably load-bearing rather than a redundant second test of the same fact: a failed attempt persistswatermark = status.From, but two maintenance passes advance the column without replacingjob_status—ISCPLogAdvanceWatermarkSQL(sql_builder.go:1225, called fromconsumer_entry.go:233) and the clean-table pass (executor.go:618). Either can later carry the watermark past a range that was never applied; folding the retry into the comparison would silently drop its opt-in."failed range whose watermark a maintenance flush already passed"pins that, and"seeded generation whose watermark a maintenance flush passed"pins the healthy direction (committed > To, no error ⇒false).Both requested controls were added:
Running, including interruption before any sink work —TestCollectChangesCtxForJobs/"seeded generation stopped before any sink work"at the predicate level, plusTestSeedWindowAcrossAbandonedRunningRow, which drives the reviewer's exact transition through the production encoder (MarshalJobSpec,normalizeJobStatuses,MarshalJobStatus), the production SELECT/decode insideGetJobSpecsand the production gate:watermark == From(the Running flush wroteiterCtx.fromTS, no consumer ran) ⇒keep=true;watermark == To(the sink committed) ⇒keep=false. OnlyExecWithResultis injected, so no hand-builtJobStatuscan mask a decode mismatch — and it asserts the round trip on the way (prevStatus[0].To == to,ErrorCode == 0,committed[0] == watermark)."seeded generation after its first committed range"⇒false, and the real-engine steady-state churn block ofTestCollectChangesSeedRangeDeliversInheritedDeletestill asserts0inserts and0deletes with the option off. The cuVS boundedness fix from the previous round is not lost by this revision.[P3] The seed-range fixture leaked the batches
Nextreturned. The ownership contract was confirmed as described:ChangesHandle.Nexttransfers each nonemptydata/tombstonebatch to the caller,changes.Close()releases the handle's own resources rather than batches already handed out, and neithercheckInsertBatchnorcheckTombstoneBatchfrees anything — so the leak was present on the success path, not only on assertion/error exits. The fix is the one specified: a dedicatedreadMP := mpool.MustNew("iscp-seed-range-read")replaces the sharedcommon.DebugAllocator, acountAndReleaseclosure cleans both batches in adeferso no exit path can skip it, and the test ends onrequire.Equal(t, readBaseline, readMP.Stats().NumCurrBytes.Load()). Measured on this head: 0 outstanding bytes after all six range reads and handle closes (was 96). Agreed that this is a test-fixture ownership issue — no production allocation path changed, and none of the 96 bytes was a production regression.Branch state and CI (head
7590df0d88)The branch is a single linear commit on current
main6af999e7b8(HEAD~1 == 6af999e7b8 == origin/main;git rev-list --count HEAD..origin/main=0,git rev-list --merges --count origin/main..HEAD=0), so the PR is notBEHIND.maindid not move during this turn, so no rebase was needed and none was performed — this sync is a content change answering the second review, not a head chase.mergeablestayedMERGEABLEthroughout (no conflict at any point).mergeStateStatusisBLOCKEDonly becausereviewDecisionis stillCHANGES_REQUESTEDfrom the review submitted at headd36ea83ad5; both of its threads are answered by this head and the two earlier threads are resolved. See the CI bullets under Residual risk for the infrastructure failure that fired twice on superseded heads and was then verified resolved twice.This is the twelfth sync of the same change, and only the second that changes content. Sync 5 carried the first review's scoping fix (50716 → 65124 bytes / 1500 lines); syncs 6 through 11 were pure rebases, each verified byte-identical to its predecessor (
cmp-clean, all six hashing to sha2562a9b19b37fbe1b0222ec56dddfbe88f3bbf2cb2fd4b74dda048d0780d370a919, no conflict in any of them). That identity chain deliberately ends here. This sync carries the second review's durable-watermark gate and the seed-range fixture's batch ownership, so the patch is now 79123 bytes / 1863 lines over 15 files, sha25631e97acb66480d99b873ebcb4f5d091009d50d9fdbb65c32f9631d8985c89bd7. The delta from21b43cc0c2is +271/−66 across exactly five files:pkg/iscp/iteration.go(the gate plusGetJobSpecs),pkg/iscp/collect_changes_policy_test.go,pkg/iscp/iteration_test.go,pkg/vm/engine/test/change_handle_seed_range_test.goandpkg/vm/engine/test/change_handle_test.go. The last two entered the file list only because theGetJobSpecssignature change reaches their existing call sites andgostubstubs. No filtering, sinker, engine or BVT file changed:git diff 21b43cc0c2..HEAD -- pkg/vm/engine/disttae/ pkg/fulltext2/ pkg/vm/engine/change_handle_net_effect.go pkg/vm/engine/disttae/logtailreplay/ test/distributed/is empty, and the BVT blob SHAs are unchanged (.sqlddcc68433a6de25fe29f2d991572bb2a082b3ead,.result2d9a89425020a8783e7ed3374df1b7e8b577b493).Every one of the eleven rebases was content-preserving, and each was checked rather than assumed. Each compared its own base..head pair against the previous head's pair (
cmpplus sha256, both patch files kept), which is the only sound form of the check: a two-dot diff taken across differing bases also contains the reverse of the newly gained upstream commits, sogit diff 59e2ba9c18..HEAD -- test/distributed/looks non-empty whilegit diff <base>..<head> -- test/distributed/on each side is identical. Sync 12 has no such pair to compare — it is a real content change, audited by the file-level delta above instead.No conflicts occurred in any of the eleven rebases, so no semantic resolution was needed. The three syncs in this turn gained four upstream commits, each audited separately against this PR's then-13 files (all
comm -12intersections taken from the same base, since the naiveHEAD..origin/maintwo-dot form also lists this PR's own files as reversed):d382fd5fa2fix: honor database qualifiers in correlated column binding (fix: honor database qualifiers in correlated column binding #29891) andf42af4dfcbfix(sql): unify replayable MySQL column type metadata (fix(sql): unify replayable MySQL column type metadata #29893): 159 files, +5111/-4153, of which 125 aretest/distributed/cases/**.resultfiles regenerated by fix(sql): unify replayable MySQL column type metadata #29893 and 34 are sources underpkg/sql/plan,pkg/container/types,pkg/cdc,pkg/testsplus one Python client test. Zero file overlap. Symbol overlap is a single substring hit in a file this PR does not touch:grep -E 'InitSQL|ConsumerInfo|CollectChanges|KeepTrailingDeletes|isRecoveryMode|ChangeHandle|logtailreplay|fulltext2|pkg/iscp'over the upstream diff matches only the path and---/+++header lines oftest/distributed/cases/fulltext/fulltext2.result(the literal wordfulltext2), a different BVT case;pkg/cdc/sinker_v2.go, the nearest gained file to this PR's domain, changed 2 lines insidecdcTargetColumnTypeMatchesand references none of those symbols.e6606fc542fix: remove lifecycle waits from embedded race fixtures (fix: remove lifecycle waits from embedded race fixtures #29875): 58 files, +3039/-607, all.go, zerotest/distributedentries. Zero file overlap. The same symbol grep returns one hit,t.Fatal("replacement reader did not reach CollectChanges")inpkg/tests/sqlintegration/ddl_test.go; that ispkg/cdc's ownCollectChangesvar (pkg/cdc/util.go:762), a distinct symbol in a package that does not importpkg/iscp(verified: nomatrixone/pkg/iscpimport anywhere inpkg/cdc/*.go), and the adjacent hunk inpkg/cdc/table_change_stream.go:1443is an unrelated local-shadow fix (detector := s.tableDetector). This PR'siscp.CollectChangesis comment-only anyway (see thepkg/iscp/util.gohunk: 3 added lines, all comment).6af999e7b8fix(stage): reject access to disabled stages (fix(stage): reject access to disabled stages #29833): 16 files, zero file overlap, zero symbol-grep hits. Its only twotest/distributedentries arecases/stage/remove_stage_files.{sql,result}, not this PR'sgit4data/branch/edge/case.That is why the patch survived byte-for-byte all three times. Earlier syncs gained
a6eba2d7b5(feat(collation): establish versioned index key format #29834),e454407a1a(fix: validate identifier encoding and preserve legacy catalog keys #29861),1988a97ffc(fix: preserve parquet float infinities and bounded string widths #29831),5f94c8f88a(fix(embed): exclude cluster startup from recovery workload budget #29880),f09d4788fd(fix(collation): align unique index duplicate precheck #29890) and sync 8's seven commits (4e959d7dd6fix(plan): don't panic on nil vector-search thread variables in procedures #29871,73149a3e90fix(plan): don't panic on nil IVFPQ/CAGRA variables in procedures #29872,485bdf6b01fix(types): preserve Decimal128 precision and single rounding #29853,c3d80e2310fix(load): fail strict JSONLINE scan on incomplete record at EOF #29855,1f53fc85fffix(frontend): validate and safely initialize Starlark LLM clients #29870,9dcd82d0a8fix parquet outfile round trips and splitting #29804,61d8e2887ffix(types): round Decimal256 text once to the column scale #29884) since the review base42d42546fd, and did touch twopkg/vm/engine/disttaefiles and onepkg/vm/engine/testfile — though not thechange_handle*.gofiles this PR changes — sodisttaeandengine/testare re-run in full on every sync rather than assumed safe.Blast-radius claims re-verified on this head, not carried over:
iscp.CollectChangesstill has exactly two callers (pkg/iscp/iteration.go:238,pkg/iscp/executor.go:794); in production codeengine.WithCollectChangesKeepTrailingDeletesappears only at the gatepkg/iscp/iteration.go:414plus the two propagation pointspkg/vm/engine/disttae/change_handle.go:203and:600; andiscp.GetJobSpecshas exactly one production caller (pkg/iscp/iteration.go:112) plus the seven test call/stub sites updated here.pkg/cdc,pkg/publication,pkg/frontend/databranchutilsandcolexec/table_function/table_changes.gokeep their own wrappers.go vetis clean over all ten packages that importpkg/iscp.Why the rebase loop is bounded rather than open-ended. Eleven rebases were needed because
mainkept moving while each head was in CI and in review, and the head a reviewer reads must be the head that can merge. Each got the same audit — byte-identical patch, zero file overlap, symbol-overlap grep, all six suites re-run — and each superseded run was left alone instead of rerun. This turn needed none:mainis still6af999e7b8andbehindis0, so the only push was the content change the review asked for.fix(sql): unify replayable MySQL column type metadata #29893 changes rendered column-type metadata, so its effect on this PR's BVT
.resultwas checked rather than assumed. It makesdesc/show columns/show create tableemit MySQL-replayable type text (INT(11)→int,CHAR(10)→char(10),DATE(0)→date,DECIMAL(10,2)→decimal(10,2),bool→boolean,TIMESTAMP(6)→timestamp) through the newtypes.FormatSQLColumnType(pkg/container/types/sql_type.go) andformatColTypeForSQLMode(pkg/sql/plan/build_show_util.go) — which is exactly why 125 unrelated.resultfiles were regenerated.branch_fulltext2_inherited_delete.sqlissues noshow create table,show columns,desc/describeorinformation_schema.columnsstatement (its onlybool*token is the fulltextin boolean modesearch modifier), and fix(sql): unify replayable MySQL column type metadata #29893 changed noexplainoutput anywhere: grepping itstest/distributed/cases/**delta forTable Function|explain|->returns nothing. Both BVT blobs are therefore untouched and still equal the anchors.sqlddcc68433a6de25fe29f2d991572bb2a082b3ead/.result2d9a89425020a8783e7ed3374df1b7e8b577b493, so no.resultregeneration was needed and none was done. Syncs 10 and 11 cannot affect them either: fix: remove lifecycle waits from embedded race fixtures #29875 changed notest/distributedfile at all, and fix(stage): reject access to disabled stages #29833's only two arecases/stage/remove_stage_files.{sql,result}.Re-validated locally on the current head
7590df0d88(all six suites re-run after this content change, not carried over):The BVT case was not re-run locally:
git diff 21b43cc0c2..HEAD -- test/distributed/is empty and the blob SHAs match, so the case is byte-identical to the one that passed 32/32 locally twice and green in CI five times. CI re-runs the BVT suites on every push (see below).b69b054c35(run38114901262): three failed jobs, one unrelated root-cause chain.UT Coverage on Ubuntu/x86(job114397928362) failed on exactly one test, in a package this PR does not touch:pkg/embed TestCrossTargetUpgradeRecovery/manual-ready-steps-4.0.13,Received unexpected error: context deadline exceededatpkg/embed/upgrade_recovery_test.go:105(406.49s; package 718.574s;build failures: 0). Line 105 is arequire.NoErrorondb.ExecContext(ctx, ...)whosectxis that test's owncontext.WithTimeout(t.Context(), 5*time.Minute)created before the cluster starts, and the same log records the shared fixtureMO_UT_SETUP fixture=embedded-cluster cluster_id=10026 phase=service-start wait=6m38.103917279s— the embedded-cluster admission wait alone exceeded the test's 5-minute budget, so the deadline fired before the recovery SQL ran.Matrixone Coverage execution / Coverage(job114406305513) is purely derivative: stepVerify coverage prerequisitesgotprerequisites_ready=falseand reportedcoverage merge blocked: a required producer did not publish a complete coverage profile.CI Required(job114410946399) is the aggregate gate: its log shows"coverage_status": "failed"andUnhandled error: Error: matrixone-ut-coverage: failure.git diff 03c34f837b b69b054c35 -- pkg/embedis empty; the byte-identical diff passed this exact check twice before (38106659513,38112356887); base commit03c34f837b(fix(idxcron): preserve quoted catalog names and JSON literals #29866) passedUT Coverageon its own run38107824138with the samepkg/embedcontent; and on run38114901262every check that does exercise this PR was green —UT Test on Ubuntu/x86SUCCESS,SCA Test on Linux/arm64SUCCESS,multi cn e2e bvt test docker compose(PROXY)SUCCESS,multi CN e2e BVT (COMPOSE, PESSIMISTIC)SUCCESS, shared build SUCCESS.TestCrossTargetUpgradeRecovery,upgrade_recovery_test,MO_UT_SETUP embedded-cluster admission,UT Coverage coverage merge blocked producer, incl. PRs; the nearest CI-load families [CI] Ubuntu/x86 race UT TestAffectedRows shared embedded-cluster timeout #29124 and [Bug]: Ubuntu/x86 race UT fails unrelated timing and HAKeeper tests under CI load #27963 are closed and cover different tests), so none was created or commented, and no blocker marker was invented.origin/main == HEAD~1, 0 behind), so the single allowed transient rerun was issued —gh run rerun 38114901262 --failed(rc=0,attempt=2,UT Coverageobservedin_progressat 07:01:33Z). That attempt was then superseded by the rebase push described above; a later head creates a new run, and no second rerun of that run is permitted or planned.59e2ba9c18(run38122210005) finished fully green —CI preflight, shared build,UT Test on Ubuntu/x86,SCA Test on Linux/arm64,UT Coverage on Ubuntu/x86,multi cn e2e bvt test docker compose(PROXY),multi CN e2e BVT (COMPOSE, PESSIMISTIC),Matrixone Coverage execution / CoverageandCI RequiredallSUCCESS. So thepkg/embedcoverage-chain flake documented above did not recur once the head was synced. No rerun was issued for that run, and none is planned for a run whose head has since changed.a5a73f8e6f(run38134847433, attempt 1) is terminal —completed/failure— and every check that exercises this PR passed. Green on that head:CI preflight,Build MatrixOne (shared),pr-size-label,Check coverage eligibility,UT Test on Ubuntu/x86(SUCCESS 12:41:25Z),SCA Test on Linux/arm64,multi cn e2e bvt test docker compose(PROXY),multi CN e2e BVT (COMPOSE, PESSIMISTIC)andSummary. The three red jobs form one infrastructure chain documented two bullets below. That head was superseded by this rebase, so the stale run was not rerun (policy forbids rerunning a run whose head changed; its attempt stayed1), and the push ofcaa62ac8castarted run38141665483. The run started for the intermediate head4cd18d9bb6was likewise superseded by the newer head and never rerun.caa62ac8ca(run38141665483, attempt 1) hit the same infrastructure failure again; every check that exercises this PR was green.CI preflight,Build MatrixOne (shared),pr-size-label,Check coverage eligibility,SCA Test on Linux/arm64,Summaryand both BVT jobs (multi cn e2e bvt test docker compose(PROXY),multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)) areSUCCESS; That run has since terminated ascompleted/cancelled(attempt stayed 1):UT Test on Ubuntu/x86showscancelledat 14:17:37Z only because the sync-8 force-push at 14:17:03Z superseded the head and GitHub cancelled the in-flight run, and the aggregatorCI Requiredthen closedfailureat 14:17:43Z — so its three genuine reds are one coverage chain, not three causes.UT Coverage on Ubuntu/x86(job 114476671613) failed after 1m51s at the identical step5 Checkout CI coverage helperwith the identicalgnutls_handshake() failed/could not fetch b1df6a61d240f46d6ad5926527ae53607e09f79c from promisor remote/ git exit 128 — same helper commitb0f959479893a3ab54ff3d9422e135ae2e9c67b2, same missing blob, and8 Run coverage unit testsagainskipped, so no PR code ran (the--filter=blob:none --depth=1ref fetch itself succeeded; only the lazy blob fetch duringgit checkoutfailed). Its predicted derivativeMatrixone Coverage execution / Coveragethen also failed. It is not this PR: the same step succeeded in the same window for three other fork PRs on the samepull_request_targetevent (runs38134778418c6c1cf7fd711:14→11:44Z,38135714724d53a7f706011:29→11:58Z,381365484241600f5169811:43→12:11Z) and for this PR's own earlier head59e2ba9c18(run38122210005, same fork/branch/event). Both occurrences are recorded on #27739 (occurrence 1, occurrence 2). Recovery: that run was stillin_progress(a pending run must not be rerun) and its head is no longer the PR head after this rebase (a run whose head changed must not be rerun), so no rerun was issued for it — its attempt stays 1. The rebase push starts a fresh run ond36ea83ad5that re-executes the coverage chain from scratch.d36ea83ad5and5b432ef87a. Neither carried a byte that this head does not still carry in the affected packages — the coverage producer runs the repo's unit tests, and sync 12 changed onlypkg/iscpandpkg/vm/engine/test, both re-run green locally on this head — so those two runs remain valid evidence that the checkout fault is intermittent infrastructure rather than something this PR triggers. Run38146548803(pull_request_target, attempt 1) is terminalcompleted/successwith zero failed or cancelled jobs — the first fully green run since59e2ba9c18. Every one of the eleven non-skipped jobs succeeded:CI preflight(14:17:46→14:17:55Z),Build MatrixOne (shared)(14:17:57→14:27:34Z),UT Test on Ubuntu/x86(14:18:08→15:37:41Z),pr-size-label,Check coverage eligibility,SCA Test on Linux/arm64(14:18:11→14:58:38Z),UT Coverage on Ubuntu/x86(14:18:18→14:48:20Z),multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)(14:27:36→15:20:16Z),multi cn e2e bvt test docker compose(PROXY)(14:27:37→15:08:41Z),Matrixone Coverage execution / Coverage(15:20:18→15:21:14Z) andCI Required(15:37:43→15:37:50Z). The step that had failed on both previous heads,5 Checkout CI coverage helper, completedsuccess(job114491203520) and8 Run coverage unit testsactually executed, so the whole chain that was red twice is green end to end. The CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739 blocker is therefore verified resolved and its entry was removed from the pinned CI-blocker marker ({"blockers":[]}); no rerun produced this result — it came from the rebase push, and the run's attempt is 1. Nothing about the change under test differs fromcaa62ac8ca(byte-identical patch), which is exactly why the only variable was the runner: the fault is intermittent infrastructure, still open upstream at CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739, and nothing in this PR fixed or hid it. The sync-9 rebase to5b432ef87asuperseded that run without changing a byte of the patch, and run38155241350on5b432ef87athen finished fully green as well — terminalcompleted/success, attempt 1, all eleven non-skipped jobssuccess, includingUT Coverage on Ubuntu/x86(16:27:13→16:58:36Z),Coverage(17:25:11→17:25:58Z) andCI Required(17:40:18→17:40:22Z). Two consecutive heads with the whole coverage chain green means the CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739 resolution no longer rests on one lucky runner.mainthen moved twice more within ~25 minutes, producing the sync-10 head61f1f4f1bdand the sync-11 head21b43cc0c2; run38162443582wasin_progresson61f1f4f1bdwhen sync-11 superseded it, and run38163240580on21b43cc0c2was likewise stillin_progresswhen this turn's content push superseded it — GitHub recorded both ascancelled, attempt 1, and per policy neither was rerun (a pending run must not be rerun, and a run whose head changed must not be rerun). The current head's run is38167943515(created 2026-10-11T19:25:18Z, attempt 1); at the time of writingCI preflight,pr-size-label,Check coverage eligibilityandBuild MatrixOne (shared)are alreadysuccessandUT Coverage on Ubuntu/x86is executing — i.e. it is past theCheckout CI coverage helperstep that failed twice on the two superseded heads. No rerun has been issued for any run in this PR's history.optools/run_bvt_group.shdiscovers cases withfind ... -name '*.sql'(there is no manifest to register) and maps thegit4datatop-level directory to group 0. Job114375708145(multi cn e2e bvt test docker compose(PROXY)) loggedRun BVT group 0: 1004 scriptswithtest/distributed/cases/git4data/branch/edge/branch_fulltext2_inherited_delete.sqlin its include list, and reportedconclusion=successwith no failed step — so the case is exercised by CI, not only by a localmo-testerrun (which passed 32/32 twice).Residual risk
Scope of the option is bounded, not unconditional. It is requested only for an
InitSQL-seeded job generation whose durable consumption may still lag the range start — in practice the single seed range of a copied index, any retry of it, and any range a crash left selected-but-unconsumed. Steady-state maintenance of every index, cloned or not, keeps the default net effect, so insert-then-delete churn still cancels and no append-only sink accumulates delete-only history. The gate reads durablemo_iscp_logcolumns the executor already owns (job_statusplus thewatermarkthe scheduler itself reads back to pick the nextfrom): no generation metadata is plumbed throughCollectChanges, there is no per-algorithm dispatch, and no second filtering state machine.Residual extra tombstone, confined to the seed/retry window. Inside that window a key both inserted and deleted emits a tombstone where it previously emitted nothing — deliberate at-least-once deletion and a no-op for every sinker (table above). For the append-only cuVS sinks it is at most one extra distinct pk in
cdc_tailper cloned index generation, the same tradeoff already accepted for CDC restart viaisRecoveryMode. Because it cannot grow with churn,CuvsUpdatablecounting only inserts+upserts (cuvs/idxcron/cuvs_updatable.go:259-260) is no longer a reclamation gap on this path.A shared retry range can widen the opt-in by one range. The seed range itself is never shared (
table_entry.go:163-174), and anInitSQLjob still inJobStage_Initis forced unshared (:182-183), but a seeded job's retry range can be shared, and one lagging member opts the whole read in for that single range. Bounded by the same retry lifetime, and the direction is at-least-once.A generation whose first range never commits stays opted in — by design. Until
watermarkreaches a persistedjob_status.To, the consumer state genuinely can predate the range start, so the retry must keep the tombstone or the bug returns. This covers three distinct paths, each of which would otherwise be silently wrong: no range selected yet (Toempty), a range selected but abandoned before any sink work (watermarkstill atFrom,ErrorCodestill0— the second review's counterexample), and a range that failed and is being retried (ErrorCode != 0, which stays armed even after a maintenance flush moves the column past it). The extra deletes are bounded by that one range's content per attempt, not by the index's lifetime. A permanent failure ends it outright (iteration.go:976-994setsPermanentErrorThresholdand flushesISCPJobState_Error;table_entry.go:148then skips the job). A job that keeps failing transiently retries the same range forever under ISCP's existing at-least-once contract and re-emits its inserts on every attempt today; this change adds a delete side to that already-repeated frame. It is a stuck job that is already visible and already growing its tail, not silent growth on a healthy one.GetJobSpecsreads one extra column.watermarkisVARCHAR NOT NULLin the existing DDL (pkg/frontend/predefined.go:307) and is already selected by the replay snapshot, so there is no schema, migration, upgrade-entry or CDC-template change; the added cost is one morevarchardecode permo_iscp_logrow per iteration, on a path that already unmarshals two JSON columns for the same rows. A row whosewatermarkis absent from the result would decode as the zero TS, which fails towards keeping the tombstone rather than towards dropping it.Forward fix only. A branch index already corrupted before this change still holds the stale posting until it is rebuilt (
ALTER TABLE ... ALTER REINDEX ... FORCE_SYNC) or its rows are re-deleted. No data migration or background repair is attempted.Passing only after
REINDEX, after cache warming, or by adding a base-table join would not prove the persisted index is correct — all three are explicitly excluded from the proofs above.Mergify may re-merge
maininto this branch..github/mergify.ymlhas anAuto update branchrule (created-at>=00:10 ago->update:), which is what produced the earlier merge commit. If it fires again the linear history becomes a merge again. That is cosmetic, but any such update should be re-audited the way each of the eleven rebases was (diff-preservation check plus a re-run of the focused suites) rather than assumed safe, because this PR's neighbourhood is actively developed upstream: the sixteen commits gained since the review base42d42546fdlanded inpkg/bootstrap,pkg/catalog,pkg/cdc,pkg/cnservice,pkg/common/collation,pkg/common/runtime,pkg/container/types,pkg/embed,pkg/frontend,pkg/incrservice,pkg/monlp/llm,pkg/sql/*,pkg/stage/stageutil,pkg/taskservice,pkg/tnservice,pkg/txn/client,pkg/vm/message,pkg/vm/engine/disttae,pkg/vm/engine/tae/db/testandpkg/vm/engine/test, two of which are packages this PR modifies (though not thechange_handle*.gofiles it changes). That cadence — four commits in the ~2 hours of this turn alone — is why the audit is per-rebase and mechanical rather than a one-off judgement.The red chain was unrelated infrastructure, tracked at CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739; it fired twice on two superseded heads of this PR and was then verified resolved on two consecutive heads (
d36ea83ad5run38146548803and5b432ef87arun38155241350, both fully green — see the CI bullet above; the audit trail below is kept because the upstream fault is intermittent and still open). Run38134847433ata5a73f8e6f(attempt 1) passedCI preflight,Build MatrixOne (shared),pr-size-label,Check coverage eligibility,UT Test on Ubuntu/x86,SCA Test on Linux/arm64, both BVT jobs andSummary;Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86(job 114456689217) failed in 74 seconds at theCheckout CI coverage helperstep, before any Go build or test command ran:This is a runner-side TLS transport failure while sparse-checking-out the shared
matrixorigin/CIhelper repository (--filter=blob:none, promisor blob fetch). It is independent of the PR diff: no test executed (8 Run coverage unit testsisskipped), no coverage profile was produced, and this PR touches no workflow or orchestration file. It is the same signature already tracked by #27739 (CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object), with #27843, #28411 and #28113 as related records; a reproduction record for this occurrence was added to CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739. The step that performs this checkout lives in the protected CI scope, so nothing here changes it. The other two red jobs are verified derivatives of it, not separate causes:Matrixone Coverage execution / Coverage(job 114465205283) was invoked withprerequisites_ready: falseand exited in its first step withcoverage merge blocked: a required producer did not publish a complete coverage profile; no coverage verdict was calculated(runningmatrixorigin/CI/.github/workflows/coverage-merge.yaml@main, no MatrixOne code), and theCI Requiredaggregator (job 114472385247) recordedmatrixone-ci: success,matrixone-compose-ci: successandmatrixone-standalone-ci: successnext tomatrixone-ut-coverage: failure(coverage_ready: true,coverage_status: external_timeout_or_cancellation) andmatrixone-coverage-merge: failure, then threwError: matrixone-ut-coverage: failurefromverifyResultsat.github/ci/change-scope.cjs:90— itself inside the protected CI scope. Recovery, in order of policy: the head was one upstream commit behind at occurrence 1, so that recovery was the sync-7 rebase rather than a rerun (a run whose head has changed must not be rerun). The fresh run oncaa62ac8cathen re-executed the coverage chain and hit the identical failure (job114476671613, same helper commit, same blobb1df6a61…), so the head is not the variable: the patch is byte-identical to the one whose coverage job passed at59e2ba9c18. Occurrence 2's run was stillin_progresswhenmainmoved by seven commits and the PR wentBEHINDagain, so the sync-8 rebase tod36ea83ad5superseded it — and a superseded run must not be rerun either, which is why no rerun was issued for38141665483(attempt stays 1) and none is planned. The rebase push starts a fresh run on the new head that re-executes the coverage chain from scratch; that new run, not a rerun, is the recovery. No test, expected result or required check is weakened to make the failure disappear, and the durable repair (retry/backoff on the promisor blob fetch, or dropping--filter=blob:nonefor this small helper checkout) is in the protected CI scope and belongs to CI owners. This is now resolved and verified: run38146548803ond36ea83ad5finishedcompleted/successwithUT Coverage->Coverage->CI Requiredall green, so the pinned CI-blocker comment was updated to a resolution record and its marker emptied ({"blockers":[]}) — no unresolved CI blocker remains. The upstream tracking issue CI: UT Coverage checkout fails when fetching matrixorigin/CI promisor object #27739 stays open because the runner-side fault is intermittent and was not fixed by anything here.The earlier
pkg/embedflake is fixed upstream and is in this head's base. The only test failure ever seen on this change was the load-drivenpkg/embed TestCrossTargetUpgradeRecoverycontext-deadline flake on the byte-identical headb69b054c35(admission wait 6m38s vs. that test's own 5-minute budget), which also blocked the derivativeCoverageandCI Requiredjobs; it did not recur on59e2ba9c18, whose run finished fully green, nor ona5a73f8e6f, whereUT Coveragefailed for the unrelated TLS/promisor reason above without executing a single test. It was unrelated to this change and could not be fixed from it — the proper repair belonged topkg/embed/CI-harness owners. That repair has now landed upstream as5f94c8f88afix(embed): exclude cluster startup from recovery workload budget (fix(embed): exclude cluster startup from recovery workload budget #29880), which is in this head's base: it dropsWithTestAdmissionContextand reworksnewRecoveryClusterStarterso cluster startup no longer consumes the recovery workload budget. If anything still recurs, the levers are a head sync withmainor a maintainer rerun.No CI workflow/orchestration file under
.github/workflows/**or.github/ci/**is modified by this PR. Themo-testerrepository was only executed, never modified, committed or pushed.