-
Notifications
You must be signed in to change notification settings - Fork 76
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
More AAE ports #308
More AAE ports #308
Conversation
Allow the value of `never` so that hashtrees never expire.
When switching to manual mode make sure to clear any pending exchanges in the queue.
This is a port of riak_kv commit 5c346c347beb7459fe70e53275f958a68633f5fb Before this commit, AAE trees were immediately cleared after reaching their expiration time. However, trees would not be rebuilt until some time in the future depending on rebuild concurrency, lock acquisition, etc. Until rebuilt, AAE exchange was impossible. This commit changes rebuild logic to separate expiration from deletion. Once a tree reaches it's expiration time, it is marked as expired but not cleared. AAE exchange against this tree can still occur. Only after an expired tree is actually scheduled for rebuild, and successfully grabs all necessary locks, is the tree cleared.
Add the ability to easily expire all hashtrees just like they can easily be cleared. This may be useful sometime in production if you don't trust the hashtrees for some reason and is also useful for testing.
Make sure that when trees are expired it does not prevent them from exchanging. The entire purpose of expiration is to provide behavior similar to clear except that exchange can occur up until the point of tree rebuilding.
_ = [ok = rpc:call(Node, yz_entropy_mgr, expire_trees, []) | ||
|| Node <- Cluster], | ||
|
||
%% The expire is done very cast so just give it a moment |
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.
very cast. such spelling. wow
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.
LOLOL.
Forgot to link this to #253. |
S. | ||
|
||
-spec get_all_locks(build | rehash, pid()) -> boolean(). | ||
get_all_locks(Type, Pid) -> |
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.
This is a strangely named function. It's only getting one lock, not all.
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.
I use this name to match KV AAE. A lot of this code is strange but want to keep it as close to KV as possible until these two systems merge. It makes porting patches easier.
+1 |
More AAE ports from basho/riak_kv#765.
never
for value ofanti_entropy_expire
to indicatethat trees should never expire automatically (they can still be
expired manually).
manual mode. Active exchanges will be allowed to finish. The reason
for clearing pending exchanges is because manual mode is about
letting the user control what exchanges happen and thus all pending
automatic exchanges should be dropped.
rebuild. Thus when trees expire they are eligible for exchange up
until the moment they are rebuilt. This is a big improvement from
before which would immediately clear (delete) the tree upon
expiration and could mean hours or days of time before that tree
could be exchanged again thus creating a window of no AAE.
yz_entropy_mgr:expire_trees/0
. This may be useful in a productionscenario where the trees are no longer trusted but you still want to
be able to exchange before they are rebuilt. It may also be useful
for testing.
are expired but before they are rebuilt.