-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
...res/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcTargetPosition.java
Show resolved
Hide resolved
...res/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcTargetPosition.java
Show resolved
Hide resolved
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 |
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.
thank you for the additional comment. Does that mean that somehow, your change is also fixing legacy postgres?
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.
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)
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.
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. |
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.
are we not expecting a checkpoint state message (after the transaction) and a final state message in this case?
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.
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
)
Closes #35963