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
election: Avoid holding the main lock for too long #1364
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.1.x #1364 +/- ##
=========================================
+ Coverage 76.7% 76.99% +0.28%
=========================================
Files 301 301
Lines 56287 56938 +651
Branches 6805 6831 +26
=========================================
+ Hits 43176 43837 +661
+ Misses 12953 12948 -5
+ Partials 158 153 -5
Continue to review full report at Codecov.
|
(cherry picked from commit e1cd5b7)
(cherry picked from commit 08496d1)
As the upper bound of the exponential backoff. (cherry picked from commit c159f3a)
After failures in CHECKING_{SLAVES,MASTER}
The mechanism must be reviewed, for sub-second reactivity.
Weird case managed or the sake of robustness
Minor cosmetic change
When configured and allowed, prior to the election establishment.
GError *err = election_get_peers(M, &n, decache, &peers); | ||
|
||
member_lock(m); | ||
if (err || !peers || !*peers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do something with err
, at least free it 😉
Thanks to @fvennetier, that is always watching!
Thanks to @fvennetier, once again!
Prior to this fix, a small window existed where DB could be created and be seen as READONLY from another thread.
Synchronuous completions are considered harmful, they slow the ZK background thread down.
iThe election can be computed out of the lock.
And mitigate a possible infinite recursion.
The resolution of the peers is now deferred in tasks managed by a GThreadPool, out of any critical section. The decaching upon error is also postponed to the next resolution on that election.