I'm in the process of setting-up a datawarehouse using Fivetran as the ETL layer. One of the source databases is a AWS RDS Postgres instance.
I've configured the Postgres instance to perform Logical Replication of the WAL using the test_decoding plugin. All seems to work fine during office hours, however outside office hours when no queries are preformed, the oldest replication slot lag size is increasing despite the fact the Fivetran connector performs a sync.
You can see this in the picture below. In the red box you the replication slot lag size is increasing (top graph) while the synchronization moments keeps happing every hour (bottom graph). I would expect a graph like shown in the green box, were the replication slot lag size is decreasing around the synchronization moments.
I contacted Fivetran with this issue, but they were yet unable to find out the problem, therefore I'm asking the community.
I'm using Postgres version 13.3 with the following custom configuration:
0(required by Fivetran)
The rest of the configuration is default.
I also checked other questions, there's only one that might come close https://dba.stackexchange.com/a/103806/235086, but I'm unsure if it applies here since it about the lag in seconds instead of size.