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

Random errors and NullPointerExceptions in ChainIndex #531

Closed
novoj opened this issue Apr 23, 2024 · 0 comments · Fixed by #561
Closed

Random errors and NullPointerExceptions in ChainIndex #531

novoj opened this issue Apr 23, 2024 · 0 comments · Fixed by #561
Assignees
Labels
bug Something isn't working
Milestone

Comments

@novoj
Copy link
Collaborator

novoj commented Apr 23, 2024

On of the mentioned problems found in error log:

2024-04-23T13:23:04.095517031Z Caused by: java.lang.NullPointerException: Cannot invoke "io.evitadb.index.array.TransactionalUnorderedIntArray.getLastRecordId()" because "predecessorChain" is null
2024-04-23T13:23:04.095520610Z 	at io.evitadb.index.attribute.ChainIndex.mergeSuccessorChainToElementChainIfPossible(ChainIndex.java:757)
2024-04-23T13:23:04.095523590Z 	at io.evitadb.index.attribute.ChainIndex.attemptToCollapseChain(ChainIndex.java:732)
2024-04-23T13:23:04.095526790Z 	at io.evitadb.index.attribute.ChainIndex.collapseChainsIfPossible(ChainIndex.java:716)
2024-04-23T13:23:04.095529990Z 	at java.base/java.util.OptionalInt.ifPresent(OptionalInt.java:165)
2024-04-23T13:23:04.095533120Z 	at io.evitadb.index.attribute.ChainIndex.removePredecessorFromChain(ChainIndex.java:348)
2024-04-23T13:23:04.095536120Z 	at io.evitadb.index.attribute.ChainIndex.removePredecessor(ChainIndex.java:241)
2024-04-23T13:23:04.095538850Z 	at io.evitadb.index.attribute.AttributeIndex.removeSortAttribute(AttributeIndex.java:374)
2024-04-23T13:23:04.095546300Z 	at io.evitadb.index.EntityIndex.removeSortAttribute(EntityIndex.java:103)
2024-04-23T13:23:04.095549370Z 	at io.evitadb.index.mutation.AttributeIndexMutator.lambda$executeAttributeUpsert$9(AttributeIndexMutator.java:153)
2024-04-23T13:23:04.095552320Z 	at java.base/java.util.Optional.ifPresent(Optional.java:178)
2024-04-23T13:23:04.095555610Z 	at io.evitadb.index.mutation.AttributeIndexMutator.executeAttributeUpsert(AttributeIndexMutator.java:152)
2024-04-23T13:23:04.095558640Z 	at io.evitadb.index.mutation.EntityIndexLocalMutationExecutor.updateAttributes(EntityIndexLocalMutationExecutor.java:390)
2024-04-23T13:23:04.095561480Z 	at io.evitadb.index.mutation.ReferenceIndexMutator.attributeUpdate(ReferenceIndexMutator.java:159)
2024-04-23T13:23:04.095564430Z 	at io.evitadb.index.mutation.EntityIndexLocalMutationExecutor.updateReferences(EntityIndexLocalMutationExecutor.java:486)
2024-04-23T13:23:04.095567440Z 	at io.evitadb.index.mutation.EntityIndexLocalMutationExecutor.applyMutation(EntityIndexLocalMutationExecutor.java:235)
2024-04-23T13:23:04.095570440Z 	at io.evitadb.core.EntityCollection.processMutations(EntityCollection.java:272)
2024-04-23T13:23:04.095573520Z 	at io.evitadb.core.EntityCollection.lambda$applyMutations$41(EntityCollection.java:1506)
2024-04-23T13:23:04.095576420Z 	at io.evitadb.store.entity.serializer.EntitySchemaContext.executeWithSchemaContext(EntitySchemaContext.java:90)
2024-04-23T13:23:04.095579370Z 	at io.evitadb.core.EntityCollection.applyMutations(EntityCollection.java:1504)
2024-04-23T13:23:04.095582180Z 	at io.evitadb.core.EntityCollection.upsertEntityInternal(EntityCollection.java:1396)
2024-04-23T13:23:04.095585040Z 	at io.evitadb.core.EntityCollection.upsertEntity(EntityCollection.java:546)
2024-04-23T13:23:04.095588020Z 	at io.evitadb.core.EvitaSession.lambda$upsertEntity$37(EvitaSession.java:874)
2024-04-23T13:23:04.095590910Z 	at io.evitadb.core.EvitaSession.lambda$executeInTransactionIfPossible$58(EvitaSession.java:1386)
2024-04-23T13:23:04.095594040Z 	at io.evitadb.core.Transaction.executeInTransactionIfProvided(Transaction.java:149)
2024-04-23T13:23:04.095597000Z 	at io.evitadb.core.EvitaSession.executeInTransactionIfPossible(EvitaSession.java:1384)
2024-04-23T13:23:04.095599930Z 	at io.evitadb.core.EvitaSession.upsertEntity(EvitaSession.java:872)
2024-04-23T13:23:04.095602750Z 	at jdk.internal.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
2024-04-23T13:23:04.095609300Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-04-23T13:23:04.095612350Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2024-04-23T13:23:04.095615360Z 	at io.evitadb.core.SessionRegistry$EvitaSessionProxy.lambda$invoke$0(SessionRegistry.java:195)
2024-04-23T13:23:04.095618670Z 	... 26 more

We need to write better fuzzy tests that would allow us to exterminate the edge cases in the ChainIndex. It seems that the real production systems may behave sometimes chaotically till they return back to consistent state.

@novoj novoj added the bug Something isn't working label Apr 23, 2024
@novoj novoj added this to the Alpha milestone Apr 23, 2024
@novoj novoj self-assigned this Apr 23, 2024
@novoj novoj modified the milestones: Alpha, Beta Apr 26, 2024
@novoj novoj changed the title NullPointerException: "io.evitadb.index.array.TransactionalUnorderedIntArray.getLastRecordId()" because "predecessorChain" is null Random errors and NullPointerExceptions in ChainIndex May 11, 2024
novoj added a commit that referenced this issue May 11, 2024
We need to write better fuzzy tests that would allow us to exterminate the edge cases in the ChainIndex. It seems that the real production systems may behave sometimes chaotically till they return back to consistent state.
novoj added a commit that referenced this issue May 11, 2024
…terexceptions-in-chainindex

fix(#531): Random errors and NullPointerExceptions in ChainIndex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant