-
Notifications
You must be signed in to change notification settings - Fork 37
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
Eliminated the Map from MerkleMap #47
base: master
Are you sure you want to change the base?
Conversation
… Crdt process when Erlang's cluster connection isn't steady.
…and added a limited number of retries.
… must be considered during :set_neighbours message.
Hi @balena, Thanks for the PR! Can you let me know when you are done adding commits? Then I can review :D Also, if you could check the Issues list and link any bugs you think might be solved by these changes, that would also be very much appreciated. Cheers, |
Hey @derekkraan, Sorry for adding more changes to the PR. I would have created a separated branch instead of using
I'm using In order to tackle the first issue, I've studied the internal data representation and noticed that you're duplicating data at the Merkle trie level, there in the leafs, storing keys and values which key hash collided, and also storing the same values in the But when you have long key/values, or the amount of tuples gets long, say 100,000 entries having each tuple around 300 bytes, with synchronization interval set to 4.5s, ~30-40% of the tuples get changed in this interval, things start to get more serious. Erlang will avoid duplicating in-memory data as long as your 3 storages are kept the same. However, mutations cause memory consumption spikes. Moreover, some You said to link issues to the PR, but I didn't find someone reporting the above issue, so I'll end up creating them here. It's not related to |
@balena I have two questions:
|
Hi @balena I was wondering if you were still interested in pursuing this PR. |
I think it would be easier for me to evaluate and merge changes if we could split this PR up into smaller pieces.
|
Hey @derekkraan, Yes I can split. Sorry for the continued work on the code. I’m currently not using Horde anymore after a lot of trouble with it in an unreliable, high traffic, varying latency network. I’ve faced high memory usage, processes getting stuck (that’s the “nosuspend” change), duplicated processes (though using Horde.Registry) etc. However in practice none of these alternatives fixed the problems. Eventually I’ve wrote a thin wrapper around the new Erlang Let me know which parts you think relevant and I’ll split. Regards, |
Instead of using
MerkleMap
, theDeltaCrdt
implementation can use just theMerkleMap.MerkleTree
. Advantage is a slight reduction in the processing time (~ /2) as it is not needed to insert data on theMap
and on theMerkleTree
. However in terms of memory usage, there isn't a big difference, as the data inserted in both structures are actually references (immutability goodies). Memory usage reduction is restricted to the "overhead" memory used by theMap
. More details in the Erlang's Efficiency Guide.