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

direct usage of debezium engine ignores ChangeConsumer.supportsTombstoneEvents

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 2.0.0.Alpha2
    • 1.9.1.Final
    • embedded-engine
    • None

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      oracle, 1.9.0

      What is the connector configuration?

      connector config does not specify `tomstones.on.delete` property

      What behaviour do you expect?

      if the debezium consumer implements

      @Override
      public boolean supportsTombstoneEvents() {
         return false;
      }

      then the debezium engine should not pass in tombstones

      What behaviour do you see?

      tombstones reach the consumer

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

      yes

      Implementation ideas (optional)

      In https://github.com/debezium/debezium/blob/main/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java#L293 one could e.g. add following logic:
      if (!config.hasKey(CommonConnectorConfig.TOMBSTONES_ON_DELETE.name()) && !handler.supportsTombstoneEvents()) {
         config = config.mapped((k,v) -> {
           if (k == CommonConnectorConfig.TOMBSTONES_ON_DELETE.name()) {
             return Boolean.FALSE.toString();
           } else {
             return v;
           }
         });
      } else if (config.hasKey(CommonConnectorConfig.TOMBSTONES_ON_DELETE.name()) &&
                      config.getBoolean(CommonConnectorConfig.TOMBSTONES_ON_DELETE.name()) &&
                     !handler.supportsTombstoneEvents()) {
         // TODO alert user about incompatible preferences?
         // or give preference to indication from handler
      }
      annoying part is: user can express desire for tombstones or not in 2 ways, potentially conflicting.

      If any such code is changed then probably following is no longer needed: https://github.com/debezium/debezium/blob/main/debezium-server/debezium-server-core/src/main/java/io/debezium/server/DebeziumServer.java#L135-L137

       

              vjuranek@redhat.com Vojtech Juranek
              domsj Jan Doms (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: