Skip to content
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

Logical replication failing due to too many sessions being opened with the database #235

Open
XiaozhouWang85 opened this issue Apr 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@XiaozhouWang85
Copy link

Describe the bug
When running with log replication, if the extractor encounters array data, it will open multiple connections to Postgres in order to figure out the array data's schema. When there are large tables that contain array fields, the number of connections being opened to Postgres will cause new connections to be denied. This results in a connection timeout error.

To Reproduce
Steps to reproduce the behavior:

  1. Setup the extractor to run against a large table containing array fields
  2. Perform a migration in Postgres on this large table (causing a large number of records to be dumped into the transaction log)
  3. Run the extractor using log replication
  4. Monitor the increase in connections being opened
  5. Hit connection timeout at Postgres starts rejecting new connections

Timeout error:
name=tap_postgres level=CRITICAL message=connection to server at "XXXXXX" (XXXXXX), port 5432 failed: timeout expired

Spikes in connections count when running Meltano. Behaviour is shown being turned on and off by including / excluding the table containing the array field. Session counts drop after the timeout error is hit.
Screenshot 2024-04-22 at 16 04 11

Expected behavior
There should be options to allow for the array fields to be handled as string or parsed as JSON. I would be hassle to have to write a potentially have to write a UDF in a downstream platform to parse the string but this is better than a process that fails and also degrades the production database or the read replica database.

Your environment

  • Version of tap: 2.1.0
  • meltano:v3.3.0

Additional context
Add any other context about the problem here.

@XiaozhouWang85 XiaozhouWang85 added the bug Something isn't working label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant