-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 partial reset acceptance test #14551
Conversation
|
||
// We do not check that the source and the dest are in sync here because removing a stream doesn't | ||
// delete its data in the destination | ||
assertGlobalStateContainsStreams(connectionId, List.of(idAndNameStreamDescriptor)); |
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 based this test pretty closely on Benoit's test here: https://github.com/airbytehq/airbyte/pull/14406/files#diff-50c027dd934aeff3adcaa28a849ae7c845d18961bedd7a4441e8bd82cef517f9R1056
Stopped here for now. Adding back a table to the CDC source is a bit more complex than in the non-CDC case since some extra SQL is required, and it may require removing and re-creating some CDC-specific resources. If we think this is important to add, we can look into that more next week
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 added another test that turns a stream off and back on to test the partial reset functionality around adding a stream, so I think that should cover that case and is less complicated than trying to add a table back with the correct CDC sql configurations
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.
@lmossman if the challenge that you are facing in adding a new table in CDC is around publication then you can the publication creation logic in the init script postgres_init_cdc.sql
to include all tables
CREATE
PUBLICATION airbyte_publication FOR ALL TABLES
@benmoriceau @jdpgrailsdev @subodh1810 This PR is ready for review now. I had to use my locally built But please lmk if there is anything else that we should be testing here that I missed! |
cb7780b
to
b24ae1c
Compare
def7f0c
to
6e03cba
Compare
6e03cba
to
befd390
Compare
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.
LGTM
|
||
@Test | ||
public void testPartialResetFromStreamSelection() throws Exception { | ||
LOGGER.info("Starting partial reset cdc test"); |
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.
Nit: you can pass a TestInfo test param to access the test name and log it.
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.
Done
} | ||
|
||
@Test | ||
public void testPartialResetFromStreamSelection() 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.
I agree but the main issue here is that if we break down this test, we will need to duplicate the first sync as many times as there is tests. It is very time consuming.
assertNull(state.getGlobalState()); | ||
} | ||
|
||
private WebBackendConnectionUpdate getUpdateInput(final ConnectionRead connection, final AirbyteCatalog catalog, final OperationRead operation) { |
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 will need to factorize that in my review, will probably move it to the test harness
f04fc4e
to
ce315b5
Compare
This reverts commit 164d7da05990268b09e315eb88ff297d3a9f52f4.
0a6b1f1
to
f8fbefe
Compare
What
Add acceptance test for partial reset of a CDC postgres source.
This PR also adds a second table to the incremental CDC acceptance test since it was needed for the new test anyway.
How
Describe the solution