Debezium postgres connector cannot handle making a new column required after updating it with a value [DBZ-1489]
- Dominant language
- HTML
- Stars
- 6
- Forks
- 9
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 1
Description
Migrated from [DBZ-1489](https://issues.redhat.com/browse/DBZ-1489)
We have a liquibase changeset as follows
{code:java}
UPDATE a_table SET a_column = false
{code}
Which adds an optional column, then updates it with a value, and then makes it required.
The 'a_table' also contains a row of data before the changesets execute.
When debezium is listening to postgresql while this executes we get into a situation where debezium complains that he receives a null value for a column which is required. See attached debezium log!
Probably a race condition where debezium gets change events for a situation before the value is set and debezium updates its metadata cache when the required constraint is already added.
Contributor guide
Research direction
Reproduce the three Liquibase changesets while Debezium listens to PostgreSQL, then inspect the attached Debezium log for the ordering of schema and data events. Trace the PostgreSQL connector's handling of those events; done means it no longer reports a null for a column made required after being populated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100