-
Notifications
You must be signed in to change notification settings - Fork 174
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
Electric crashes during loading of large amount of data into Postgres, and restarts with an empty shape. #2073
Comments
In the video below:
Screen.Recording.2024-12-02.at.12.17.03.mp4Log of the crash:
|
This crash is due to the size of the transaction loading the data. The script to load the data was doing it in a single transaction, splitting it into batches prevents the crash. |
okay, we can work around that in the meantime, but will keep the issue open for tacking the issue you've found |
investigate the amount of memory that the large transaction took and document a limit of size for the transactions |
I'll investigate this further but my first attempt at reproducing this wasn't successful: I modified the data-loading script to load all issues and comments in one transaction and followed the reproduction steps. Once the transaction was committed in Postgres, it took Electric 20-30 seconds to fully process it. I was eyeing its memory usage in |
The shape log file ended up 141 MB in size. By far the least efficient part of the process was serving the shape to a client. Our current chunking algorithm drip-feeds client with 10KB chunks and it is taking forever to load even 25k issues. |
We've learned that the machine might have been too small to handle the shape. I opened #2101 and we're working on initial snapshot chunking. Maybe we can close this issue for now. |
Working on the PGlite Linearlite demo. I have a script that resets the Docker images (Postgres + Electric) and then loads a number of issue and comments (I've been aiming for 100k issues and 500k comments). Sometimes Electric crashes (with no error in the log) while that load-data script is running, I think it's when I have the app open and so its trying to connect and sync. When this happens, and I restart Electric the shape is empty... as in the shape exists but it doesn't have any of the issues/comments that i inserted in the database.
So there are two related things here:
Somehow I'm crashing Electric when I load a large amount of data into Postgres
When it crashes in this situation the shape exists but is empty - it clearly needs to be recycled and recreated
I'm going to dig in a little more and try and create a simple reproduction and some logs.
The text was updated successfully, but these errors were encountered: