[
https://issues.apache.org/jira/browse/IGNITE-25589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roman Puchkovskiy updated IGNITE-25589:
---------------------------------------
Description:
Here is the scenario:
# A table is created (catalogVersion=N)
# Tuple X is written to this table
# A replica request is sent that is going to read the tuple
# While handling the request, we make sure that the table is not dropped yet
# We read tuple X
# Table is dropped in parallel (catalogVersion=N+1 is created without the
table)
# We validate the tuple for backwards schema compatibility (that is, we make
sure that the table version in which it was written is not higher than the
table version that is seen by the transaction [at transaction begin ts])
# While doing so, we iterate catalog from version A to version B, where A
matches the begin ts of the transaction, and B is the latest catalog version
(which does not contain the table); we bump into a null reference for the table
descriptor and fail:
{code:java}
java.lang.NullPointerException
at
org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource$1.test(CatalogValidationSchemasSource.java:105)
at
org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource$1.test(CatalogValidationSchemasSource.java:100)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
at
java.base/java.util.stream.Streams$RangeIntSpliterator.tryAdvance(Streams.java:87)
at
java.base/java.util.stream.IntPipeline.forEachWithCancel(IntPipeline.java:163)
at
java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at
org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.tableSchemaVersionsBetweenCatalogAndTableVersions(CatalogValidationSchemasSource.java:128)
at
org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.lambda$tableSchemaVersionsBetween$2(CatalogValidationSchemasSource.java:81)
at
java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
at
org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.tableSchemaVersionsBetween(CatalogValidationSchemasSource.java:79)
{code}
The correct thing is to stop the catalog scan when we find a version that does
not contain the table in question.
> NPE in backward schema compatibility validation
> -----------------------------------------------
>
> Key: IGNITE-25589
> URL: https://issues.apache.org/jira/browse/IGNITE-25589
> Project: Ignite
> Issue Type: Bug
> Reporter: Roman Puchkovskiy
> Assignee: Roman Puchkovskiy
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Here is the scenario:
> # A table is created (catalogVersion=N)
> # Tuple X is written to this table
> # A replica request is sent that is going to read the tuple
> # While handling the request, we make sure that the table is not dropped yet
> # We read tuple X
> # Table is dropped in parallel (catalogVersion=N+1 is created without the
> table)
> # We validate the tuple for backwards schema compatibility (that is, we make
> sure that the table version in which it was written is not higher than the
> table version that is seen by the transaction [at transaction begin ts])
> # While doing so, we iterate catalog from version A to version B, where A
> matches the begin ts of the transaction, and B is the latest catalog version
> (which does not contain the table); we bump into a null reference for the
> table descriptor and fail:
>
> {code:java}
> java.lang.NullPointerException
> at
> org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource$1.test(CatalogValidationSchemasSource.java:105)
> at
> org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource$1.test(CatalogValidationSchemasSource.java:100)
> at
> java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
> at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
> at
> java.base/java.util.stream.Streams$RangeIntSpliterator.tryAdvance(Streams.java:87)
> at
> java.base/java.util.stream.IntPipeline.forEachWithCancel(IntPipeline.java:163)
> at
> java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
> at
> java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
> at
> java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
> at
> java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
> at
> java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> at
> java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
> at
> org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.tableSchemaVersionsBetweenCatalogAndTableVersions(CatalogValidationSchemasSource.java:128)
> at
> org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.lambda$tableSchemaVersionsBetween$2(CatalogValidationSchemasSource.java:81)
> at
> java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
> at
> org.apache.ignite.internal.partition.replicator.schema.CatalogValidationSchemasSource.tableSchemaVersionsBetween(CatalogValidationSchemasSource.java:79)
>
> {code}
> The correct thing is to stop the catalog scan when we find a version that
> does not contain the table in question.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)