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

JDBC Offset storage - configuration of table name does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.4.0.Beta2
    • 2.3.0.Final
    • core-library
    • None

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Debezium embed server 2.3.0

      What is the connector configuration?

      addPropertyIfNotNull(configBuilder, EmbeddedEngine.OFFSET_STORAGE, JdbcOffsetBackingStore.class.getName());
      addPropertyIfNotNull(configBuilder, "offset.storage.jdbc.url", connectionSetupFromDbd.getUrl());
      addPropertyIfNotNull(configBuilder, "offset.storage.jdbc.user", connectionSetupFromDbd.getUid());
      addPropertyIfNotNull(configBuilder, "offset.storage.jdbc.password", encryptedPwd);
      addPropertyIfNotNull(configBuilder, "offset.storage.jdbc.offset.table.name", "DEBEZIUM_OFFSET_STORAGE");

       

      addPropertyIfNotNull(configBuilder, "schema.history.internal", "io.debezium.storage.jdbc.history.JdbcSchemaHistory");
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.url", connectionSetupFromDbd.getUrl());
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.user", connectionSetupFromDbd.getUid());
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.password", encryptedPwd);
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.schema.history.table.name", "DEBEZIUM_DATABASE_HISTORY");
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.schema.history.table.ddl", "CREATE TABLE %s" +
      "(" +
      "id VARCHAR(36) NOT NULL," +
      "history_data CLOB," +
      "history_data_seq INTEGER," +
      "record_insert_ts TIMESTAMP NOT NULL," +
      "record_insert_seq INTEGER NOT NULL" +
      ")");
      addPropertyIfNotNull(configBuilder, "schema.history.internal.jdbc.schema.history.table.select", "SELECT * FROM %s where ROWNUM <= 1");

      What is the captured database version and mode of depoyment?

      Oracle

      What behaviour do you expect?

      expecting Debezium to create DEBEZIUM_OFFSET_STORAGE table with upper case

      This is needed as a workaround for DBZ-6796. Need to define the table name with uppercase.

      What behaviour do you see?

      debezium ignoring the property "offset.storage.jdbc.offset.table.name" and keeping the lowercase default name

      I think the issue is in the JdbcOffsetBackingStoreConfig.java where

      public static final String OFFSET_STORAGE_PREFIX = "offset.storage.";
          public static final String PROP_PREFIX = OFFSET_STORAGE_PREFIX + CONFIGURATION_FIELD_PREFIX_STRING;

      However similar JdbcSchemaHistoryConfig (where it works fine) is having

      private static final Field PROP_TABLE_NAME = Field.create(CONFIGURATION_FIELD_PREFIX_STRING + "schema.history.table.name")
                  .withDescription("The database key that will be used to store the database schema history")
                  .withDefault(DEFAULT_TABLE_NAME);

      So the fix may be just to remove OFFSET_STORAGE_PREFIX = "offset.storage."; as that is probably propagated from the base class.

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      No change in source code since May5:

      https://github.com/debezium/debezium/commits/main/debezium-storage/debezium-storage-jdbc/src/main/java/io/debezium/storage/jdbc/offset/JdbcOffsetBackingStoreConfig.java

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      was debugging it:

      How to reproduce the issue using our tutorial deployment?

      set the properties and verify the table is being created

       

            jpechane Jiri Pechanec
            jirikulhanek Jiri Kulhanek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: