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

Import railjson command fails with big infra #2328

Closed
flomonster opened this issue Nov 10, 2022 · 0 comments · Fixed by #2334
Closed

Import railjson command fails with big infra #2328

flomonster opened this issue Nov 10, 2022 · 0 comments · Fixed by #2334
Assignees
Labels
area:editoast Work on Editoast Service difficulty:good first issue Good for newcomers kind:bug Something isn't working

Comments

@flomonster
Copy link
Contributor

Describe the bug
When trying to import an infra with more than $2^{16} - 1$ objects (of the same type), the command fails.

To Reproduce
Steps to reproduce the behavior:

  1. In editoast run this command: editoast import-railjson my_infra /path/to/infra.json

Make sure that the infra you're importing is big enough.
The command fails with the following error message:

An internal diesel error occurred: 'number of parameters must be between 0 and 65535

Expected behavior

The command should work.

How to fix:

The functions persist_batch must handle vectors with a lot of elements by doing multiple pg queries.

@flomonster flomonster added kind:bug Something isn't working difficulty:good first issue Good for newcomers area:editoast Work on Editoast Service labels Nov 10, 2022
@Khoyo Khoyo self-assigned this Nov 14, 2022
Khoyo added a commit that referenced this issue Nov 14, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
Khoyo added a commit that referenced this issue Nov 21, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
flomonster pushed a commit that referenced this issue Nov 23, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
flomonster pushed a commit that referenced this issue Nov 23, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
flomonster pushed a commit that referenced this issue Nov 23, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
flomonster pushed a commit that referenced this issue Nov 25, 2022
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
alexandredamiron pushed a commit that referenced this issue Jan 17, 2023
Diesel only accepts 65535 parameters per query, so we need to chunk our
insertions when importing big infras.

Fixes #2328.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editoast Work on Editoast Service difficulty:good first issue Good for newcomers kind:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants