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

SQL Server ad-hoc snapshot - SnapshotType is case sensitive

XMLWordPrintable

    • False
    • False
    • Hide

      Create a connector that uses a signaling table on SQL Server

      Enter an execute-snapshot record in the signaling table with "incremental in lower case like below:

      INSERT INTO dbo.debezium_signal (id, type, data) VALUES('ad-hoc-1', 'execute-snapshot', '{"data-collections": ["dbo.MYTABLE"],"type":"incremental"}');

      Error will result in the connector that the enum type "incremental" is not found.

      Change "incremental" to all caps and it works.

      Show
      Create a connector that uses a signaling table on SQL Server Enter an execute-snapshot record in the signaling table with "incremental in lower case like below: INSERT INTO dbo.debezium_signal (id, type, data) VALUES('ad-hoc-1', 'execute-snapshot', '{"data-collections": ["dbo.MYTABLE"] ,"type":"incremental"}'); Error will result in the connector that the enum type "incremental" is not found. Change "incremental" to all caps and it works.

      I attempted to initiate an ad-hoc snapshot using a signal table. I have the signal table in table.Include.list and also have it set up like so "signal.data.collection": "MyDB.dbo.debezium_signal"

      I then entered this record in the signal table:

      INSERT INTO dbo.debezium_signal (id, type, data) VALUES('ad-hoc-1', 'execute-snapshot', '{"data-collections": ["dbo.MYTABLE"],"type":"incremental"}');

      The CDC picks up the record and the connector tries to process it but returns this error:

      ERROR WorkerSourceTask{id=vista-sink-cm-1561-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not
      recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask)
      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:42)
      at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.execute(SqlServerStreamingChangeEventSource.java:291)
      at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.execute(SqlServerStreamingChangeEventSource.java:59)
      at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:159)
      at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:122)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: org.apache.kafka.connect.errors.ConnectException: Error while processing event at offset

      {transaction_id=null, event_serial_no=1, commit_lsn=00290f95:00001120:0005, change_lsn=00290f95:00001120:0002}

      at io.debezium.pipeline.EventDispatcher.dispatchDataChangeEvent(EventDispatcher.java:253)
      at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.lambda$execute$1(SqlServerStreamingChangeEventSource.java:270)
      at io.debezium.jdbc.JdbcConnection.prepareQuery(JdbcConnection.java:613)
      at io.debezium.connector.sqlserver.SqlServerConnection.getChangesForTables(SqlServerConnection.java:285)
      at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.execute(SqlServerStreamingChangeEventSource.java:170)
      ... 8 more
      Caused by: java.lang.IllegalArgumentException: No enum constant io.debezium.pipeline.signal.ExecuteSnapshot.SnapshotType.incremental
      at java.base/java.lang.Enum.valueOf(Enum.java:240)
      at io.debezium.pipeline.signal.ExecuteSnapshot$SnapshotType.valueOf(ExecuteSnapshot.java:35)
      at io.debezium.pipeline.signal.ExecuteSnapshot.arrived(ExecuteSnapshot.java:59)
      at io.debezium.pipeline.signal.Signal.process(Signal.java:136)
      at io.debezium.pipeline.signal.Signal.process(Signal.java:180)
      at io.debezium.pipeline.EventDispatcher$2.changeRecord(EventDispatcher.java:227)
      at io.debezium.relational.RelationalChangeRecordEmitter.emitCreateRecord(RelationalChangeRecordEmitter.java:77)
      at io.debezium.relational.RelationalChangeRecordEmitter.emitChangeRecords(RelationalChangeR

      The root of the error is this: " java.lang.IllegalArgumentException: No enum constant io.debezium.pipeline.signal.ExecuteSnapshot.SnapshotType.incremental"

      I looked for the enum SnapshotType and found that it was all caps. When I changed the record to match it worked:

      INSERT INTO dbo.debezium_signal (id, type, data) VALUES('ad-hoc-1', 'execute-snapshot', '{"data-collections": ["dbo.MYTABLE"],"type":"INCREMENTAL"}');

              ccranfor@redhat.com Chris Cranford
              adlangx Aaron Lang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: