-
Notifications
You must be signed in to change notification settings - Fork 2
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
Timeout during COPY command #2
Comments
Maybe try changing the timeout value(s) https://supabase.com/docs/guides/database/timeouts. But honestly, I've never seen this come up before, no matter how big the database is. Is this error coming from your Supabase (primary) database or your local database? |
You might also look at the debugging page and adjust the number of works or slots. |
Thanks for the quick reply! Primary, as far as I can tell. Looking at the log entry, it seems like it's written just a bit more than 2 minutes after the session begins:
This seems to correspond with the global limit of 2 minutes mentioned in the timeouts doc. Is there a way to temporarily lift this global limit so we can figure out if that is the reason or not? |
That 2 minute limit is talking about "users", as in users going through the javascript client ( this thread mentions maybe setting the |
Thanks for clarifying! I'm actually not sure how to change these settings. Here's what I'm trying: So it seems like I'm at least able to modify I'm going to try setting up the replication without supabase (just two local postgresql servers) to see if it's something with my local setup or whether it's related to supabase. p.s. I'm a newbie when it comes to PostgreSQL, so I hope I'm not making some trivial mistake and wasting your time here ;-) |
You need to do a quick reset on the database after making changes. From the dashboard go to the Settings Page then click the drop-down to the right of |
Thanks! Meanwhile, I figured out that my local postgres server is at version 14.2, while my Supabase one seems to be on 15.1. I'll try to see if upgrading the local version helps. |
Update: It works locally (even when using 14.2 for the replica and 15.1 for the primary), so probably not a version issue. I'll try playing around with the max_replication_slots / max_worker_processes / timeout settings in Supabase and see if this helps. At least now we have one example of a working setup! |
After running the following commands:
I restarted my database, and now it won't come up :-( Anyway, I contacted Supabase support to see if they could assist with bringing the instance up again. |
I see you have a support thread for this going and that the current status of the database is |
Thanks for looking into this! I'll patently wait then |
It's best to follow up with the support ticket and not here. |
Unfortunately, setting The replication keeps failing every two minutes in the Any other suggestions? |
It looks like you have under 2GB of space available on your primary server, so maybe it's running out of space during the initial replication? The error you're getting doesn't make sense in this case, but maybe it's trying to copy the entire table during the initial process? |
Supabase dashboard claims that I have around 5GB of space available on the primary server: Looking at the network traffic, I can see the data being downloaded to the replica up to the point where the query times out. The replica even says how many records have been read until it timed out - 645082:
|
That may have a lag to it. Looking at your server, there's 1.6GB available on the data partition. You can ask support to increase your disk size a bit and try it again to see if that helps. Are you trying to replicate to a local system, say your laptop, or to another hosted server somewhere, or what? |
Trying to replicate to a local system (desktop), running postgresql inside docker (the official image, alpine flavor, latest 15.1). Managed to get it working between two local postgres servers running inside different docker containers, using the same dataset. I'll try contacting support regarding larger data partition, thanks for the suggestion! |
Thanks for the detailed instructions!
I'm trying this on my Supabase database acting as a primary server (Pro subscription with Small add-on), and a local testing database acting as the replica.
This goes fine until we get to the largest table, which is ~2GB in size. Then the replication fails due to timeout on the primary side:
Any advice on how to make this work?
The text was updated successfully, but these errors were encountered: