-
Notifications
You must be signed in to change notification settings - Fork 5
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
prevent db deadlocks while updating feature tags [MRXN23-316] #1578
prevent db deadlocks while updating feature tags [MRXN23-316] #1578
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@KevSanchez so, I've been unable to consistently reproduce the db transaction festival in my local dev environment, but I'm actually able to reproduce this almost always on marxan23 with the current Not that I've actually spent hours doing this, but combining my initial guess of where the issue may have been, with the changes I'm suggesting in this PR as well as the behaviour just noted above about reproducing this (or not) on marxan23, I'd be inclined to vaguely trust that the mix of in-transaction and out-of-transaction db ops in the current implementation may be at least part of the observed behaviour. Given how jumpy the behaviour is, I am not sure how to test that the proposed fix is indeed a fix and that the observed problem is indeed a problem: I think the problem manifests itself depending on timing of sequential operations, so even writing a test that for example creates 100 features and then tries to bulk edit their tags all at once may occasionally still pass without the changes in this PR depending on... things (sequence of requests, load on CPU and IO for the node where the tests are running, etc.). Maybe still worth it through brute force? I am not sure. Especially at this stage I'd be inclined to be satisfied with a cross-check of the changes from your end. |
I think it's best to do as you suggest, as the nature of the error was really erratic for me too; I could bulk edit a couple of tags several times in a row without issue, and other times, even right after spinning the API up. |
0d792c8
to
40b178b
Compare
40b178b
to
9fde377
Compare
Thanks @KevSanchez. So I suggested a "brute-force" approach to testing this, here: 9fde377 Green on the current PR's branch with the "fix" applied: https://github.com/marxan-cloud/marxan-cloud/actions/runs/6880148837/job/18713710344 Red in a separate branch where I only included the test added on top of As I would expect, this test fails because of timeout, as the trouble is at db level. For this reason, I'm not too convinced that this is a wise thing to do, but I'd say, unless you hate it, let's include the test in this PR and if it turns out to be a fickle test in practice (it surely is in principle), then we do something about it. |
https://vizzuality.atlassian.net/browse/MRXN23-316