Skip to content
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

[Source-postgres] : Compare each record’s lsn_commit value instead of lsn_proc. #35939

Merged
merged 15 commits into from
Mar 13, 2024

Conversation

akashkulk
Copy link
Contributor

@akashkulk akashkulk commented Mar 10, 2024

Closes #35963

Copy link

vercel bot commented Mar 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 4:58pm

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/source/postgres labels Mar 10, 2024
@octavia-squidington-iii octavia-squidington-iii removed the CDK Connector Development Kit label Mar 11, 2024
@akashkulk akashkulk changed the title [Understanding postgres cdc sequences] [Source-postgres] : Compare each record’s lsn_commit value instead of lsn_proc. Mar 11, 2024
@akashkulk akashkulk marked this pull request as ready for review March 12, 2024 22:29
@akashkulk akashkulk requested a review from a team as a code owner March 12, 2024 22:29
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Mar 12, 2024
@akashkulk akashkulk requested a review from rodireich March 12, 2024 22:51
if (!isOnLegacyPostgres()) {
assertTrue(stateMessagesCDC.size() > 1, "Generated only the final state.");
}
// We expect only one cdc state message, as all the records are inserted in a single transaction. Since
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the additional comment. Does that mean that somehow, your change is also fixing legacy postgres?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite. For legacy postgres, only one state message was expected (not sure why).

So this change just streamlines the test to check for just one state message instead of multiple (which I'm not sure was a good test to begin with)

Copy link
Contributor

@stephane-airbyte stephane-airbyte Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we NEVER are on legacy postgres... Let's remove that method altogether, no?

}
// We expect only one cdc state message, as all the records are inserted in a single transaction.
// Since
// lsn_commit only increases with a new transaction, we expect only one state message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we not expecting a checkpoint state message (after the transaction) and a final state message in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one state message we expect is after the dbz engine is shut down. In this case, there is just one transaction so only one state message is expected. (that's the change we're trying to test by comparing against lsn_commit and not lsn_proc)

@akashkulk akashkulk merged commit 609d602 into master Mar 13, 2024
30 checks passed
@akashkulk akashkulk deleted the akash/pg-cdc-dbz-state branch March 13, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/postgres
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Source-postgres] : Compare each record’s lsn_commit value instead of lsn_proc.
5 participants