-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1582: rebind flag in apoc.periodic.iterate #3098
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR man.
We decided core should not receive new functionality unless especifically approved. Feel free to either move the functionality to full
or we can discuss with the whole team whether this is worthy of being added to core
and breaking that policy.
I just moved the new functionality in full |
@ncordon We should probably discuss this with Luisa. Since 4.x this breaking change in neo4j is a big source of problems, as transaction state from nodes that are not rebound will leak into the original transaction and make it blow up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed, nor we have added documentation in this PR, even though it's for 4.4 and the docs still live with the code.
Could you explain me what rebind is for, please?
@ncordon
In this case the procedure fails because the This fails ( So we can rebind the node, via |
Thanks for the explanation 👍. I think this makes sense, but will hold off from approving given this is now out of Cypher's Surface responsibilities as long as it's in the extended part. |
The Code provided in the files are the Enhancement which Great features |
that is `n1.createRelationshipTo(n2)`. | ||
|
||
|
||
Is what happens when we perform the following operation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is not the main issue, that also didn't work before, it's regular tx-visibility and I think that will also not be resolved by rebinding.
The issue that all the periodic-iterate tx-state is attached to the originating transaction if the node is not rebound to the new updating tx, which then leads to OOM issues. @vga91
} | ||
|
||
@UserFunction("apoc.any.rebind") | ||
@Description("apoc.any.rebind(Object) - to rebind any rel, node, path, map, list or combination of them (i.e. executing a Transaction.getNodeById(node.getId()) / Transaction.getRelationshipById(rel.getId()))") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have an explicit one for path, as otherwise we lose the type information and cypher doesn't recognize it as a path anymore
Fixes #1582
apoc.node.rebind
/apoc.rel.rebind
andapoc.any.rebind
functionsrebind
config toapoc.periodic.iterate
proc not to rebind manually the query if neededmatch (n) where id(n) = $id...
or withoutapoc.<entity>.rebind
function