Repository navigation
fix(tae): propagate v12 checkpoint conversion errors - #29685
mergify[bot] merged 36 commits into
Conversation
Return checkpoint conversion and consumer errors instead of silently publishing incomplete metadata.\n\nFixes matrixorigin#29263
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. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 2d3ce3e3289a63544927923d8701a451be3ff73e
Assessment: request_changes
Reviewed all 18 changed files and affected callers. Reusing the existing conversion, iteration, sinker and cleanup owners is reasonable. The previous diagnostic-close and successful repeated-publication defects are fixed, but ambiguous repeated admission still leaks capacity.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0
- P2
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:1972: The new GC lifecycle prepares an already-published metadata name again before its previous marker is removed, and both the repeated marker Write and Stat fail. The ambiguous branch at lines 1949–1957 bypasses this new identity-balancing helper.
Impact: Preparation increments pending again for the same marker. Recovery removes the single marker and decrements only once, leaving a permanent phantom reservation. Repeated occurrences can exhaust the 10,000-slot admission limit despite an empty cleanup backlog. Balance repeated identities on the ambiguous path as well as the successful path.
Evidence: TestReviewRepeatedAmbiguousMetadataAdmission performed a real metadata write, adoption and publication, injected Write/Stat failures on re-preparation, then ran two cleanup cycles. It failed with pending=1, markers=0 and active=0 while published metadata remained intact. See ambiguous-metadata-repro.log and checks/1791985131289747926-2.json. A diagnostic overlay balancing this branch passed the reproduction and normal-publication controls; the candidate source was unchanged.
Validation:
-
Artifacts are retained under /home/xupeng/.local/state/mo-bot/jobs/e694de63e2e14f25c9724901/attempt-1. review-evidence.json correlates eight command/source/exit receipts with logs; review-scope.json records the complete review map.
-
Isolation preflight passed. Verified 192 native inputs and 46 retained artifacts against the current candidate and reconciled the repository-owned build receipt and log before reuse.
-
Targeted conversion allocation, loaded-block cleanup/retry, snapshot rollback, backup cleanup, GC spill/error cleanup and dependency-replay tests passed: targeted-tests.log, receipt checks/1791984985401972393-2.json.
-
RPC error propagation, backup directory handling and additional GC admission/error tests passed: consumer-tests.log, receipt checks/1791985088729546565-2.json. Fresh diagnostic-close, repeated-publication, replay-adoption and uncertain-marker controls also passed.
-
Synthetic empty-checkpoint Update benchmark with 100,000 existing tables measured approximately 34.7 ms and 23.0 MB per operation at head versus 1.14 ms and 12.7 KB for the extracted base method. Snapshot rollback adds substantial copying; ordinary SQL paths do not directly execute this copying. See snapshot-benchmark.log and checks/1791985033031586089-2.json.
-
Frozen patch comparison, whitespace checks, source cleanliness and final receipt reconciliation passed.
Limitations:
-
Runtime reproductions exercise production components with injected filesystem errors, not a full TN/SQL deployment. No race or sustained concurrency run was performed.
-
The benchmark uses five iterations and the extracted base Update method with compatible current helpers; it does not establish SQL latency or throughput.
-
The supplied evidence contains successful core CI statuses but no raw CI logs or local_validation gates. The linked issue's full text was absent; its contract was assessed from the supplied PR evidence.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: c5b4ffadf5f892184f28c796e8a1fdf9e339f6eb
Assessment: request_changes
Reviewed all 18 changed files, callers and supplied review concerns. Reusing the existing conversion and cleanup owners is reasonable, and the latest admission-accounting fix passes. Two reproduced publication/recovery defects remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
-
P1
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:2703: A scan writes snapshot/account metadata, then the GC metadata write persists but returns an error. Deleting GC metadata fails while deleting the snapshot/account files succeeds.
Impact: Rollback deletes recovery state that the surviving GC metadata still requires. Restart adopts that metadata and advances the scan watermark without restoring its snapshot protection state, allowing subsequent GC to miss protected objects. Preserve the coupled recovery files until metadata rollback is confirmed, or prevent adoption of an incomplete group.
Evidence: TestReviewFailedScanPreservesSnapshotForAdoptedMetadata exercised production scan and Replay: gc/snap_1-0_3-0.snap was deleted, replay advanced to 3-0, and restored snapshot-object tables numbered zero. Preserving the recovery files in a diagnostic control restored one table and passed. See final-candidate-probes.log and checks/1792039053484690889-2.json. -
P2
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:1444: ExecuteGlobalCheckpointBasedGC succeeds, but the preceding appendFilesToWAL call fails before Publish releases prepared ownership.
Impact: The retained scanned window keeps its metadata reservation active. Cleanup defers it, and the first same-window retry after WAL recovery fails with 'already active'. Release prepared ownership at the caller's WAL-error boundary. A second retry recovers; this causes an unnecessary failed GC cycle rather than a permanent deadlock.
Evidence: TestReviewGlobalGCReleasesOwnerAfterWALFailure reached the production WAL boundary and observed active=true, prepared=1, followed by the retry error. Normal publication passed; a diagnostic cleanup defer made WAL recovery pass. See final-candidate-probes.log and checks/1792039053484690889-2.json.
Validation:
-
Artifacts: /home/xupeng/.local/state/mo-bot/jobs/6a5962b8f5ce60af7ca55b0b/attempt-4. review-scope.json records coverage; review-evidence.json correlates commands, source fingerprints, exits and retained logs.
-
Frozen head/base/patch, clean checkout, whitespace and formatting verified. Reviewed 10 production files (+772/-88) and eight test files (+1170/-2).
-
Isolation preflight passed. Verified 192 current native inputs and 46 retained artifacts against the repository-owned build before reuse.
-
Current-head ambiguous-admission, repeated-admission and Close-ownership regressions passed: targeted-tests.log, receipt 1792038724696654177-2.json.
-
Both final candidate probes failed their behavioral assertions. Diagnostic controls passed under receipt 1792039094380124975-2.json; these controls are not candidate passes.
-
Verified retained conversion, multi-block cleanup/retry, backup, RPC and snapshot evidence against receipts, logs and the intervening two-file delta. Rechecked the changed admission path locally.
-
Reused the unchanged snapshot benchmark: at 100,000 tables, empty-checkpoint Update measured 34.7 ms and 23.0 MB/op versus 1.14 ms and 12.7 KB/op for the extracted base method. Snapshot copying and marker I/O add GC cost; ordinary SQL does not directly execute this copying.
Limitations:
-
The frozen packet omits issue #29263's full body and contains no local_validation gates or raw CI logs.
-
Probes use production components with injected filesystem/WAL failures and component restart, not a full TN crash or demonstrated deletion of snapshot-protected data.
-
No fresh race, full-cluster or upgrade run was performed. The five-iteration benchmark does not establish SQL throughput or sustained GC performance.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: db930dabe250fbdf34a9a40a7974d47bf7b88b26
Assessment: request_changes
Reviewed all 18 changed files, callers and supplied concerns. Error propagation and rollback appropriately reuse existing owners, and both latest reported defects now pass regression tests. One reproduced cleanup-ownership defect remains when a failed scan is retried for the same checkpoint range.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:2273: A GC metadata write persists but reports failure, and its cleanup deletion also fails. After storage recovers, scanning the same checkpoint range creates different data objects and replaces the same gc__.ckp filename.
Impact: Adoption of that filename releases cleanup markers for the previous attempt's objects even though the replacement metadata does not reference them. Those objects remain permanently orphaned. Require proof that the specific object was adopted, or preserve distinct attempt identities, before releasing its cleanup marker.
Evidence: TestReviewCleanerRetryPreservesFailedAttemptOwnership reproduces this through scanCheckpointsLocked with a real persisted checkpoint: after successful retry and repeated cleanup, the old object still exists and remaining_markers=[]. A separate GCWindow probe reproduces it; its different-range control passes. Logs: cleaner-retry.log and retry-identity.log; receipts: checks/1792122521149258259-4.json and checks/1792122457894703579-3.json.
Validation:
-
Artifacts retained under /home/xupeng/.local/state/mo-bot/jobs/c04ac1ca1052a17e2cd06561/attempt-1. review-evidence.json reconciles commands, source fingerprints, exits, logs and diagnostic overlays; review-scope.json records coverage.
-
Isolation preflight and fresh repository-owned native build passed. Verified 192 native inputs and 52 artifacts. Final audit confirmed the frozen head, clean source, formatting and whitespace.
-
48 targeted tests passed across GC, logtail, RPC, backup and ioutil, including multi-block v12 failure/cleanup/retry and both previous snapshot-recovery/WAL regressions. Logs: gc-regressions.log and consumer-regressions.log; receipts: 1792122397981471512-4.json and 1792122480569142929-3.json.
-
Both new same-range retry probes failed the orphan-reclamation assertion; the different-range control passed.
-
Controlled five-iteration benchmark at 100,000 tables: empty-checkpoint SnapshotMeta.Update measured 66.73 ms and 22.97 MB/op versus 2.86 ms and 12.7 KB/op for the extracted merge-base method. Snapshot copying adds GC allocation and CPU cost; ordinary SQL does not directly execute this copying. Receipt: 1792122602620122968-5.json.
Limitations:
-
The supplied packet omits issue #29263's full body and raw CI logs; local_validation is empty.
-
Fault probes use production components with injected MemoryFS failures, not a full TN crash.
-
No fresh race, full-cluster or upgrade run. The component benchmark does not establish sustained GC or SQL throughput.
# Conflicts: # pkg/tests/issues/issue_29876_test.go
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 4bda03f0f8b52fac12ccfce4f0f17ebaa47d94c5
Assessment: request_changes
Reviewed the complete 18-file delta and recorded review concerns. Error propagation appropriately uses the existing reader and iterator owners, but GC cleanup still violates durable ownership across publication and restart. Three reproduced failures block approval.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
-
P1
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:2814: A scan successfully persists snapshot, account and GC metadata, but Publish encounters a cleanup-marker deletion error. If rollback cannot delete the GC metadata, it remains discoverable.
Impact: Assigning the marker-release error to err invokes the failed-scan defer, which deletes snapshot/account files before attempting GC metadata deletion. Restart can then adopt that GC checkpoint and advance its watermark without the snapshot-protection state. Keep post-publication cleanup failures retryable without rolling back recovery dependencies.
Evidence: TestReviewPublishCleanupFailurePreservesSnapshotForAdoptedMetadata reproduced a missing gc/snap_1-0_3-0.snap while Replay adopted gc_1-0_3-0.ckp, advanced to 3-0 and restored zero snapshot-object tables. See review-gc-ownership.log and receipt checks/1792382000234910514-3.json. -
P1
pkg/vm/engine/tae/db/gc/v3/window.go:427: The process restarts after GC metadata becomes durable but before Publish removes its cleanup markers.
Impact: Replay adopts the logical GC metadata and releases its marker. The data object's dependency now names a missing marker, and isAdoptedGCMetadata cannot recognize that marker path as adopted metadata. Cleanup deletes data referenced by the recovered window. Preserve enough durable attempt identity to distinguish adoption from abandonment before releasing dependent ownership.
Evidence: TestReviewRestartPreservesAdoptedGCData used real scan persistence and Replay. The recovered window referenced an object that cleanup deleted; its metadata and advanced watermark remained. The published control passed. See review-gc-ownership.log and receipt checks/1792382000234910514-3.json. -
P1
pkg/objectio/ioutil/unpublished_cleanup.go:456: A GC metadata write persists before returning an error, metadata deletion fails, and cleanup runs with the production arrangement of local marker storage and shared object storage.
Impact: Dependencies now include marker paths, but this check queries objectFS. The marker appears absent there even while it exists on markerFS, allowing referenced data to be deleted before its metadata. Resolve dependencies through their actual storage owner, distinguishing marker dependencies from object dependencies.
Evidence: db/controller.go:777 configures WithUnpublishedCleanupFS(db.Runtime.LocalFs). TestReviewLocalMarkerDependencyPreservesRecoverableGCData preserved data with one service but deleted it with separate services while GC metadata still existed. See review-gc-ownership.log and receipt checks/1792382000234910514-3.json.
Validation:
-
Verified the frozen head, unchanged source, complete patch and git diff --check. Final audit receipt: checks/1792382234756537092-4.json; command/source/exit receipts and log hashes are indexed in /home/xupeng/.local/state/mo-bot/jobs/979155e2d15d2a53875edbe9/attempt-1/review-evidence.json.
-
Isolation preflight passed. Retained native inputs differed, so prerequisites were rebuilt through top-level make cgo using current inputs and assigned caches. Build receipt: checks/1792381762111211323-4.json; native-build.log and native-provenance.json retain provenance.
-
Three diagnostic ownership tests failed at the stated behavioral assertions; both included controls passed. Tests used the supplied test-exec. Receipt: checks/1792382000234910514-3.json.
-
Thirteen focused GC regressions passed (checks/1792382073618589675-3.json), and eight conversion, multi-block cleanup, backup and snapshot regressions passed (checks/1792382089009512705-4.json).
-
The prior same-range retry orphan probe, adapted to the current lifecycle API, passed both same-range and different-range cases. Receipt: checks/1792382152708758495-4.json; retry-identity.log.
-
Snapshot Update microbenchmark at 100,000 tables measured 31.35 ms and 22.97 MB per empty update versus 1.10 ms and 12.2 KB for the extracted base Update body. Extra copies affect checkpoint processing; the new sinker hook remains disabled for ordinary SQL callers. Results: logtail-regressions-benchmark.log.
-
Frozen evidence reports successful current-head build, Ubuntu UT, SCA, coverage and compose BVT checks. local_validation is empty; CI statuses were not treated as proof of the reproduced recovery boundaries.
Limitations:
-
No local full-package race, SQL BVT or upgrade run was performed. The benchmark isolates Update behavior using current helpers, not a complete base build or end-to-end SQL workload.
-
The linked issue #29263 body and raw CI logs were absent from the frozen evidence packet.
|
mo-bot review · Commit: "interrupted" |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d6eaa9856dd8757d59d65034e64e09f025343256
Assessment: request_changes
Reviewed the complete 18-file delta and supplied review history. Error propagation and rollback appropriately reuse existing persistence and cleanup owners. Previous cleanup/replay findings pass current-head probes, but global GC introduces a confirmed storage leak when post-adoption marker cleanup fails.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
- P2
pkg/vm/engine/tae/db/gc/v3/checkpoint.go:1446: Cleanup-marker deletion fails in scannedWindow.Publish after global GC has persisted and adopted replacement metadata.
Impact: Returning nil, publishErr discards filesToGC and makes tryGCAgainstGCKPLocked exit before DeleteMany. The replacement window already excludes those objects, so a successful retry cannot rediscover them, leaving physical objects orphaned. Defer this auxiliary cleanup failure while preserving deletion work, as the incremental scan does, or persist the deletion list for retry.
Evidence: TestReviewGlobalPublicationDoesNotLoseDeleteWork exercises production filtering and persistence. The success control returns the obsolete object; injected marker deletion failure followed by recovery returns deletion_candidates=[] while the object still exists. Candidate receipt 1792398505728603257-3.json exits 1 with this assertion failure. The same probe passes with a diagnostic overlay that defers the Publish error (receipt 1792398467113717970-4.json). Source tracing confirms window.go:232 replaces w.files before this return, and checkpoint.go:1298 exits before physical deletion.
Validation:
-
Evidence, commands, source fingerprints, exit receipts and log hashes are reconciled in /home/xupeng/.local/state/mo-bot/jobs/eb2f7b8f865c34b0d508442a/attempt-1/review-evidence.json; detailed coverage is retained in review-notes.txt.
-
Verified the exact clean head, complete patch, changed-file formatting and git diff --check. Final reconciliation receipt: 1792398729741092909-4.json, exit 0.
-
Isolation preflight passed. Fresh native prerequisites were built through the repository's make cgo owner; 192 input files and resulting native artifacts were fingerprint-verified. Receipts: 1792398091064435843-9.json and 1792398137834925347-41.json.
-
All 28 selected regression test roots across ioutil, logtail, GC, RPC and backup passed without production overlays. Receipt: 1792398454969667974-3.json; log: focused-regressions.log.
-
Three current-head probes passed for adopted-data restart recovery, separate marker-storage dependencies, and snapshot preservation after publication cleanup failure. Receipt: 1792398394675065392-4.json.
-
The final global-GC reproduction failed on the candidate and passed the diagnostic control. Logs: global-publication-final.log and global-publication-control.log. The control is not a candidate fix or passing candidate validation.
-
A five-iteration synthetic 100,000-table benchmark measured snapshot Update increasing from 1.16 ms and 12.7 KB per operation for the extracted base implementation to 34.08 ms and 22.97 MB for the candidate. Receipt: 1792398487017727880-3.json. This quantifies rollback-copying cost, not end-to-end SQL throughput.
Limitations:
-
Failure probes use MemoryFS and component entry points; no new full-process crash, real WAL persistence, race or upgrade test was run. The global probe uses the successful nil-logDriver path.
-
Frozen evidence records successful exact-head CI, but raw CI logs and the linked issue's full body were unavailable. Local tests used -vet=off.
-
The benchmark uses the frozen base Update body with current compatible helpers. It establishes copying overhead, not a workload-level performance failure.
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 205530f3e520bb2f7453cb6693e6512f53eb34c0
Assessment: approve
Reviewed all 18 changed files, their callers, recovery paths, and prior review concerns. No actionable findings remain. The design appropriately reuses existing conversion, sinker, snapshot, and cleanup owners. The latest fix preserves physical-delete work when marker cleanup fails after metadata adoption.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Isolation preflight passed. Recovered native artifacts after verifying 192 matching source inputs, 13 output hashes, and the original build receipt and log.
-
32 focused tests passed, covering conversion failures, multi-block cleanup, snapshot rollback, backup/debug consumers, GC spills, restart ownership, separate marker storage, and publication failure.
-
Complete race runs passed: 203 tests across objectio/ioutil, tae/logtail, and tae/db/gc/v3; no skips or race reports.
-
Verified clean frozen HEAD, complete patch equivalence, formatting, and command/source/exit receipts against retained logs. Evidence: /home/xupeng/.local/state/mo-bot/jobs/420bef26e9baaa03c6619bef/attempt-1/review-evidence.json.
-
Reconciled the retained benchmark against unchanged relevant code and the current base method: at 100,000 tables, empty snapshot Update measured 34.08 ms and 22.97 MB allocated versus 1.16 ms and 12.7 KB at base. This GC rollback cost is an accepted correctness tradeoff.
-
Frozen exact-head CI reports successful build, Ubuntu UT, coverage, static analysis, and BVT checks; these corroborate the local validation.
Limitations:
-
Recovery probes exercise production components with injected filesystem faults, not full-process crashes or real WAL durability. No fresh cluster upgrade or downgrade run was performed.
-
The five-iteration component benchmark does not establish sustained GC performance or SQL throughput. Snapshot copying can indirectly extend GC lock occupancy.
-
Raw CI test logs and the linked issue body were not supplied; behavioral requirements were checked against the frozen PR description and review discussion.
Merge Queue Status
This pull request spent 13 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:
issue #29263
What this PR does / why we need it:
Fixes #29263