sociomantic-tsunami / dhtproto

Distributed Hash Table protocol definition, client, fake node, and tests
Boost Software License 1.0
5 stars 22 forks source link

Node fallback for Put requests #187

Open gavin-norman-sociomantic opened 5 years ago

gavin-norman-sociomantic commented 5 years ago

Resilience to node outage for Put requests is actually quite simple.

On the client side:

On the node side:

nemanja-boric-sociomantic commented 5 years ago

Note that we don't need to periodically iterate over the set of the nodes, but we can use node's client's connection notifier to sync the orphaned records when the node reconnects with the lost node.

One thing to worry about here (and maybe it's not worth pursuing at this level) is the network partition problem: if you have two nodes A and B which both can talk only to a subset of clients, and which can't talk to each other, both will receive updates for their records and for the records to the node that's not available. Then on the network recovery, both node A and node B will have the new state for the B's records.

gavin-norman-sociomantic commented 5 years ago

The redistribution system could probably be rephrased to work with this too: When the hash range of the node changes, it iterates over its channels, puts out-of-range records into the orphaned records store and lets magic do the rest.

nemanja-boric-sociomantic commented 5 years ago

Ah, yes, that's a nice consequence.