vitorenesduarte / ldb Goto Github PK
View Code? Open in Web Editor NEWReplication of CRDTs
License: Apache License 2.0
Replication of CRDTs
License: Apache License 2.0
$ 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
.
We should provide two shrinking methods:
Before #44 this was done periodically,
but since now we shrink the buffer on every ack,
it does not make sense to still shrink it periodically
(only when the set of neighbors changes)
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.
I was wondering why you were not using partisan for the peer service. Any reason for it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.