[source-postgres] Airbyte Commits the Wrong LSN When Taking the Initial Snapshot #49803
Labels
area/connectors
Connector related issues
community
connectors/source/postgres
team/db-dw-sources
Backlog for Database and Data Warehouse Sources team
type/bug
Something isn't working
Connector Name
source-postgres
Connector Version
>= 3.6.18
What step the error happened?
None
Relevant information
Summary
Repeating failing pipelines or repeating full refreshing pipelines (Depending on the value for Invalid CDC position behavior Property) after 1st successfull initial sync that occur with the following conditions:
pg_current_wal_lsn()
is always changing.We traced back the issue to the
source-postgres
'sPostgresCdcCtidInitializer
committing the LSN bigger than the state saved offset.Details
The identified behavior in a case of the first refresh run
pg_current_wal_lsn()
to compute the desicion forisSavedOffsetAfterReplicaSlot
airbyte/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcCtidInitializer.java
Line 76 in c6c1f6a
pg_current_wal_lsn()
is always >=confirmed_flush_lsn
pg_current_wal_lsn()
for the second time to use it in the rest of the flow as a Pseudo savedOffsetairbyte/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcCtidInitializer.java
Line 122 in 0178bef
pg_current_wal_lsn()
for the third time to commit it before taking the snapshotairbyte/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcCtidInitializer.java
Line 160 in 0178bef
pg_current_wal_lsn()
for the fourth time to set it as the target lsnairbyte/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/cdc/PostgresCdcCtidInitializer.java
Line 253 in 0178bef
The problem occurs if after taking the initial snapshot no incremental changes were found in the replicaslot for the given publication, as:
Proposed Solutions
Relevant log output
Contribute
The text was updated successfully, but these errors were encountered: