Stack Syncs and Automated Full Resyncs on CDC

  • 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:

  1. 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.
  2. 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)
  3. 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
  4. 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
  5. 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)
  6. 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-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)

Hello there! You are receiving this message because none of your fellow community members has stepped in to respond to your topic post. (If you are a community member and you are reading this response, feel free to jump in if you have the answer!) As a result, the Community Assistance Team has been made aware of this topic and will be investigating and responding as quickly as possible.
Some important considerations that will help your to get your issue solved faster:

  • It is best to use our topic creation template; if you haven’t yet, we recommend posting a followup with the requested information. With that information the team will be able to more quickly search for similar issues with connectors and the platform and troubleshoot more quickly your specific question or problem.
  • Make sure to upload the complete log file; a common investigation roadblock is that sometimes the error for the issue happens well before the problem is surfaced to the user, and so having the tail of the log is less useful than having the whole log to scan through.
  • Be as descriptive and specific as possible; when investigating it is extremely valuable to know what steps were taken to encounter the issue, what version of connector / platform / Java / Python / docker / k8s was used, etc. The more context supplied, the quicker the investigation can start on your topic and the faster we can drive towards an answer.
  • We in the Community Assistance Team are glad you’ve made yourself part of our community, and we’ll do our best to answer your questions and resolve the problems as quickly as possible. Expect to hear from a specific team member as soon as possible.

Thank you for your time and attention.
The Community Assistance Team

A piece of extra information about the source database is that there is a second existing replication_slot used by Fivetran Connectors which have been created using test-decoding plugin.