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

Fix crash on very large orders #32

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Fix crash on very large orders #32

merged 1 commit into from
Dec 18, 2023

Conversation

raphaelm
Copy link
Member

If an order with ~300 positions exist, even just fetching it from the database will crash our Android apps with something like:

2023-11-23 14:44:10.584  5926-6299  SQLiteQuery             eu.pretix.pretixpos.debug            E  exception: Row too big to fit into CursorWindow requiredPos=0, totalRows=1; query: select id, checkin_attention, code, deleteAfterTimestamp, email, event_slug, json_data, status, valid_if_pending from orders where code = ?

This PR stops storing the entire JSON representation of positions within the order itself, as we already have it in the individual row of the positions, therefore fixing the issue. Unfortunately, this introduces a likely performance regression in the cleanup of old subevents.

It will also require a change to some features in pretixPOS, for which I'll create a separate PR.

@raphaelm raphaelm requested a review from robbi5 November 23, 2023 13:53
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (02945ed) 24.81% compared to head (c80b50f) 25.22%.
Report is 7 commits behind head on master.

Files Patch % Lines
.../java/eu/pretix/libpretixsync/sync/OrderCleanup.kt 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #32      +/-   ##
============================================
+ Coverage     24.81%   25.22%   +0.41%     
- Complexity      383      388       +5     
============================================
  Files           104      105       +1     
  Lines          5618     5807     +189     
  Branches        994     1024      +30     
============================================
+ Hits           1394     1465      +71     
- Misses         4005     4103      +98     
- Partials        219      239      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raphaelm raphaelm merged commit 9a254b1 into master Dec 18, 2023
4 checks passed
@raphaelm raphaelm deleted the position-storage branch December 18, 2023 09:05
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 this pull request may close these issues.

2 participants