-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDC Postgres Tests #2777
CDC Postgres Tests #2777
Conversation
@@ -121,7 +123,7 @@ protected static Properties getDebeziumProperties(JsonNode config, ConfiguredAir | |||
props.setProperty("value.converter.schemas.enable", "false"); | |||
|
|||
// https://debezium.io/documentation/reference/configuration/event-flattening.html | |||
props.setProperty("delete.handling.mode", "rewrite"); | |||
// props.setProperty("delete.handling.mode", "rewrite"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
work in progress on this property.
@@ -72,6 +72,12 @@ | |||
return new DefaultAutoCloseableIterator<>(stream.iterator(), stream::close); | |||
} | |||
|
|||
public static <T> List<T> toList(AutoCloseableIterator<T> iterator) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment to expose that it closes the iterator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be clearer to name this function something like toListAndClose
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
@@ -148,7 +148,10 @@ private PgLsn extractLsn(ChangeEvent<String, String> event) { | |||
.flatMap(source -> Optional.ofNullable(source.get("lsn").asText())) | |||
.map(Long::parseLong) | |||
.map(PgLsn::fromLong) | |||
.orElseThrow(() -> new IllegalStateException("Could not find LSN")); | |||
.orElseThrow(() -> { | |||
System.out.println("event = " + event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! still debugging this bit with the delete issue i mentioned.
@@ -22,6 +22,5 @@ | |||
SOFTWARE. | |||
""" | |||
|
|||
|
|||
def test_example_method(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think these are the actual correct style? will make sure to run style check again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Briefly looked through to general flow. I did not examine the test cases in detail as I assume you and Jared have the spectrum covered. Let me know if you wanted a specific focus on an area.
One thoughts on testing. What do you think about using the @DisplayName annotation with Gherkin verbs (Given, When, Should etc) to better summarise what a test is doing? e.g. with the testWhitelistFiltersFullRefresh
the display name can read: "When reading multiple streams should only return whitelist for incremental streams". Usage is up to dev discretion. Although there is a small cost, I find it really saves time with understanding tests, especially for beefier tests. e.g. testRecordsProducedDuringAndAfterSync
, since the reader doesn't need to parse everything in the test block. Just a thought; not blocking.
* spike * more * debezium wip * use oneof for configuration * iterator wrapping structure * push current * working loop * move capability into source * hack it into a sharable state * debezium test runner (#2617) * CDC Wait for Values (#2618) * output actual AirbyteMessages for cdc (#2631) * message conversion * fmt * add lsn extraction and comparison (#2613) * postgres cdc catalog (#2673) * update cdc catalog * A * table selection for cdc (#2690) * table selection for cdc * fix broken merge * also test double quote in name * Add state management to CDC (#2718) * CDC: Fix Producer/Consumer State Machine (#2721) * CDC Postgres Tests (#2777) * fix postgres cdc image name and run check before reading data (#2785) * minor postgres cdc fixes * add test and fix check behavior * fix * improve comment * remove unused props, remove todos, add some more sanity tests (#2791) * cdc: add offset store tests (#2793) * clean (#2798) * postgres cdc docs (#2784) * cdc docs * Update docs/integrations/sources/postgres.md Co-authored-by: Charles <[email protected]> * address gcp * learn too english * add link * add more disk space warnings * add additional cdc use case * add information on how to find postgresql.conf * add how to find the file Co-authored-by: Charles <[email protected]> * various merge conflict fixes (#2799) * cdc standard tests (#2813) * require cdc users to create publications & update docs (#2818) * postgres cdc race condition * working? but different process * add additional logging to help debug in the future * everything done except working config * remove unintended change * Use oneOf in PG CDC spec (#2827) * add oneOf configuration for postgres cdc (#2831) * add oneof configuration for cdc postgres * fmt Co-authored-by: Charles <[email protected]> * fix test (#2834) * fix test * bump version * add docs on creating replica identities (#2838) * add docs on creating replica identities * emphasize danger * grammar * bump pg version in source catalog * generate seed files Co-authored-by: cgardens <[email protected]>
What
How
Describe the solution
Pre-merge Checklist
Recommended reading order
PostgresSourceCdcTest.java
DebeziumRecordPublisherTest.java