Commit Graph

974 Commits

Author SHA1 Message Date
Adrian Lanzafame
401eb408c4
rename operationCtx functions
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-04 21:18:12 +10:00
Hector Sanjuan
859cf75a01 Pintracker: improve tests
Avoid writing tests which will hang indefinitely on failure conditions.
Introduce TODOs.
Rename some vars to more explicit names.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 16:13:18 +02:00
Hector Sanjuan
877e65a53d Pintracker: always cancel operation contexts
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 15:24:26 +02:00
Hector Sanjuan
e186dbe2c2 Undo extra delays
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 15:24:26 +02:00
Hector Sanjuan
8b08dfeed8 Pintracker: rename and fmting.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 15:24:26 +02:00
Hector Sanjuan
9856bcdb94 Pintracker: remove timeouts
Pinning/unpinning timeouts are controlled by the ipfs connector component.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 15:24:26 +02:00
Hector Sanjuan
5709e5d03c pintracker: do not register operation after putting it in channel
This creates a race condition where the items may have been
already pinned before the operation is registered in the tracker.

This may result in operations being left in the tracker and potentially
never completed.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
f68c7f5354 ipfshttp: add pin/unpin specific timeouts
and get the tests passing and add Pin/UnpinQueued
tracker statuses back in.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
1eade86209 pintracker: add filtering of operationCtxs as they
come off the pin/unpin channels.

Also fix a race condition in the operationTracker.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
9e20e4e3b2 ipfsconn/ipfshttp: Pass ctx through from rpc_api
to the ipfscluster.IPFSConnector interface and then
to the implementation of that interface in ipfsconn/ipfshttp.
This allows calls from MapPinTracker to cancel requests made
to the local IPFS node.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
ab2a883a3d pintracker/mappintracker: separate status and operation concepts
The TrackerStatuses were starting to be used to convey the inflight
status of an 'operation', instead of just the status of the Pin.
I have separated out any thing related to 'operations' and
an operation's 'phases'.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
a2f59b26af ipfshttp/config: add ClientPostTimeout value
ipfshttp: cancel POST request when timeout reached

ipfshttp/config: fix config test

ipfshttp: use struct styling for multi-line func calls

ipfshttp/config: add general ClientTimeout

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Adrian Lanzafame
5316c3bb4c typos and style nitpicks
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-05-02 15:24:26 +02:00
Hector Sanjuan
a0a0898719
Merge pull request #393 from ipfs/docs/move-to-website
Docs/move to website
2018-05-01 11:14:17 +02:00
Hector Sanjuan
b01ac8f063
Merge pull request #392 from ipfs/fix/ipfsconn/api-compat
ipfsconn/ipfshttp: handle cid args passed in url path correctly
2018-05-01 10:36:58 +02:00
Adrian Lanzafame
b50a05f898
ipfsconn/ipfshttp: go1.9 ServeMux doesn't redirect
query args correctly, requiring both a trailing slash and
non-trailing slash handle pattern to be defined for the
pin and unpin handlers.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-04-30 15:21:03 +10:00
Adrian Lanzafame
22ec210c25
ipfsconn/ipfshttp: handle cid args passed in url path correctly
The extractCid function was added to enable the extraction of
a cid argument from either the url path or query string.
This puts the proxy behaviour on par with the current IPFS API.
The function does rely on the fact that ipfs-cluster doesn't
intercept any command that has more than one subcommand.
If that changes, this function will have to be updated.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-04-30 15:21:03 +10:00
Hector Sanjuan
dbcc5c2fde
Merge pull request #396 from ipfs/fix/empty-config-option
Fix: do not generate "listen_multiaddress" deprecated option in config
2018-04-27 17:17:58 +02:00
Hector Sanjuan
921c17ca47
Merge pull request #397 from ipfs/feat/peer-add-hide
ipfs-cluster-ctl: do not provide "peers add"
2018-04-27 17:17:46 +02:00
Hector Sanjuan
1d20f3de36 ipfs-cluster-ctl: do not provide "peers add"
This uses the PeerAdd endpoint which should NOT be used as the current
workflow states that the way to adding peers is bootstrapping.

