Open viragtripathi opened 3 months ago
@david7joy @nollenr
As far as we know, statements which are without a transcation are implicitly executed in a transaction. It is possible that we're not setting an explicit transaction here.
One question I have is though, transaction contention probably happens when we're accessing a row for reading while at the same time modifying it (update or delete). Is this true for CRDB?
Preflight checklist
Ory Network Project
No response
Describe the bug
We observed that delete queries are not getting executed within a transaction boundary within CockroachDB. Here is an example query
After further investigation, we suspect that delete queries created by this function is not adhering to transaction boundary, hence not getting committed. Please see, https://github.com/ory/hydra/blob/master/persistence/sql/persister_oauth2.go#L381
code snippet from above url
We see that gobuffalo/pop orm is being used in your code for the sql queries but it's not clear if pop is auto committing or you have an explicit transaction utility to handle the commits.
Due to this behavior, we see a lot of transaction contention in CockroachDB.
Reproducing the bug
Relevant log output
No response
Relevant configuration
No response
Version
v2.2.0 and v2.2.0-rc.2
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes
Additional Context
No response