Commit Graph

2075 Commits

Author SHA1 Message Date
Hector Sanjuan
588596d28e Merge branch 'master' into fix/expose-badger-conf 2019-06-07 21:38:09 +02:00
Hector Sanjuan
445e48445e
Release 0.11.0-rc1 2019-06-07 19:16:15 +02:00
Hector Sanjuan
db050ab435 Fix: default base32 in IPFS breaks cluster pin-ls
The switch to base32 as default output format for cidv1 keys in IPFS pin/ls
responses causes an error in PinLsCid as the base32 string does not correspond
to the base58 string expected by cluster when using an old peer.

This affects old Cluster peers running with new IPFS versions and new cluster
peers running with old IPFS versions for v1 CIDs.

Since Current master uses an updated cid dependency which also uses base32 by
default, master would already work with the latest IPFS daemon, so this is
just allowing to use cluster peers with older ipfs daemons, and preventing a
similar breakage in the future.
2019-06-07 19:08:26 +02:00
Adrian Lanzafame
7ffbbef8de
Merge pull request #807 from ipfs/fix/benchmark-ipfs-status
add IPFSPinStatusFromString benchmark
2019-06-07 11:55:18 +10:00
Hector Sanjuan
6370c1392f
Merge pull request #804 from ipfs/feat/crdt-tracing-hooks
Feat/crdt tracing hooks
2019-06-05 18:32:17 +01:00
Hector Sanjuan
16a2a3611f Reorder imports 2019-06-05 19:31:51 +02:00
Adrian Lanzafame
5a61d5bef8
add IPFSPinStatusFromString benchmark
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-06-05 11:48:39 +10:00
Adrian Lanzafame
a5a44b4049
Merge pull request #806 from MichaelMure/fix-mem-usage
Fix: api: replace two regexes with strings.HasPrefix()
2019-06-05 11:45:40 +10:00
Michael Muré
5515bdd7d7
Fix: api: replace two regex with strings.HasPrefix()
Those regex were compiled with each call to the function. As it's
called by PinLs, this resulted in a significant amount of memory used,
500MB in my case after a single call.

