Commit Graph
278 Commits
Author SHA1 Message Date
Simon Désaulniers 5aab3078c8 dht: properly handle pagination timings 2016-08-15 12:13:16 -04:00
Simon Désaulniers 1ac5840bb1 dht: let nodes expire properly
The line with `srn->getStatus[query]->setExpired()` in searchNodeGetExpired was
messign with the node expiration process.
2016-08-14 22:08:52 -04:00
Simon Désaulniers 426b3d6834 dht: pagination queries should be in SearchNode
Pagination queries must to be kept in seperate list per node. Otherwise, two
searches could be blocking each others or generating unwanted behavior.
2016-08-11 12:27:04 -04:00
Simon Désaulniers 5c41cbb964 dht: value pagination
Instead of literally asking to a node all values for givent `h`, we first ask
for all ids the node has. Then, we concurently and individually ask for each
values that match each id we recovered in our first request.
2016-08-09 15:43:55 -04:00
Simon Désaulniers e192e3beaf better indentation and comments 2016-08-09 15:42:05 -04:00
Adrien Béraud 5dacb50d63 Merge pull request #108 from sim590/search-refill-from-cache
dht: unify bootstrapSearch and refill method using node cache
2016-08-09 14:41:23 -04:00
Adrien Béraud 86d837b5a9 Merge pull request #106 from sim590/get-timings
[dht] rework get timings after queries in master
2016-08-09 14:23:13 -04:00
kaldoran bbd1200ad7 dht: Fix get and put at the same time on a same node
When the put is performed just after a get, then the get will not include the value which was in the put.
2016-08-08 17:50:56 -04:00
Simon Désaulniers c04ede4909 dht: unify bootstrapSearch and refill method
Since bootstrapSearch was rewritten to use the node cache, it made it clear that
refill should be rewritten as such. However, then bootstrapSearch becomes
irrelevant.

An enhancement to refill is that it will let insertNode review its whole list
of nodes and then let it insert nodes up to SEARCH_NODES nodes. The previous
method would not garantee this behavior since, most of the times, it would pass
less than SEARCH_NODES nodes to insertNode.
2016-08-06 21:14:17 -04:00
Simon Désaulniers f0a92d999c dht: more accurate name for requested nodes count
The number of currently requested nodes, formerly named currentGetRequests, was
renamed since it was not accurately describing the behavior. The number we are
counting is not the number of 'get' requests, but rather the number of nodes
being requested simultaneously.
2016-08-05 21:19:46 -04:00
Simon Désaulniers 28a3498a69 dht: fixing timing in SearchNode::canGet
When a 'get' request associated with a certain 'query' has been sent, we don't
want to send it again, i.e. we don't care if it's pending or not as soon as it
has been sent.
2016-08-05 21:17:58 -04:00
Simon Désaulniers 7eb5d892f1 search: isDone computes using Request interface
There's no need to compute with time since the network engine gives us the
information we need.
2016-08-05 21:17:11 -04:00
Simon Désaulniers af8bfdc1c1 dht: fix sendListen loop bug
Each time a 'listen' request is sent to the network engine, we track this
request in the upper layer with a map<shared_ptr<Query>, shared_ptr<Request>>.
At some point, this map has to be maintained or totally cleared. However, it was
done wrong, hence the sendListen loop. Clearing a pair <Query, Request> has to
be done when the API user cancels a 'listen' operation.
2016-08-03 18:49:37 -04:00
Simon Désaulniers 88040ad467 dht: display debug info according to query impact 2016-08-03 18:49:10 -04:00
kaldoran df3317a5b2 dht: bootstrap from cache instead of routing table 2016-08-03 10:04:02 -04:00
Adrien Béraud b8e10bfe15 const shared_ptr 2016-07-29 21:37:07 -04:00
Nicolas 68707aff17 dht: prevent outdated store of value 2016-07-28 16:58:04 -04:00
Simon Désaulniers 62835bdc54 dht: make main store a vector<unique_ptr<Storage>>
Since the elements inside are going to be moved constantly during the life of
the node, this design is better. Also, it works around a crash when the store is
resized (elements inside moved) at some point (always happenned the 3rd time)
for some reason. This bug was known when compiled with LLVM >7.3.0 (>clang-703.0.31).
2016-07-22 16:57:46 -04:00
Simon Désaulniers 2f72563b1f dht: return consistent query from local storage
When querying from local storage with SELECT f, a FieldValueIndex with empty
fields was returned without considering the SELECT statement requiring only a
field "f".
2016-07-19 15:52:21 -04:00
Simon Désaulniers a4834efd37 dht: use queries in dht 2016-07-10 19:26:13 +02:00
Adrien Béraud b09e3df2e2 add network id to distinguish different networks 2016-06-21 03:06:47 -04:00
Adrien Béraud fdfa10bd2e dht: clear search before expiring it 2016-06-13 15:55:34 -04:00
Adrien Béraud c6b0e531c2 dht: add code documentation 2016-06-11 18:54:18 -04:00
Simon Désaulniers 54a4327039 dht: handle search expired before permanent put 2016-06-03 17:20:58 -04:00
Simon Désaulniers dcca94aab7 dht,api: enable optional permanent put on dht
A permanent put is going to be executed once and every time the data expires on
each SearchNode.
2016-06-03 17:20:58 -04:00
Simon Désaulniers 173a9ee642 revert attempt to avoid securedht cert put fail 2016-06-03 17:20:58 -04:00
Simon Désaulniers ed1ca6db8f Revert "dht: wait for connection before running searches"
This reverts commit bd08506146.
2016-06-03 17:20:58 -04:00
Adrien Béraud 7367158284 dht: new insertNode algorithm 2016-06-03 17:20:58 -04:00
Andreas Traczyk 9e461e0960 microsoft compiler support 2016-06-02 12:17:09 -04:00
Adrien Béraud bd08506146 dht: wait for connection before running searches 2016-05-27 15:39:48 -04:00
Adrien Béraud d44c59016e network_engine: remove onNewNode return value 2016-05-27 14:54:56 -04:00
Adrien Béraud 4d75f64576 log: rename ERROR to ERR to build on Windows 2016-05-27 12:30:32 -04:00
Adrien Béraud c70d5d7b97 dht: don't send nodes in storageChanged 2016-05-27 02:13:08 -04:00
Adrien Béraud d0cebaa002 dht: clear listen status in cancelListen 2016-05-27 01:56:13 -04:00
Adrien Béraud 172b1089fb dht: search log improvements 2016-05-24 03:44:18 -04:00
Adrien Béraud 6cdc242b6e node: add pendingMesageCount 2016-05-24 03:44:18 -04:00
Adrien Béraud 8da15ad450 dht: adapt search routine to network engine 2016-05-22 16:56:47 -04:00
Adrien Béraud 5f1b79e6de dht: minor refactoring/optimisations 2016-05-22 16:56:47 -04:00
Adrien Béraud 0e7dda680a header cleanup 2016-05-22 16:56:47 -04:00
Adrien Béraud 855b69710d dht: run searchStep imediatly on announce 2016-05-19 17:37:39 -04:00
Adrien Béraud d93657d6f9 dht: wait for both AF to call callback 2016-05-19 17:37:39 -04:00
Adrien Béraud 2b57c8109a dht: clear announces on expire 2016-05-19 17:29:19 -04:00
Adrien Béraud a032f50a27 dht: catch all network engine errors 2016-05-19 17:28:31 -04:00
Adrien Béraud 8ee0d83ad7 dht: log cleanup 2016-05-19 17:28:31 -04:00
Adrien Béraud f46043069d revert: dht: limit search nodes to SEARCH_NODES nodes 2016-05-19 01:55:18 -04:00
Adrien Béraud 9d7f6d287a dht: clear candidate on expire 2016-05-18 02:19:06 -04:00
Adrien Béraud 17d57ba04a dht: remove anoying log 2016-05-18 01:23:47 -04:00
Adrien Béraud 9ad21d5c5d dht: remove newSearch() 2016-05-18 01:23:18 -04:00
Adrien Béraud db6c301084 dht: don't count bad nodes in get request count 2016-05-15 01:28:09 -04:00
Adrien Béraud 9b14fc8bb8 dht: use method to count requests 2016-05-14 23:16:23 -04:00