-
-
Notifications
You must be signed in to change notification settings - Fork 760
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 postgresql isolation level #6569
Fix postgresql isolation level #6569
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
@30350n thanks for giving attention to this :) |
@30350n ok, something has broken here... https://github.com/inventree/InvenTree/actions/runs/8041284048/job/21960366000 |
Ok, we recently moved away from |
Hmm, I checked and it wasn't part of the dependencies before #6173 either. |
And the deployment docs mention that you should install it, so I figured that'd be the way to go. |
Also seems like Django 4 requires |
@30350n they call out that they are switching away in the release notes https://docs.djangoproject.com/en/5.0/releases/4.2/#what-s-new-in-django-4-2 so depending on v2 instead of v3 will probably be a problem in the future |
we are on 4.2 so these are the supported/recommended engines https://docs.djangoproject.com/en/4.2/ref/databases/#postgresql-notes |
Ah yeah, I was looking at the docs for 4.0 I see, my bad. I'll make another PR to switch to |
Thanks for addressing this so speedily :) |
No Problem ^^ |
So after fixing my deployment again, I was getting a whole bunch of
django.db.utils.OperationalError: could not serialize access due to concurrent update
errors which also made the interface feel noticeably sluggish (things would straight up not load ~50% of the time).Looking at the existing issues regarding that error, this seems to be caused by the postgresql isolation level setting being set to
ISOLATION_LEVEL_SERIALIZABLE
, which seems to have been messed up during the switch to Django 4 in #6173.I tested this patch on my production server and by clicking through random pages furiously for 2 minutes and didn't get any further errors (before there were sometimes multiple when visiting a single page).