License: MIT
Signed-off-by: Michael Muré <batolettre@gmail.com>
2019-06-04 20:13:35 +02:00
Adrian Lanzafame
21c2b6fbdd
add tracing to all crdt methods
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-31 12:58:26 +10:00
Adrian Lanzafame
4cc5182502
add tracing to crdt hooks
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-31 12:56:33 +10:00
Kishan Mohanbhai Sagathiya
33602b9188 Remove printing the error
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-28 14:08:22 +05:30
Kishan Mohanbhai Sagathiya
96d230a195 Tests to check Timeout is for an update
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-28 14:05:04 +05:30
Hector Sanjuan
35860d337f
Merge pull request #792 from ipfs/feat/protect
Fix #787: Connectivity fixes
2019-05-27 13:27:36 +01:00
Hector Sanjuan
d5cef9d518 Fix: sharness: do not use latest master
latest master breaks (see #797)
2019-05-27 14:27:23 +02:00
Hector Sanjuan
2a2f8c0309 CRDT: Fix protecting of nodes before loading the peerstore
Addresses comments from review #792
2019-05-27 14:27:23 +02:00
Hector Sanjuan
99be078548 Fix: ipfsproxy: fix test failing with empty multiaddresses
This is a recent change in the multiaddress library to disallow
empty addresses.
2019-05-27 14:27:23 +02:00
Hector Sanjuan
196aa23f34 Fix #787: Connectivity fixes
Currently, unless doing Join() (--bootstrap), we do not connect to any peers on startup.

We however loaded up the peerstore file and Raft will automatically connect
older peers to figure out who is the leader etc. DHT bootstrap, after Raft
was working, did the rest.

For CRDTs we need to connect to people on a normal boot as otherwise, unless
bootstrapping, this does not happen, even if the peerstore contains known peers.

This introduces a number of changes:

* Move peerstore file management back inside the Cluster component, which was
already in charge of saving the peerstore file.
* We keep saving all "known addresses" but we load them with a non permanent
TTL, so that there will be clean up of peers we're not connected to for long.
* "Bootstrap" (connect) to a small number of peers during Cluster component creation.
* Bootstrap the DHT asap after this, so that other cluster components can
initialize with a working peer discovery mechanism.
* CRDT Trust() method will now:
  * Protect the trusted Peer ID in the conn manager
  * Give top priority in the PeerManager to that Peer (see below)
  * Mark addresses as permanent in the Peerstore

The PeerManager now attaches priorities to peers when importing them and is
able to order them according to that priority. The result is that peers with
high priority are saved first in the peerstore file. When we load the peerstore
file, the first entries in it are given the highest priority.

This means that during startup we will connect to "trusted peers" first
(because they have been tagged with priority in the previous run and saved at
the top of the list). Once connected to a small number of peers, we let the
DHT bootstrap process in the background do the rest and discover the network.

All this makes the peerstore file a "bootstrap" list for CRDTs and we will attempt
to connect to peers on that list until some of those connections succeed.
2019-05-27 14:27:23 +02:00
Hector Sanjuan
501ee7b41c
Merge pull request #795 from ipfs/deps/update2
Deps: update and related fixes
2019-05-26 09:58:48 +01:00
Hector Sanjuan
a1d95f5637 Fix tests with new host lifecycle handling 2019-05-25 00:53:43 +02:00
Hector Sanjuan
ab46f233e7 Dependency update and cleanup to libp2p-0.0.30
This has been horrible and won't even last, but the fixes in libp2p
required it.
2019-05-25 00:30:25 +02:00
Hector Sanjuan
b46f022884 Raft: rewrite logger
New Raft update has changed the type of the logger
2019-05-25 00:24:30 +02:00
Hector Sanjuan
96edbc1ea6 Daemon: handle host and DHT lifecycle outside Cluster
The Host and DHT are created outside of cluster and should be
shutdown outside of it, not inside.
2019-05-25 00:23:46 +02:00
Hector Sanjuan
da6739a375
Merge pull request #791 from ipfs/feat/connmgr
Feat: introduce a ConnectionManager for the libp2p host
2019-05-23 12:49:53 +01:00
Hector Sanjuan
ba5e423f58 Feat: introduce a ConnectionManager for the libp2p host
As follow up to #787, this uses the default libp2p connection manager for the
cluster libp2p host. The connection manager settings can be set in the main
configuration section (but it should be compatible with previous
configurations which have it unset).

This PR is just introducing the connection manager. Peer connection
protection etc will come in additional PRs.
2019-05-23 00:34:47 +02:00
Adrian Lanzafame
fd82463601
remove omitempty
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:46:28 +10:00
Adrian Lanzafame
a956ec252b
fix panic
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:45:49 +10:00
Adrian Lanzafame
aa5229008c
revert go.mod dep properly
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:43:18 +10:00
Adrian Lanzafame
655aef4011
expose entire badger config
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:43:18 +10:00
Adrian Lanzafame
3d4412ffd4
expose badger loading mode conf
For simplicity, I haven't exposed the entire
badger config. Also, due to go default values and
the badger implementation, I have had to extract the
two loading mode config values so we can determine
whether it has actually has been set by the user in
the json config file.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:42:40 +10:00
Hector Sanjuan
e523215ee2
Merge pull request #789 from ipfs/go-ds-crdt-dep
Update go-ds-crdt
2019-05-21 13:29:46 +01:00
Hector Sanjuan
44d93d61e0 fix timeouts in crdt 2019-05-21 11:55:48 +02:00
Hector Sanjuan
c59873e076 update deps 2019-05-21 11:34:33 +02:00
Hector Sanjuan
9ffd08520d Downgrade discovery 2019-05-21 11:05:51 +02:00
Hector Sanjuan
8c8e449bc9 Update go-ds-crdt 2019-05-21 10:38:37 +02:00
Hector Sanjuan
30ba6f82dd
Merge pull request #502 from ipfs/feat/run-tests-with-race
Fix #340: Run tests with -race
2019-05-20 22:56:50 +01:00
Hector Sanjuan
8e6eefb714 Tests: multiple fixes
This fixes multiple issues in and around tests while
increasing ttls and delays in 100ms. Multiple issues, including
races, tests not running with consensus-crdt missing log messages
and better initialization have been fixed.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-05-20 23:45:04 +02:00
Hector Sanjuan
3e61377f86 Remove some unreachable code 2019-05-17 16:36:30 +02:00
Hector Sanjuan
39481cb613 Issue #497: Better way of handling progress and timeouts for pins & refs 2019-05-17 16:26:27 +02:00
Kishan Mohanbhai Sagathiya
0c31342459 Pin timeouts should start from the last block
Close reset channel
No need for done in checkTimeout

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
aecee5bcaf Use empty struct for channels
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
1b90d871c2 Reset the timer less often 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
7cc09e0efd Dont reset if timer expired 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
9db07ea4c1 Avoid racy behaviour while using timer.Reset 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
c70b77d0bd Remove the data race because of elapsed 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
4e3eadfcb1 Pin timeouts should start from the last block
- a doPostCtx can happen in Pin and then pass the response reader to
either a handleRefsProgress or handlePinProgress
- fixed timeout in Unpin
2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
2b1c25ea52 Remove redundant annotations 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
3ce7f5a56a Unnecessary error printing 2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
1d62d8301e Pin timeouts should start from the last block
Parse response and check for errors
2019-05-17 14:17:47 +02:00
Kishan Mohanbhai Sagathiya
3db5e45069 Pin timeouts should start from the last block
Use timer for checking timeouts
2019-05-17 14:17:47 +02:00