Hi guys,
Technical description :
- neo4j Community Edition version 5.20 and 5.19
- neo4j java driver version 5.20
- our java service, read data from kafka and merge/create index/node/relationship
- exemple of our cypher:
UNWIND $batch as row
MERGE (entity:kif { idRef: row.id })
ON CREATE
SET
entity.createdAt = localdatetime(row.createdAt),
entity.updatedAt = localdatetime()
WITH row, entity,hash
// remove old labels. They will be replaced by the new
CALL apoc.create.removeLabels(entity, labels(entity)) YIELD node as removedLabels
CALL apoc.create.addLabels(entity, row.labels) YIELD node as addedLabels
// remove and replace with new properties and labels
SET entity = {
idRef: row.id,
type: row.type,
raw: row.raw,
topic: row.topic,
app: row.app,
version: row.version,
domain: row.domain,
createdAt : entity.createdAt,
lastSyncAt: localdatetime(row.lastSyncAt),
updatedAt: localdatetime()
}
// add dependencies from
CALL apoc.do.when(row.dependencies is not null and size(row.dependencies) > 0, "
UNWIND row.dependencies as dependencies
call {
WITH row, entity, dependencies
// add dependencies
MERGE (entityDependency:kif { idRef: dependencies.id })
ON CREATE SET
entityDependency:unknown:kif,
entityDependency.createdAt = localdatetime(row.createdAt),
entityDependency.lastSyncAt = localdatetime(row.lastSyncAt),
entityDependency.updatedAt = localdatetime()
WITH row, entity, dependencies, entityDependency
// add relation between node and dependency
CALL apoc.merge.relationship(
entity,
dependencies.type,
null,
{createdAt:localdatetime(row.createdAt),lastSyncAt:localdatetime(row.lastSyncAt), updatedAt:localdatetime(), raw: dependencies.raw},
entityDependency,
{lastSyncAt:localdatetime(row.lastSyncAt),updatedAt:localdatetime(), raw: dependencies.raw}
) YIELD rel
RETURN 0 as ignored
} return *
", "", {row: row, entity: entity}) yield value as fromValue
....
Error Description :
After millions of ingestion, we encountered, randomly, this error
Error reading transaction logs, recovery not possible. To force the database to start anyway, you can specify 'internal.dbms.tx_log.fail_on_corrupted_log_files=false'. This will try to recover as much as possible and then truncate the corrupt part of the transaction log. Doing this means your database integrity might be compromised, please consider restoring from a consistent backup instead.
Caused by: org.neo4j.internal.id.ReservedIdException: Id 4294967295 is reserved and can't be used as a regular record id
Thanks for your help.