diff --git a/community/cypher/cypher-compiler-3.2/src/test/scala/org/neo4j/cypher/internal/compiler/v3_2/planner/logical/idp/IDPQueryGraphSolverTest.scala b/community/cypher/cypher-compiler-3.2/src/test/scala/org/neo4j/cypher/internal/compiler/v3_2/planner/logical/idp/IDPQueryGraphSolverTest.scala index 4f60edbee5fd7..c24d0f45a204a 100644 --- a/community/cypher/cypher-compiler-3.2/src/test/scala/org/neo4j/cypher/internal/compiler/v3_2/planner/logical/idp/IDPQueryGraphSolverTest.scala +++ b/community/cypher/cypher-compiler-3.2/src/test/scala/org/neo4j/cypher/internal/compiler/v3_2/planner/logical/idp/IDPQueryGraphSolverTest.scala @@ -492,7 +492,7 @@ class IDPQueryGraphSolverTest extends CypherFunSuite with LogicalPlanningTestSup new IDPSolverConfig { override def solvers(queryGraph: QueryGraph): Seq[(QueryGraph) => IDPSolverStep[PatternRelationship, LogicalPlan, LogicalPlanningContext]] = ExpandOnlyWhenPatternIsLong.solvers(queryGraph) - override def iterationDurationLimit: Long = 100 + override def iterationDurationLimit: Long = 50 }, new ConfigurableIDPSolverConfig(maxTableSize = 32, iterationDurationLimit = Long.MaxValue), // table limited new ConfigurableIDPSolverConfig(maxTableSize = Int.MaxValue, iterationDurationLimit = 500), // time limited diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractIteratorRelationshipCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractIteratorRelationshipCursor.java index 6a288f5d41071..fbae53605258f 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractIteratorRelationshipCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractIteratorRelationshipCursor.java @@ -41,7 +41,7 @@ public abstract class StoreAbstractIteratorRelationshipCursor extends StoreAbstr super( relationshipRecord, cursors, lockService ); } - protected StoreAbstractIteratorRelationshipCursor init( ReadableTransactionState state, + protected StoreAbstractIteratorRelationshipCursor internalInitTxState( ReadableTransactionState state, PrimitiveLongIterator addedRelationshipIterator ) { this.state = state; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractPropertyCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractPropertyCursor.java index b401ab4fc0a26..ec15e1d908084 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractPropertyCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreAbstractPropertyCursor.java @@ -67,6 +67,7 @@ public final boolean next() private boolean fetchNext() { + property = null; while ( loadNextFromDisk() ) { // Are there more properties to return for this current record we're at? @@ -95,23 +96,23 @@ else if ( Record.NO_NEXT_PROPERTY.is( recordCursor.get().getNextProp() ) ) // Continue to next record in the chain and try there. } + assert property == null; return (property = nextAdded()) != null; } private boolean payloadHasNext() { boolean next = payload.next(); - if ( next && state != null ) + while ( next && state != null ) { int propertyKeyId = payload.propertyKeyId(); - if ( state.isPropertyRemoved( propertyKeyId ) ) - { - return false; - } - if ( property == null ) + if ( !state.isPropertyRemoved( propertyKeyId ) ) { + assert property == null; property = (DefinedProperty) state.getChangedProperty( propertyKeyId ); + return true; } + next = payload.next(); } return next; } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreIteratorRelationshipCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreIteratorRelationshipCursor.java index 6c02fee5b269c..4aff1c54cb0c4 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreIteratorRelationshipCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreIteratorRelationshipCursor.java @@ -47,7 +47,7 @@ public class StoreIteratorRelationshipCursor extends StoreAbstractIteratorRelati public StoreIteratorRelationshipCursor init( PrimitiveLongIterator iterator, ReadableTransactionState state ) { - super.init( state, addedRelationships( state ) ); + internalInitTxState( state, addedRelationships( state ) ); this.iterator = iterator; return this; } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreNodeRelationshipCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreNodeRelationshipCursor.java index f8bed196b1db4..098a07ff9d6f3 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreNodeRelationshipCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreNodeRelationshipCursor.java @@ -86,7 +86,7 @@ public StoreNodeRelationshipCursor init( boolean isDense, long firstRelId, long private StoreNodeRelationshipCursor init( boolean isDense, long firstRelId, long fromNodeId, Direction direction, IntPredicate allowedTypes, ReadableTransactionState state, PrimitiveLongIterator addedNodeRelationships ) { - super.init( state, addedNodeRelationships ); + internalInitTxState( state, addedNodeRelationships ); this.isDense = isDense; this.relationshipId = firstRelId; this.fromNodeId = fromNodeId; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreStatement.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreStatement.java index a7777e4affede..5733d8afa35be 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreStatement.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreStatement.java @@ -174,7 +174,7 @@ public Cursor acquireNodeRelationshipCursor( boolean isDense, public Cursor relationshipsGetAllCursor( ReadableTransactionState state ) { neoStores.assertOpen(); - return iteratorRelationshipCursor.get().init( state, new AllIdIterator( relationshipStore ) ); + return iteratorRelationshipCursor.get().init( new AllIdIterator( relationshipStore ), state ); } @Override