Git Product home page Git Product logo

ldb's People

Contributors

gyounes avatar vitorenesduarte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

castellanprime

ldb's Issues

Problems in pure-op-based mode

$ LDB_MODE=pure_op_based make shell

If I do this and wait long enough, I see:

[warning] Unhandled info message: check_resend

Ignoring that, I can't use a gcounter:

1> ldb:create(a, gcounter).
ok
2> 2> ldb:update(a, increment).
17:35:15.028 [error] gen_server ldb_pure_op_based_backend terminated with reason: no function clause matching ldb_pure_op_based_backend:encode_op(increment) line 415
17:35:15.041 [error] CRASH REPORT Process ldb_pure_op_based_backend with 1 neighbours exited with reason: no function clause matching ldb_pure_op_based_backend:encode_op(increment) line 415 in gen_server:terminate/7 line 826
** exception exit: {{function_clause,
                        [{ldb_pure_op_based_backend,encode_op,
                             [increment],
                             [{file,
                                  "/home/user/Downloads/ldb/_build/default/lib/ldb/src/ldb_pure_op_based_backend.erl"},
                              {line,415}]},
                         {ldb_pure_op_based_backend,handle_call,3,
                             [{file,
                                  "/home/user/Downloads/ldb/_build/default/lib/ldb/src/ldb_pure_op_based_backend.erl"},
                              {line,154}]},
                         {gen_server,try_handle_call,4,
                             [{file,"gen_server.erl"},{line,629}]},
                         {gen_server,handle_msg,5,
                             [{file,"gen_server.erl"},{line,661}]},
                         {proc_lib,init_p_do_apply,3,
                             [{file,"proc_lib.erl"},{line,240}]}]},
                    {gen_server,call,
                        [ldb_pure_op_based_backend,
                         {update,a,increment},
                         infinity]}}
     in function  gen_server:call/3 (gen_server.erl, line 212)

Changing encode_op and decode_op seems to solve it.

%% @private
encode_op({add, E}) ->
    {1, E};
encode_op(Op) ->
    Op.

%% @private
decode_op({1, E}) ->
    {add, E};
decode_op(Op) ->
    Op.

About the check_send, it seems that its handler is handle_cast and it should be handle_info.
However, doing that change, seems to break the ldb:update.

Implement delta buffer shrinking

We should provide two shrinking methods:

  • only remove entries acknowledged by all peers
  • clear the buffer (provoking new sync for every pair of peers)

Refactor Scuttlebutt backends

Refactor scuttlebutt and vanilla_ scuttlebutt into a single backend and have garbage collection be a performance optimization as BP and RR.
Also, the delta-buffer in this backend could have its own module, as the buffer in the delta-based backend.

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.