This repository has been archived by the owner on Feb 15, 2018. It is now read-only.
Add startup lock support (general framework + tested etcd implementation) #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm sorry for such a big patch, but I think there was no other way. (Also this PR includes patch from #96, which makes diff even bigger).
This required completely reworking startup sequence in
autocluster.erl
- as adding lockingwould have made the existing dozen step sequence into an incomprehensible
mess. Now steps are more independent and are executed in order with
function that provides something like State + Either monads.
Boot process is now split into 3 stages:
TTL timers are now started there, instead of spreading
-rabbit_boot_steps
through backend modules. This makesautocluster.erl
the single source of truth about what is actuallyhappening during startup.
because of
ignore
failure mode - we want the lock to be releasedeven if some prior steps failed.
During this rework it became evident that explicit mnesia:reset/0 is not
needed (more thorough explanation is in comments for
autocluster:maybe_cluster/1
).Startup locking support should work the same way for every backend, but
for now the only working implementation is for
etcd
. It even has someproperty-based tests =)
Other backend fall back to original random delay behaviour.
Also it looks like
dialyzer
ignores type specs in comments - becausesome of types there were definitely wrong, and converting to them to
-spec
caused a lot of barfing fromdialyzer
.