You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/12 11:20:02 UTC
[GitHub] sjchicks opened a new issue #2786: Problems introducing
incompatible changes to persistent topic schema
sjchicks opened a new issue #2786: Problems introducing incompatible changes to persistent topic schema
URL: https://github.com/apache/pulsar/issues/2786
#### Expected behavior
When introducing incompatible changes to the schema for a persistent topic, deleting the schema/topic should allow the new schema to be used.
#### Actual behavior
After deleting the schema using pulsar-admin, the Java client gets an NPE when trying to create the producer. The same NPE happens if you delete schema, topic, namespace and tenant, then recreate tenant and namespace.
#### Steps to reproduce
I guess steps 2 and 3 aren't actually necessary to reproduce this, but I've included everything I did just in case:
1. Run a producer using a JSON schema - we're using Kotlin, but I'm pretty confident the same would apply in Java. These are the relevant snippets:
```kotlin
data class Test(var fieldOne: String = UNKNOWN,
var fieldTwo: String = UNKNOWN) : Serializable
val producer = client.newProducer(JSONSchema.of(Test::class.java))
.topic("persistent://hicksst_hicksco_qa/default/TestTopic")
.createAsync()
.get(30L, TimeUnit.SECONDS)
```
2. Make an incompatible change to the schema:
```kotlin
data class Test(var fieldOne: String = UNKNOWN,
var fieldTwo: Int = 0) : Serializable
```
3. Running the producer and consumer now both throw an "incompatible schema" exception as expected.
4. Delete the schema using pulsar-admin:
```
pulsar-admin schemas delete persistent://hicksst_hicksco_qa/default/TestTopic
```
5. Running the producer now throws the following on the call to CompletableFuture.get:
```
Caused by: java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.lang.NullPointerException
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at percentile.streams.trade.simulator.pulsar.PulsarProducer.initialise(PulsarProducer.kt:34)
... 5 more
Caused by: org.apache.pulsar.client.api.PulsarClientException: java.lang.NullPointerException
at org.apache.pulsar.client.impl.ClientCnx.getPulsarClientException(ClientCnx.java:761)
at org.apache.pulsar.client.impl.ClientCnx.handleError(ClientCnx.java:498)
at org.apache.pulsar.common.api.PulsarDecoder.channelRead(PulsarDecoder.java:154)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.apache.pulsar.shade.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at org.apache.pulsar.shade.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1414)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:945)
at org.apache.pulsar.shade.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:146)
at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
```
There are no exceptions shown in the Pulsar server logs.
Running the consumer does not throw an exception.
6. Deleting and recreating the tenant, then running the producer throws the same NPE.
#### System configuration
**Pulsar version**: 2.1.0
**Java client library version**: 2.1.1-incubating
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services