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

Delete expunge on 2100+ resources with identical update timestamps will fail on mssql #5055

Closed
steve-corbett-smilecdr opened this issue Jul 3, 2023 · 0 comments · Fixed by #5047
Assignees

Comments

@steve-corbett-smilecdr
Copy link
Collaborator

Delete expunge (and possibly other batch 2 jobs) cannot handle more than 2100 resources with identical timestamps. Specifically, the batch job will incorrectly submit a chunk that vastly exceeds the limit of number of elements in an IN statement in mssql.

To Reproduce
Steps to reproduce the behaviour:

  1. Set up an MSSQL database
  2. Create more than 2100 Patient resources
  3. Run manual SQL to set their update timestamps to the same value: update HFJ_RESOURCE set RES_UPDATED = '2023-06-06 10:35:28' where res_type = 'Patient';
  4. Trigger a delete expunge: DELETE: http://localhost:8000/Patient?_expunge=true
  5. See error

Expected behaviour
The delete should complete without error. All Patient records are removed.

Actual behaviour
In the log output, you will find the following error, and the delete will not succeed:

The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.

Additional context
Note that the error cannot be reproduced with an H2 database, presumably because H2 does not impose the same limitation on the number of elements allowed in an IN statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant