-
Notifications
You must be signed in to change notification settings - Fork 20
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
"Payload too large" error when applying a large number of schemas #87
Comments
I removed the migrations from the equation and now it can't even apply the schemas. Going to try turning it off and turning it on again. |
Here's the stack trace I obtained by running with
|
Looks like it's concatenating all of the schema files into one big blob?
So that's surely the problem. I'm sure it's faster and more efficient that way when the blob is small enough to fit in a request, but can I request maybe some way to serialize those requests? |
I think the reason it's done this way is because SurealDB does not currently support cross-request transactions. So, in order to apply a migration, it tries to do it in a single transaction, which doesn't work because of SurrealDB's query size limit. |
@jquesada2016 But this is happening when it's loading the schema files (i.e. a bunch of |
I think it's because if you don't do it in a single transaction, and you have an error in one of your schema files or SurrealDB throws an error, then you would end up in an inconsistant state. Transactions offer a simple mechanism for easily rolling back in case something goes awry. |
Describe the bug
When I apply migrations I'm getting a "413 Payload Too Large" error for a relatively small migration file. I do however have around 1800 schemas and I'm wondering if there's some interaction there.
To Reproduce
I really can't share the dataset but I guess I'm curious about what's going on under the hood when I run
surrealdb-migrations apply
. I know that it first "applies" the schemas, and then starts applying the migrations. I have a lot of schemas but none of them are particularly large (largest file size is maybe 4k?). The migration that it chokes on is 1876 bytes in size.Expected behavior
These are small files, they should apply without errors.
Information
Please complete the following information and remove the unnecessary ones.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: