fix: handle stale TID in VLE path materialization after DETACH DELETE (#2549) - #2550
Open
waterWang wants to merge 1 commit into
Open
fix: handle stale TID in VLE path materialization after DETACH DELETE (#2549)#2550waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes an internal stale TID error when projecting variable-length relationship (VLE) paths after DETACH DELETE, by making VLE path materialization tolerant of deleted tuples and returning empty properties ({}) when the stored TID is no longer visible.
Changes:
- Introduces “graceful” property accessors for vertex/edge entries that return
{}instead of erroring on stale TIDs. - Updates VLE path materialization (
build_path/ edge list construction) to use the graceful accessors. - Adds a regression test and expected output to cover the
MATCH p ... DETACH DELETE ... RETURN pscenario.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/include/utils/age_global_graph.h | Adds public prototypes for tolerant (“graceful”) vertex/edge property accessors. |
| src/backend/utils/adt/age_vle.c | Switches VLE path/edge materialization to use the graceful property accessors. |
| src/backend/utils/adt/age_global_graph.c | Implements graceful property accessors that return {} when heap fetch fails due to stale TIDs. |
| regress/sql/cypher_vle.sql | Adds a regression query reproducing Issue #2549. |
| regress/expected/cypher_vle.out | Adds expected output for the new regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+491
to
+495
| -- Issue #2549: VLE path + DETACH DELETE + RETURN p should not raise | ||
| -- stale TID error. When the path's bound vertices are deleted before | ||
| -- the path datum is materialized, build_path must tolerate the stale | ||
| -- TID and return the path with empty properties ({}) for the deleted | ||
| -- entities. |
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.
Fixes #2549
When a VLE path is bound via MATCH p = ... and the bound vertices are
subsequently DETACH DELETE'd, RETURN p raises an internal stale-TID
error because the VLE path materializer (build_path) lazily fetches
vertex/edge properties via heap_fetch after the underlying tuples have
been deleted.
This commit adds tolerant variants of get_vertex_entry_properties and
get_edge_entry_properties that return an empty properties object ({})
when the stored TID no longer resolves to a visible tuple, allowing
the path to be projected with the vertex present but its properties
empty.