-
Notifications
You must be signed in to change notification settings - Fork 12
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
ID-896 Isolate Misbehaving Query #1230
Conversation
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 to me" - Greg lol
@@ -1353,7 +1357,7 @@ class PostgresAccessPolicyDAO(protected val writeDbRef: DbReference, protected v | |||
userId: WorkbenchUserId, | |||
samRequestContext: SamRequestContext | |||
): IO[Iterable[ResourceIdWithRolesAndActions]] = | |||
readOnlyTransaction("listUserResourcesWithRolesAndActions", samRequestContext) { implicit session => | |||
readOnlyTransactionReadReplica("listUserResourcesWithRolesAndActions", samRequestContext) { implicit session => |
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.
do you want to do this for all usages of UserResourcesQuery?
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.
Not sure. The query that's been blowing up the DB seems to be the one with as inherited
in it. Being as surgical as possible seems like the right move here.
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 vote that given where we are with this, we isolate this one major offender first. 80/20 rule. We might be able to make things a lot better at some point, but for now we just need to treat the most severe problem.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Ticket: https://broadworkbench.atlassian.net/browse/ID-896
<Don't forget to include the ticket number in the PR title!>
What:
Isolate the misbehaving query to the read replica. All other read/writes go to the main db.
Why:
Read replicas have lag.
How:
Introduce a new
DbReference
to isolate misbehaving queries.PR checklist