Adding peers manually with this endpoint leads to split-head states very
easily. The fact that this operation is visible in ipfs-cluster-ctl
is only leading the users to bad places.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-27 10:27:52 +02:00
Hector Sanjuan
cd32daf4d7 Fix: do not generate "listen_multiaddress" deprecated option in config
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-27 10:24:39 +02:00
Hector Sanjuan
b08b3aba64 Docs: Move to website.
Updated READMEs, removed docs and point everything to website documentation.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-27 09:05:11 +02:00
Hector Sanjuan
01bf4c16be
Merge pull request #394 from ipfs/docker/run-daemon-default
Docker: Run with daemon --upgrade by default.
2018-04-27 08:19:25 +02:00
Hector Sanjuan
2fa41e72f9 Docker: Run with daemon --upgrade by default.
Plus add some warnings for users running the container randomly.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-27 07:57:08 +02:00
Hector Sanjuan
695177a080
Merge pull request #395 from ipfs/fix/upgrade-empty-state
Fix: do not fail when running daemon --upgrade and no state exists
2018-04-27 07:54:33 +02:00
Hector Sanjuan
9e29e646ed Fix: do not fail when running daemon --upgrade and no state exists
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-26 20:19:47 +02:00
Hector Sanjuan
35427801da
Merge pull request #391 from ipfs/doc/guide/basic-auth-creds
doc: fix basic_auth_credentials format in config
2018-04-24 14:47:32 +02:00
Hector Sanjuan
7a826f8240
Merge pull request #390 from ipfs/log/cluster/version-difference-err
cluster: add version diff log to start errors
2018-04-24 14:46:12 +02:00
Sina Mahmoodi
2b02eac5c3 doc: fix basic_auth_credentials format in config
`basic_auth_credentials` in `api` part of the config accepts a map, with username as key and password as value.

License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
2018-04-24 14:44:25 +02:00
Sina Mahmoodi
d8f7a2adcc cluster: add version diff log to start errors
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
2018-04-24 14:27:15 +02:00
Hector Sanjuan
a5710dd055
Merge pull request #387 from ipfs/fix/config/disable-repinnings
Add disable_repinning cluster option
2018-04-24 09:25:40 +02:00
Sina Mahmoodi
03cc809708 config: Add log and testcase for disable_repinning
* Test case creates a bunch of clusters, assigns a pin with replica factor
of n-1 to them, and removes one of the peers randomly. It then tests
to check that the number of clusters pinning the cid is n-2.
* Add warn log to let user know that due to disable_repinning option,
the cluster won't attempt to re-assign the pin.

License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
2018-04-23 22:01:52 +02:00
Sina Mahmoodi
0954c6d6fa Add disable_repinning cluster option
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
2018-04-22 18:40:46 +02:00
Hector Sanjuan
da0915a098
Merge pull request #350 from ipfs/feat/339-faster-tests
Feat #339: faster tests
2018-04-05 18:16:41 +02:00
Hector Sanjuan
0069c0062f Fix metric expire type. Do not discard metrics in Allocate().
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-05 17:57:24 +02:00
Hector Sanjuan
f5f56f2d11 Add some clarifications about delays
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-05 16:49:26 +02:00
Hector Sanjuan
c73e540b7b Pre-create and pre-connect hosts in tests
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-05 16:49:26 +02:00
Hector Sanjuan
dd4128affc Fix #339: Reduce Sleeps in tests
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-05 16:49:26 +02:00
Hector Sanjuan
58acf16efa cluster: introduce PeerWatchInterval config option.
It should provide a way to speed up peer list updates when
peers join/part. It was hardcoded.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-04-05 16:49:26 +02:00
Hector Sanjuan
95ae1746b7
Merge pull request #370 from ipfs/fix/svc/init/lock
cmd/svc/lock: check config dir and file existence
2018-04-05 09:23:50 +02:00
Hector Sanjuan
c651aed5f1
Merge pull request #358 from ipfs/feat/cmd/svc/force-quit
force quit ipfs-cluster-service on second ctrl-c
2018-04-04 12:22:19 +02:00
Adrian Lanzafame
271c743b51 cmd/svc/lock: check config dir and file existence
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-04-03 15:29:27 +10:00
Hector Sanjuan
bebc486bb3 Fix release changelog when having release candidates.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-29 13:47:33 +02:00
Hector Sanjuan
f9c1c44dbb
gx publish 0.3.5
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-29 13:44:25 +02:00
Hector Sanjuan
ed55daf2c6
Release 0.3.5
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-29 13:43:36 +02:00
Hector Sanjuan
92968d287b
Merge pull request #362 from ipfs/0.3.5/changelog
0.3.5/changelog
2018-03-29 13:43:09 +02:00
Hector Sanjuan
6e056c0781
Merge branch 'master' into 0.3.5/changelog 2018-03-29 13:43:01 +02:00
Hector Sanjuan
9c5ca7cfe5
Merge pull request #363 from ipfs/fix/wait
Fix: --wait flag in ipfs-cluster-ctl and WaitFor function
2018-03-29 12:00:08 +02:00
Hector Sanjuan
41433298f5 Fix: --wait flag. Address comments
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-29 11:25:15 +02:00
Hector Sanjuan
851e78ad02 Add test for WaitFor
Actually test that WaitFor waits

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-29 11:23:40 +02:00