Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-6273

Table names with spaces are not correctly deserialized when using an Infinispan cache as the transaction buffer

XMLWordPrintable

      When an Infinispan cache entry is evicted and reloaded from disk or deserialized from a remote cache, the deserialization fails with the following failure related to the existing test associated with DBZ-6120, which creates a table with a space in its name:

      2023-04-01 11:58:03,750 ERROR  OracleConnectorIT||engine  Error while trying to run connector class 'io.debezium.connector.oracle.OracleConnector'   [io.debezium.connector.oracle.OracleConnectorIT]
      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
      	at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:53)
      	at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:226)
      	at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:60)
      	at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:174)
      	at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:141)
      	at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: org.infinispan.client.hotrod.exceptions.HotRodClientException: ISPN004034: Unable to unmarshall bytes 820108446D6C4576656E748A01840108011207353536393737311A194F52434C504442312E444542455A49554D2E51312120E8A1A8221241414153564441414D414141425A634141422A182030783030303032352E30303033613130382E30303130203214323032332D30342D30315431353A35383A30325A3A180801120132220751312120E8A1A82A08444542455A49554D
      	at org.infinispan.client.hotrod.marshall.MarshallerUtil.bytes2obj(MarshallerUtil.java:74)
      	at org.infinispan.client.hotrod.DataFormat.valueToObj(DataFormat.java:155)
      	at org.infinispan.client.hotrod.impl.operations.GetOperation.acceptResponse(GetOperation.java:45)
      	at org.infinispan.client.hotrod.impl.transport.netty.HeaderDecoder.decode(HeaderDecoder.java:146)
      	at org.infinispan.client.hotrod.impl.transport.netty.HintedReplayingDecoder.callDecode(HintedReplayingDecoder.java:94)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
      	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      	... 3 common frames omitted
      Caused by: java.lang.IllegalArgumentException: Unexpected input: 表
      	at io.debezium.relational.TableIdParser$ParsingState$3.handleCharacter(TableIdParser.java:154)
      	at io.debezium.relational.TableIdParser$TableIdTokenizer.tokenize(TableIdParser.java:71)
      	at io.debezium.text.TokenStream.start(TokenStream.java:446)
      	at io.debezium.relational.TableIdParser.parse(TableIdParser.java:36)
      	at io.debezium.relational.TableIdParser.parse(TableIdParser.java:30)
      	at io.debezium.relational.TableId.parseParts(TableId.java:80)
      	at io.debezium.relational.TableId.parse(TableId.java:54)
      	at io.debezium.relational.TableId.parse(TableId.java:30)
      	at io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.DmlEventAdapter.factory(DmlEventAdapter.java:54)
      	at io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.DmlEventAdapter$___Marshaller_ae32577eb017d89cb121c27c7fa34887a854760037a89f84046b59276ca6788c.read(DmlEventAdapter$___Marshaller_ae32577eb017d89cb121c27c7fa34887a854760037a89f84046b59276ca6788c.java:127)
      	at io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.DmlEventAdapter$___Marshaller_ae32577eb017d89cb121c27c7fa34887a854760037a89f84046b59276ca6788c.read(DmlEventAdapter$___Marshaller_ae32577eb017d89cb121c27c7fa34887a854760037a89f84046b59276ca6788c.java:15)
      	at org.infinispan.protostream.impl.ProtobufTagMarshallerDelegate.unmarshall(ProtobufTagMarshallerDelegate.java:32)
      	at org.infinispan.protostream.WrappedMessage.readMessage(WrappedMessage.java:539)
      	at org.infinispan.protostream.WrappedMessage.read(WrappedMessage.java:351)
      	at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:129)
      	at org.infinispan.commons.marshall.ImmutableProtoStreamMarshaller.objectFromByteBuffer(ImmutableProtoStreamMarshaller.java:31)
      	at org.infinispan.commons.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:82)
      	at org.infinispan.client.hotrod.marshall.MarshallerUtil.bytes2obj(MarshallerUtil.java:58)
      

      The issue here is that the table name is serialized to the cache as:

      ORCLPDB1.DEBEZIUM.Q1! 表
      

      The issue is that the TableIdParser does not expect spaces unless the table name is double-quoted. We should serialize the name of the table into the cache with double quotes, effectively being written with this format:

      "ORCLPDB1"."DEBEZIUM"."Q1! 表"
      

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: