Repository navigation
fix(ingestion): discard stale checkpoint when the DSL is edited before resume - #17351
Conversation
…e resume Resuming a failed ingestion run with a modified pipeline DSL previously errored: eino checkpoints are bound to the graph's node ids / wiring, so restoring old state into a recompiled (different) graph fails. Detect the change by fingerprinting the DSL file (full canvas DSL) and the runtime override_params, persisted alongside the eino checkpoint. On resume, if either fingerprint differs from the stored one, drop the stale checkpoint and the interrupt marker and start a fresh run instead of erroring. The warning log distinguishes a DSL-file edit from a runtime-override edit. Add unit/integration tests covering both mismatch branches. Signed-off-by: xugangqiang <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughResumable pipelines now fingerprint canonical DSL and runtime overrides before checkpoint resume. Mismatches discard stale checkpoints and interrupt markers, while completion or cancellation cleanup removes fingerprint entries. Tests cover DSL changes, override changes, classification, lookup errors, restart behavior, and cleanup. ChangesResumable pipeline guards
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PipelineRun
participant guardDSLChange
participant CheckPointStore
participant RunTracker
PipelineRun->>guardDSLChange: validate DSL and override fingerprints
guardDSLChange->>CheckPointStore: read stored fingerprints
guardDSLChange->>CheckPointStore: delete stale checkpoint on mismatch
guardDSLChange->>RunTracker: clear persisted interrupt ID
guardDSLChange->>CheckPointStore: write current fingerprints
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
internal/ingestion/pipeline/pipeline.go (1)
553-557: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAlign cancellation cleanup with success cleanup.
cleanupCheckpointcurrently deletes onlycpID, while the success path also deletes the DSL/override fingerprint keys. AddcpID:dslandcpID:ovfdeletes tocleanupCheckpointso cancelled resumable runs do not leave orphaned fingerprint entries.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/ingestion/pipeline/pipeline.go` around lines 553 - 557, Update cleanupCheckpoint to delete the DSL and override fingerprint keys alongside cpID, matching the success cleanup path by invoking store.Delete for cpID+dslKeySuffix and cpID+ovfKeySuffix while preserving the existing BestEffort behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/ingestion/pipeline/pipeline.go`:
- Around line 245-261: Remove the duplicated first documentation paragraph
preceding dslFileFingerprint, preserving the newer paragraph that documents the
rawDSL error behavior and hashing contract.
- Around line 330-354: Update the checkpoint validation flow around store.Get
and fingerprint persistence to handle errors before writing new fingerprints. If
the cpID lookup fails, return or otherwise skip the dslKey/ovfKey updates;
likewise, if either stored fingerprint lookup fails, avoid overwriting
fingerprints and continue the existing error handling path. Preserve
stale-checkpoint deletion only for successful reads that identify a mismatch,
using the store.Get results in the surrounding checkpoint logic.
---
Nitpick comments:
In `@internal/ingestion/pipeline/pipeline.go`:
- Around line 553-557: Update cleanupCheckpoint to delete the DSL and override
fingerprint keys alongside cpID, matching the success cleanup path by invoking
store.Delete for cpID+dslKeySuffix and cpID+ovfKeySuffix while preserving the
existing BestEffort behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7f47ac27-f115-4d6f-86ef-d4d523674508
📒 Files selected for processing (2)
internal/ingestion/pipeline/pipeline.gointernal/ingestion/pipeline/pipeline_test.go
cleanupCheckpoint now deletes the cpID:dsl and cpID:ovf fingerprint keys alongside the eino checkpoint, so they share one lifecycle on cancellation instead of lingering up to TTL while the checkpoint is gone. Update TestCleanupCheckpoint_DeletesStoreAndClearsTracker to assert all three keys are removed. Signed-off-by: xugangqiang <[email protected]>
Address CodeRabbit findings on PR infiniflow#17351: 1. Remove the duplicated doc-comment paragraph preceding dslFileFingerprint. 2. guardDSLChange now bails out entirely when store.Get(cpID) returns an error (or when the dslKey/ovfKey reads fail), instead of overwriting cpID:dsl / cpID:ovf with current fingerprints. Writing fingerprints after a failed lookup could mask a real stale-checkpoint mismatch on a later resume, defeating the DSL-change guard. A fresh run (cpID lookup succeeds with no checkpoint) still records both fingerprints so a later resume can detect edits. Add TestGuardDSLChange_CheckpointLookupErrorSkipsOverwrite to lock in the read-failure skip behavior. Signed-off-by: xugangqiang <[email protected]>
Co-authored-by: CodeBuddy <[email protected]>
|
LGTM |
|
Discussion: is the DSL canonicalization round-trip necessary? While reviewing this PR, a question came up about Finding: the round-trip is redundant for the canvas path. The canvas DSL is loaded from the DB ( For built-in templates (static Conclusion / next step: the current canonicalization can safely be dropped (store the incoming |
Summary
Test plan
Notes