Comments (14)
I am trying to implement this, and it is clear that there should be one log per preflist (as we discussed). I have one doubt though. How can I know the preflists to which a vnode belongs to when initialising the vnode?
I would like to create one table per preflist, and I would like to do it in the init method.
from antidote.
riak_core_ring
provides a series of functions which allow you to get information about preference lists. One such approach is when the virtual node is starting, you create one log for every preference list the current vnode is a member of, using riak_core_ring:all_preflists
from antidote.
Ok, on it
Thanks!
from antidote.
I believe I am almost there refactoring the log. This is what I did in the init method:
{ok, Ring} = riak_core_ring_manager:get_my_ring(),
GrossPreflists = riak_core_ring:all_preflists(Ring, ?N),
Preflists = filter_preflists({Partition, node()}, GrossPreflists, []),
where
filter_preflists(_MySelf, [], FilteredList) -> FilteredList;
filter_preflists(MySelf, [Next|Rest], FilteredList)->
case lists:member(MySelf, Next) of
true ->
filter_preflists(MySelf, Rest, lists:append(FilteredList, [Next]));
false ->
filter_preflists(MySelf, Rest, FilteredList)
end.
I cannot test it yet because of the handoff. I need to reimplement that. I would like to know anyway whether what I have done make any sense or not.
Thank you,
from antidote.
It does, even if it seems a bit heavy.
So, you get all the preflists where you’re a member.
Then when you get an append request you’ll compare the preflist that comes with the operation with all those lists to see to which log you have to write?
Alejandro Z. Tomsic
[email protected]
On May 30, 2014, at 13:30, Manuel Bravo [email protected] wrote:
I believe I am almost there refactoring the log. This is what I did in the init method:
{ok, Ring} = riak_core_ring_manager:get_my_ring(),
GrossPreflists = riak_core_ring:all_preflists(Ring, ?N),
Preflists = filter_preflists({Partition, node()}, GrossPreflists, []),where
filter_preflists(_MySelf, [], FilteredList) -> FilteredList;
filter_preflists(MySelf, [Next|Rest], FilteredList)->
case lists:member(MySelf, Next) of
true ->
filter_preflists(MySelf, Rest, lists:append(FileteredList, [Next]));
false ->
filter_preflists(MySelf, Rest, FileteredList)
end.I cannot test it yet because of the handoff. I need to reimplement that. I would like to know anyway whether what I have done make any sense or not.
Thank you,
—
Reply to this email directly or view it on GitHub.
from antidote.
Yeah, once you get all preference lists you should be able to write a one line fold function to get the ones which you are a member of (which should be the N value) and then just make the log paramerized based on the preference list, unless I misunderstand.
from antidote.
It is done. The logging_vnode now maintains one log per partition (N in total). I also adapted the handoff protocol. I hope I did that part correctly since everything it is quite subtle for me due to the ?FOLD_REQ. It would be great if @cmeiklejohn could take a look to the handoff protocol.
I will close this issue!
from antidote.
I thought we agreed that we wouldn't close issues without a full code review and proof of tests which exercise the behavior?
On Jun 1, 2014, at 11:21, Manuel Bravo [email protected] wrote:
Closed #12.
—
Reply to this email directly or view it on GitHub.
from antidote.
Yes, closing should be done by Chris and me.
Von meinem iPhone gesendet
Am 01.06.2014 um 17:48 schrieb Christopher Meiklejohn [email protected]:
I thought we agreed that we wouldn't close issues without a full code review and proof of tests which exercise the behavior?
On Jun 1, 2014, at 11:21, Manuel Bravo [email protected] wrote:
Closed #12.
—
Reply to this email directly or view it on GitHub.
—
Reply to this email directly or view it on GitHub.
from antidote.
I did not know that. Reopening all the issues I closed
from antidote.
Thanks!
Did you add the test cases?
Annette
On 01 Jun 2014, at 22:37, Manuel Bravo [email protected] wrote:
I did not know that. Reopening all the issues I closed
—
Reply to this email directly or view it on GitHub.
from antidote.
Can you open a PR against master with the changes you've made to the logging vnode and associated tests?
from antidote.
This has already been merged into the master. We are still missing the handoff though. I am kind of blocked here. Help is welcome. This is the test I am using to try to trigger the handoff protocol:
https://github.com/SyncFree/floppystore/blob/handoff_log/riak_test/floppy_log_handoff.erl
from antidote.
Closing, I believe this has been completed.
from antidote.
Related Issues (20)
- The command 'make test' fails when performed locally
- Survey on globally distributed software engineering HOT 1
- Missing Spec Annotations
- Prune / Trim Log
- Prune or Trim Log HOT 1
- Violations of causal consistency found HOT 10
- What's the status of this project? HOT 3
- Problems with inter_dc when the first address in the list leads to connection timeout.
- Update prometheus collector
- Coverdata test file is not cleaned up
- Lint apps/antidote_crdt/test
- Release source code not found warnings for prometheus dependency
- Add test cases for multiple updates on the same key
- Syntax error in antidote/apps/antidote/rebar.lock
- Inter DC partitioning can disrupt replication HOT 1
- Document supported hardware architectures
- pn-counter can lose :ok'd increments in a no fault environment
- pn-counters are susceptible to partitioning
- Document upgrade and downgrade processes
- Last release 2 years old HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antidote.