feat: Optimize PG graph database wipes - BED-8787#2936
Open
StephenHinck wants to merge 3 commits into
Open
Conversation
Contributor
📝 WalkthroughWalkthrough
ChangesBulk graph wipe preserving MigrationData
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
15 tasks
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@cmd/api/src/daemons/datapipe/delete.go`:
- Around line 183-194: The truncate path in delete.go is treating
migrations.ErrNoMigrationData from GetMigrationData as safe to continue, but
that helper also uses the same sentinel for read/property failures and returns a
fallback version; update the logic around GetMigrationData in the wipe flow to
only proceed when a truly missing MigrationData node is confirmed, and abort on
any ambiguous or malformed read so you do not recreate MigrationData from the
lossy fallback. Use the existing GetMigrationData and ErrNoMigrationData
handling to split “missing node” from “failed read” before the graph wipe.
🪄 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: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 7fb0c2f4-4cd2-488b-a96e-a80bfca00d30
📒 Files selected for processing (2)
cmd/api/src/daemons/datapipe/delete.gocmd/api/src/daemons/datapipe/delete_integration_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the new
WipeGraphfunction supported optionally on DAWGS drivers to execute rapid graph wiping if supported. Initially, this is supported on PostgreSQL drivers utilizing TRUNCATE on node/edge tables.This PR requires the merging/release of DAWGS from SpecterOps/DAWGS#99 to realize the optimization gains, however merging may occur in any order as the implementation is optional on all graph drivers.
Motivation and Context
Resolves BED-8787
Why is this change required? What problem does it solve?
How Has This Been Tested?
Validated in local environments, and additional integration tests added to DAWGS.
Screenshots (optional):
Utilizing a test dataset from OGGen with 1M nodes, 3 tiers, and 10 edges between each tier showed a 99% reduction in deletion time.
Pre-change:
Post-change:
Types of changes
Checklist:
Summary by CodeRabbit