- Is this your first time deploying Airbyte?: No
- OS Version / Instance: Ubuntu 18.04.4 LTS
- Memory / Disk: you can use something like 16Gb / 50GB
- Deployment: Docker
- Airbyte Version: 0.40.3
- Source name/version: Postgres Connector / 1.0.7
- Destination name/version: Snowflake Destination / 0.4.34
- Step: Sync
- Description:
The behaviour that I am about to describe is a little bit complex but I will try to be thorough in order to be as descriptive I can.
Connection Info
We have configured one of our connections using postgres-connector
and snowflake-destination
. From the source database we have configured 2 tables both in
- CDC replication
- Incremental & Deduped History
- Daily Sync on 9 AM, manually triggered through API (Airflow Operator)
The source database is an Aurora Postgres
and for the CDC configuration we have followed your setup instructions, which means that we have created
- A dedicated read-only user granted with the relevant privileges
- A replication slot using ‘pgoutput’ plugin
- A publication slot registered with the 2 tables.
Furthermore, those 2 configured tables are updated in batch operations, which means that for many days there are zero changes, but then due to a scheduled operation process thousands rows are affected (inserts/updates/deletes).
Problem Description
This connection was firstly configured on 2022-09-08T21:00:00Z and until 2022-09-16T21:00:00Z the syncs were working correctly, but after that date there were a weird behaviour. Below are listed all the subsequent runs along with their results:
-
Succeeded | 18.43 MB | 32,033 emitted records | 32,033 committed records | 8m 18s | Sync 9:00AM 09/18 - Those 32,033 records were never actually loaded into the table since they cannot be tracked from the relevant
_scd
history tables. - Succeeded | 28.53 GB | 14,144,163 emitted records | 14,144,163 committed records | 1h 28m 21s | Sync 9:00AM 09/19 - An automated full-resync different from Reset Data Process since it does not drop the tables. (Practically we are not sure how Airbyte decides to proceed with a full resync but is seams to be linked with the weakness of finding out the previous offset of replication slot)
-
Succeeded | 18.43 MB | 32,033 emitted records | 32,033 committed records | 24m 28s | Sync
9:00AM 09/20 - Same with The sync at 2022-09-17T21:00:00Z -
Succeeded | 18.43 MB | 32,033 emitted records | 32,033 committed records | 24m 28s | Sync
9:00AM 09/21 - Same with The sync at 2022-09-17T21:00:00Z - Succeeded | 28.53 GB | 14,144,163 emitted records | 14,144,163 committed records | 1h 28m 21s | Sync 2:45PM 09/21 Same with The sync at 2022-09-18T21:00:00Z (It’s the date were we identified the issue and we manually re-treggired the connection)
-
Succeeded | 18.43 MB | 32,033 emitted records | 32,033 committed records | 24m 28s | Sync
4:14PM 09/21 - After the prior automatic full resync we triggered another sync to check if the connector started to track from the correct state, in which we would expect to have 0 changes, but we got the same result with the run at 2022-09-17T21:00:00Z
I don’t want to deep dive into more details coming from the Airbyte’s log analysis, but I want to leave that part to you. Our main goal from this Topic is to understand the reasons behind these behaviour.
Below you can find the running logs for these dates as also some helpful screenshot from Airbyte Runs and Snowflake’s change aggragations.
Airbyte Run Screenshot
Snowflake Results by grouping _airbyte_emitted_at column
Logs
logs-123–17-09-2022.txt (297.2 KB)
logs-124–18-09-2022.txt (305.8 KB)
logs-125–19-09-2022-full-resync.txt (2.2 MB)
logs-126–20-09-2022.txt (294.1 KB)
logs-127–21-09-2022.txt (296.5 KB)
logs-128-21-09-2022-full-resync.txt (2.2 MB)
logs-129–21-09-2022-last-run.txt (293.9 KB)