Skip to content
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 #3751: mapParallel2 with rebind error #3810

Merged
merged 3 commits into from Oct 26, 2023
Merged

Fixes #3751: mapParallel2 with rebind error #3810

merged 3 commits into from Oct 26, 2023

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Oct 25, 2023

Fixes #3751

The error seems to be due to the rebind introduced in 5.9 (https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/dev/extended/src/main/java/apoc/cypher/CypherExtended.java# L248).

Sporadically the rebind throws (under the hood), an exception like:

org.neo4j.exceptions.UnderlyingStorageException: Access to record Node[20,used=false,created=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light,fixedRefs=false] went out of bounds of the page. The record size is 15 bytes, and the access was at offset 300 bytes into page 0, and the pages have a capacity of 8192 bytes. The mapped store file in question is /target/test data/neo4j/data/databases/neo4j/neostore.nodestore.db

or:

org.neo4j.graphdb.NotFoundException: Node 4:cce42f14-8960-44a9-b61f-5cdf5d7f0bc9:420 not found.

Resolution

Discussing it here,
the problem seems to be due to the rebind, which instead of using the @Context Transaction tx as a transaction should use the one coming from db.beginTx().
In this way, it works correctly.

The same method is also used by other procedures, but these also work with @Context Transaction tx, maybe because they don't create parallel partitions.
I created tests to be sure, so I would leave it like this so as not to cause breaking-change.
Also because is not possible to change this one, since it would give an error A query with 'CALL { ... } IN TRANSACTIONS' can only be executed in an implicit transaction

@conker84 conker84 merged commit 20c4634 into 5.13 Oct 26, 2023
4 checks passed
@conker84 conker84 deleted the issue_3751 branch October 26, 2023 10:14
conker84 pushed a commit that referenced this pull request Dec 4, 2023
Co-authored-by: Andrea Santurbano <santand@gmail.com>

[NOID] Fix error with mapParallel2 in TC
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request Jan 23, 2024
…ib#3810)

Co-authored-by: Andrea Santurbano <santand@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants