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

Primary key update behavior for Db2 connector?

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      Determine whether the Db2 connector can detect changes to a table's primary key. Possibly do this by following the instructions in the tutorial. This issue is the result of a debezium-dev chat about the following: 

      The Db2 connector doc DOES NOT have the following content about changes to primary keys: 

      Primary key updates
      An `UPDATE` operation that changes a row's primary key field(s) is known as a primary key change. For a primary key change, in place of an `UPDATE` event record, the connector emits a `DELETE` event record for the old key and a `CREATE` event record for the new (updated) key. These events have the usual structure and content, and in addition, each one has a message header related to the primary key change:

      • The `DELETE` event record has `__debezium.newkey` as a message header. The value of this header is the new primary key for the updated row.
      • The `CREATE` event record has `__debezium.oldkey` as a message header. The value of this header is the previous (old) primary key that the updated row had.

       
       When I asked whether I should add this content to the doc for the Db2 connector, the comments were: 
       
      Chris Cranford:
      Yes, this behavior is universal across all relational connectors.
       
      René Kerner:
      I am not 100% sure on what Chris said, because I know it's a detail of the replication implementation if we can detect a PK update. When I remember correctly there are only 2 connectors supporting it?
      I think we need to check this in detail for the different connectors
       
      Gunnar Morling:
      this is implemented in the framework actually; so all connectors derived from it should follow that semantics, i.e. Db2, too
       
      René Kerner:
      yes, but it depends on if the connectors can realize the PK update. if it's detected, it will be handled like that. but it depends on if we can physically detect the pk update?
       
      Gunnar Morling,
      ah yes, good point; someone would have to try it out really
       
       
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tcohen@redhat.com Tova Cohen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: