Issue 1:
I discovered that when I use the LIMIT operator in the RETURN, the database returns invalid results sometimes (non-deterministic) - but only on large size patterns/quiers. I.e: Altough there are 4 matches in the database, the database returns no matches when using LIMIT 1 (or 2,3), but 4 when using LIMIT 4. After restarting the database the error disappears sometimes - but sometimes not.

Has this issue been fixed in recent releases? If not, please use the following steps to reproduce the problem: Note: be advised, that the problem occures only sporadic.

Neo4j version: 3.5.2

Operating system: Win10 x64

API/Driver: Neo4j Browser or JavaAPI

Steps:

Initiate Database, run the following queries. The query create a game board with 4x4 fields( label :Field), which are connected by :right and :bottom edges to their neighbors, and a node :Board, with edges to every :Field.

CREATE
(f00: Field {name: "f00"})-[:right]->(f01: Field {name: "f01"})-[:right]->(f02: Field {name: "f02"})-[:right]->(f03:Field {name: "f03"}),
(f10: Field {name: "f10"})-[:right]->(f11: Field {name: "f11"})-[:right]->(f12: Field {name: "f12"})-[:right]->(f13:Field {name: "f13"}),
(f20: Field {name: "f20"})-[:right]->(f21: Field {name: "f21"})-[:right]->(f22: Field {name: "f22"})-[:right]->(f23:Field {name: "f23"}),
(f30: Field {name: "f30"})-[:right]->(f31: Field {name: "f31"})-[:right]->(f32: Field {name: "f32"})-[:right]->(f33:Field {name: "f33"}),
(f00)-[:bottom]->(f10)-[:bottom]->(f20)-[:bottom]->(f30),
(f01)-[:bottom]->(f11)-[:bottom]->(f21)-[:bottom]->(f31),
(f02)-[:bottom]->(f12)-[:bottom]->(f22)-[:bottom]->(f32),
(f03)-[:bottom]->(f13)-[:bottom]->(f23)-[:bottom]->(f33),
(b:Board)

and

MATCH (f:Field), (b:Board) CREATE (b)-[:fields]->(f)

Execute the pattern matching query.

MATCH
(b:Board)-[b_fields_0_field11:fields]->(field11:Field), (b:Board)-[b_fields_1_field12:fields]->(field12:Field), (b:Board)-[b_fields_2_field13:fields]->(field13:Field), (b:Board)-[b_fields_3_field21:fields]->(field21:Field), (b:Board)-[b_fields_4_field22:fields]->(field22:Field), (b:Board)-[b_fields_5_field23:fields]->(field23:Field), (b:Board)-[b_fields_6_field31:fields]->(field31:Field), (b:Board)-[b_fields_7_field32:fields]->(field32:Field), (b:Board)-[b_fields_8_field33:fields]->(field33:Field),
(field11:Field)-[field11_right_0_field12:right]->(field12:Field), (field11:Field)-[field11_bottom_1_field21:bottom]->(field21:Field),
(field12:Field)-[field12_right_0_field13:right]->(field13:Field), (field12:Field)-[field12_bottom_1_field22:bottom]->(field22:Field),
(field13:Field)-[field13_bottom_0_field23:bottom]->(field23:Field),
(field21:Field)-[field21_right_0_field22:right]->(field22:Field), (field21:Field)-[field21_bottom_1_field31:bottom]->(field31:Field),
(field22:Field)-[field22_right_0_field23:right]->(field23:Field), (field22:Field)-[field22_bottom_1_field32:bottom]->(field32:Field),
(field23:Field)-[field23_bottom_0_field33:bottom]->(field33:Field),
(field31:Field)-[field31_right_0_field32:right]->(field32:Field),
(field32:Field)-[field32_right_0_field33:right]->(field33:Field),
(field33:Field)
WHERE NOT id(field11) = id(field12) AND NOT id(field11) = id(field13) AND NOT id(field11) = id(field21) AND NOT id(field11) = id(field22) AND NOT id(field11) = id(field23) AND NOT id(field11) = id(field31) AND NOT id(field11) = id(field32) AND NOT id(field11) = id(field33)
AND NOT id(field12) = id(field13) AND NOT id(field12) = id(field21) AND NOT id(field12) = id(field22) AND NOT id(field12) = id(field23) AND NOT id(field12) = id(field31) AND NOT id(field12) = id(field32) AND NOT id(field12) = id(field33)
AND NOT id(field13) = id(field21) AND NOT id(field13) = id(field22) AND NOT id(field13) = id(field23) AND NOT id(field13) = id(field31) AND NOT id(field13) = id(field32) AND NOT id(field13) = id(field33)
AND NOT id(field21) = id(field22) AND NOT id(field21) = id(field23) AND NOT id(field21) = id(field31) AND NOT id(field21) = id(field32) AND NOT id(field21) = id(field33)
AND NOT id(field22) = id(field23) AND NOT id(field22) = id(field31) AND NOT id(field22) = id(field32) AND NOT id(field22) = id(field33)
AND NOT id(field23) = id(field31) AND NOT id(field23) = id(field32) AND NOT id(field23) = id(field33)
AND NOT id(field31) = id(field32) AND NOT id(field31) = id(field33)
AND NOT id(field32) = id(field33)
RETURN
id(b_fields_0_field11) AS b_fields_0_field11, id(b_fields_1_field12) AS b_fields_1_field12, id(b_fields_2_field13) AS b_fields_2_field13,
id(b_fields_3_field21) AS b_fields_3_field21, id(b_fields_4_field22) AS b_fields_4_field22, id(b_fields_5_field23) AS b_fields_5_field23,
id(b_fields_6_field31) AS b_fields_6_field31, id(b_fields_7_field32) AS b_fields_7_field32, id(b_fields_8_field33) AS b_fields_8_field33,
id(field11_right_0_field12) AS field11_right_0_field12, id(field11_bottom_1_field21) AS field11_bottom_1_field21, id(field12_right_0_field13) AS field12_right_0_field13,
id(field12_bottom_1_field22) AS field12_bottom_1_field22, id(field13_bottom_0_field23) AS field13_bottom_0_field23, id(field21_right_0_field22) AS field21_right_0_field22,
id(field21_bottom_1_field31) AS field21_bottom_1_field31, id(field22_right_0_field23) AS field22_right_0_field23, id(field22_bottom_1_field32) AS field22_bottom_1_field32,
id(field23_bottom_0_field33) AS field23_bottom_0_field33, id(field31_right_0_field32) AS field31_right_0_field32, id(field32_right_0_field33) AS field32_right_0_field33, id(field33) AS field33
LIMIT 1

The query returns all 3x3 size sub boards. Hence the expected result in a 4x4 board is 4. Using the LIMIT opertor at the end, we limit the return to 1 sub board, such that the expected result size is 1. But sometimes the database returns no matches. Same behavior when using LIMIT 1, LIMIT 2 or LIMIT 3. Using LIMIT 4 the database return the 4 matches.

Issue 2:
Neo4j version: 3.5.8 community

Operating system: Debian 9

API/Driver: Neo4j desktop

Steps to reproduce

Create 1 fulltext index with duplicate labels :

CALL db.index.fulltext.createNodeIndex(
"SysDesignationIndex2",
['toto','tata','toto'],
["sys_designation1"],
{ analyzer: "french", eventually_consistent: "true" }
)

Expected behavior

The index is created, and I can drop it without a problem

Actual behavior

The index is created, but I can't remove it.

I get this message when I try to drop it :

call db.index.fulltext.drop('SysDesignationIndex2')

Neo.DatabaseError.Transaction.TransactionCommitFailed: Could not apply the transaction to the store after written to log

And into the log I get :

2019-09-05 14:57:31.281+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.Transaction.TransactionStartFailed]: The database has encountered a critical error, and needs to be restarted. Please see database logs for more details., reference 61c1e5d7-0d12-4602-8283-a20cd7804c28. The database has encountered a critical error, and needs to be restarted. Please see database logs for more details.
org.neo4j.graphdb.TransactionFailureException: The database has encountered a critical error, and needs to be restarted. Please see database logs for more details.
at org.neo4j.graphdb.facade.spi.ClassicCoreSPI.beginTransaction(ClassicCoreSPI.java:193)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransactionInternal(GraphDatabaseFacade.java:691)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransaction(GraphDatabaseFacade.java:375)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineV1SPI.beginTransaction(TransactionStateMachineV1SPI.java:139)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineV1SPI.beginTransaction(TransactionStateMachineV1SPI.java:98)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.execute(TransactionStateMachine.java:293)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.run(TransactionStateMachine.java:269)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.run(TransactionStateMachine.java:110)
at org.neo4j.bolt.v3.runtime.ReadyState.processRunMessage(ReadyState.java:85)
at org.neo4j.bolt.v3.runtime.ReadyState.processUnsafe(ReadyState.java:56)
at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48)
at org.neo4j.bolt.v1.runtime.BoltStateMachineV1.nextState(BoltStateMachineV1.java:144)
at org.neo4j.bolt.v1.runtime.BoltStateMachineV1.process(BoltStateMachineV1.java:92)
at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:89)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:191)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:139)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:171)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$2(ExecutorBoltScheduler.java:154)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.neo4j.internal.kernel.api.exceptions.TransactionFailureException: The database has encountered a critical error, and needs to be restarted. Please see database logs for more details.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.neo4j.kernel.internal.DatabaseHealth.assertHealthy(DatabaseHealth.java:61)
at org.neo4j.kernel.impl.api.KernelImpl.beginTransaction(KernelImpl.java:88)
at org.neo4j.graphdb.facade.spi.ClassicCoreSPI.beginTransaction(ClassicCoreSPI.java:186)
... 21 more
Caused by: org.neo4j.kernel.api.exceptions.TransactionApplyKernelException: Failed to apply transaction: Transaction #340 at log position LogPosition{logVersion=0, byteOffset=20807} {started 2019-09-05 14:57:24.896+0000, committed 2019-09-05 14:57:24.905+0000, with 1 commands in this transaction, authored by -1, with master id -1, lock session 138, latest committed transaction id when started was 339, additional header bytes:
15
DA
21
68
9A
33
E2
23}
at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.apply(RecordStorageEngine.java:301)
at org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess.applyToStore(TransactionRepresentationCommitProcess.java:78)
at org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess.commit(TransactionRepresentationCommitProcess.java:51)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:716)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:586)
at org.neo4j.internal.kernel.api.Transaction.close(Transaction.java:178)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.closeTransaction(TransactionStateMachine.java:469)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.streamResult(TransactionStateMachine.java:329)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.streamResult(TransactionStateMachine.java:128)
at org.neo4j.bolt.v3.runtime.StreamingState.processStreamResultMessage(StreamingState.java:40)
at org.neo4j.bolt.v3.runtime.AbstractStreamingState.processUnsafe(AbstractStreamingState.java:44)
... 12 more
Caused by: java.lang.NullPointerException
at org.neo4j.kernel.impl.api.store.SchemaCache$SchemaCacheState.removeSchemaRule(SchemaCache.java:372)
at org.neo4j.kernel.impl.api.store.SchemaCache.removeSchemaRule(SchemaCache.java:164)
at org.neo4j.kernel.impl.cache.BridgingCacheAccess.removeSchemaRuleFromCache(BridgingCacheAccess.java:51)
at org.neo4j.kernel.impl.transaction.command.NeoStoreTransactionApplier.visitSchemaRuleCommand(NeoStoreTransactionApplier.java:183)
at org.neo4j.kernel.impl.transaction.command.Command$SchemaRuleCommand.handle(Command.java:647)
at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:61)
at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:35)
at org.neo4j.kernel.impl.transaction.log.PhysicalTransactionRepresentation.accept(PhysicalTransactionRepresentation.java:70)
at org.neo4j.kernel.impl.api.TransactionToApply.accept(TransactionToApply.java:130)
at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.apply(RecordStorageEngine.java:294)
... 22 more

And when I try to query the database I get :

call db.indexes()

Neo.DatabaseError.Transaction.TransactionStartFailed: The database has encountered a critical error, and needs to be restarted. Please see database logs for more details.

We know it makes no sense to have duplicate labels into an index, but it can happen does something wrong.

To avoid this issue, We have added checks into the code to prevent this.

best regards