You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was noticing that query to increment the downloads column on `crates`
was getting run way more than I'd expect it to be. I also was seeing
logs about a lock contention issue with that query. Specifically, those
logs pointed me at one of two things wrong here.
The first is that we were running this query even if we were
incrementing the value by 0. Second, we have our cutoff set to 2 days
ago. I think the reason for both of these is that we wanted to make sure
the `processed` column got set to true. We can pretty easily avoid this
by just setting it to true for all rows at the very end when all our
preconditions are met.
This doesn't necessarily fix the lock contention problem, but it does
result in hitting far fewer rows, which should alleviate the problem.
0 commit comments