There are few issues with recovery lock. 1. Recovery master getting banned and losing election simultaneously will cause double-free. 2. If recovery lock is mis-configured, then the node is stuck trying to take recovery lock. 3. Recovery master keeps waiting indefinitely to take a recovery lock.
Created attachment 14893 [details] Patch for 4.10
Created attachment 14894 [details] Patch for 4.9
Patches attached for 4.9 and 4.10. The included patches applied cleanly from master. For 4.9 I have dropped the test patches because they didn't apply. A lot has changed in the test code since then and I don't think the new test is valuable enough to spend time backporting it. I hand tested a bad recovery lock setting under valgrind and it behaved as expected with all nodes banned.
Hi Karolin, This is ready for v4-9 and v4-10.
(In reply to Amitay Isaacs from comment #4) Pushed to autobuild-v4-{10,9}-test.
(In reply to Karolin Seeger from comment #5) Pushed to both branches. Closing out bug report. Thanks!
Reopening this for an extra patch to 4.10. There is a bug in the test code is only triggered when the test code is installed. This doesn't happen in autobuild because the tests are run in-tree. This isn't an urgent fix, so it isn't required for 4.10.0. However, given that it is only in the test code, it would be safe to sneak it in. If it passes autobuild then it can do no harm. ;-)
Created attachment 14937 [details] Additional patch for 4.10
Reopened to add an additional patch, details in comment #7.
Hi Karolin, The additional patch is ready for v4-10. Thanks.
(In reply to Amitay Isaacs from comment #10) Hi Amitay, pushed additional patch to autobuild-v4-10-test. Thanks!
(In reply to Karolin Seeger from comment #11) Pushed additional patch to v4-10-test. Closing out bug report. Thanks!