Coder Social home page Coder Social logo

Refactor log about antidote HOT 14 CLOSED

bieniusa avatar bieniusa commented on June 6, 2024
Refactor log

from antidote.

Comments (14)

angbrav avatar angbrav commented on June 6, 2024

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.

cmeiklejohn avatar cmeiklejohn commented on June 6, 2024

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.

angbrav avatar angbrav commented on June 6, 2024

Ok, on it

Thanks!

from antidote.

angbrav avatar angbrav commented on June 6, 2024

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.

aletomsic avatar aletomsic commented on June 6, 2024

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.

cmeiklejohn avatar cmeiklejohn commented on June 6, 2024

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.

angbrav avatar angbrav commented on June 6, 2024

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.

cmeiklejohn avatar cmeiklejohn commented on June 6, 2024

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.

bieniusa avatar bieniusa commented on June 6, 2024

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.

angbrav avatar angbrav commented on June 6, 2024

I did not know that. Reopening all the issues I closed

from antidote.

bieniusa avatar bieniusa commented on June 6, 2024

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.

cmeiklejohn avatar cmeiklejohn commented on June 6, 2024

Can you open a PR against master with the changes you've made to the logging vnode and associated tests?

from antidote.

angbrav avatar angbrav commented on June 6, 2024

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.

cmeiklejohn avatar cmeiklejohn commented on June 6, 2024

Closing, I believe this has been completed.

from antidote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.