-
-
Notifications
You must be signed in to change notification settings - Fork 61
Use dedicated mongo session in quota update method #3057
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
base: additional-minutes-addon-purchase
Are you sure you want to change the base?
Use dedicated mongo session in quota update method #3057
Conversation
12992e3 to
6f2c805
Compare
261f9b8 to
43bb583
Compare
6f2c805 to
702100c
Compare
| org_with_quotas, admin_auth_headers, preshared_secret_auth_headers | ||
| ): | ||
| r = requests.post( | ||
| f"{API_PREFIX}/orgs/{org_with_quotas}/quotas/add", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I removed the /quotas/add endpoint, as we weren't using it directly anymore (using /subscription/addMinutes instead), but could still test this with /quotas/update
ikreymer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and makes sense.
(Remove extra nightly test that was probably readded during merge - that functionality is now being tested in regular tests)
To be merged into #2944
Adds a causally consistent session specifically to the quota update method so that its three operations can operate more-or-less atomically.
We'd looked at doing this with a transaction, but they require a replica set or sharding, which isn't always included in self-hosted Browsertrix deployments. For now this should improve reliability for the multi-operation
update_quotasmethod, even if it's not perfectly atomic — it's pretty unlikely at the scale we're working with here for there to be multiple simultaneous operations for a single org.Tested with local deployment.