-
-
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
Use dedicated mongo session in quota update method #3057
Conversation
12992e3 to
6f2c805
Compare
261f9b8 to
43bb583
Compare
6f2c805 to
702100c
Compare
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)
tw4l
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.
Also tested locally and looking good. Thanks!
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.