Hello! I think I have a good enough approach now (at least balancing complexity and outcome).
Patch (and commit message) is quite explanatory, but in a few words: - add 'upgradeIntent' to PROCLOCK (set by REPACK) - check that in the deadlock detector. If the backend finds the cycle and is part of it, but because it's upgrading an already announced lock, it cancels another backend instead of itself. - use that in the fast path of simple deadlock detection to avoid pointless waiting (for the easy case involving two backends) It doesn't cover all scenarios (explained in patch details) but for majority of realistic scenarios - yes. It may be extended to cover all of them, but I'm not sure it's worth the additional complexity. Best regards, Mikhail.
nocfbot-v2-0001-Protect-concurrent-repack-lock-upgrades.patch
Description: Binary data
