Commit Graph

300 Commits

Author SHA1 Message Date
Hector Sanjuan
a97ed10d0b Adopt api.Cid type - replaces cid.Cid everwhere.
This commit introduces an api.Cid type and replaces the usage of cid.Cid
everywhere.

The main motivation here is to override MarshalJSON so that Cids are
JSON-ified as '"Qm...."' instead of '{ "/": "Qm....." }', as this "ipld"
representation of IDs is horrible to work with, and our APIs are not issuing
IPLD objects to start with.

Unfortunately, there is no way to do this cleanly, and the best way is to just
switch everything to our own type.
2022-04-07 14:27:39 +02:00
Hector Sanjuan
a2b89f9b3b
Release candidate v1.0.0-rc3 2022-03-28 20:44:41 +02:00
Hector Sanjuan
a10f608270
Release candidate v1.0.0-rc2 2022-03-25 13:41:04 +01:00
Hector Sanjuan
116ee23b32
Release candidate v1.0.0-rc1 2022-03-24 20:06:15 +01:00
Hector Sanjuan
eee53bfa4f Streaming Peers(): make Peers() a streaming call
This commit makes all the changes to make Peers() a streaming call.

While Peers is usually a non problematic call, for consistency, all calls
returning collections assembled through broadcast to cluster peers are now
streaming calls.
2022-03-23 01:27:57 +01:00
Hector Sanjuan
0d73d33ef5 Pintracker: streaming methods
This commit continues the work of taking advantage of the streaming
capabilities in go-libp2p-gorpc by improving the ipfsconnector and pintracker
components.

StatusAll and RecoverAll methods are now streaming methods, with the REST API
output changing accordingly to produce a stream of GlobalPinInfos rather than
a json array.

pin/ls request to the ipfs daemon now use ?stream=true and avoid having to
load the full pinset map on memory. StatusAllLocal and RecoverAllLocal
requests to the pin tracker stream all the way and no longer store the full
pinset, and the full PinInfo status slice before sending it out.

We have additionally switched to a pattern where streaming methods receive the
channel as an argument, allowing the caller to decide on whether to launch a
goroutine, do buffering etc.
2022-03-22 15:38:01 +01:00
Hector Sanjuan
9b9d76f92d Pinset streaming and method type revamp
This commit introduces the new go-libp2p-gorpc streaming capabilities for
Cluster. The main aim is to work towards heavily reducing memory usage when
working with very large pinsets.

As a side-effect, it takes the chance to revampt all types for all public
methods so that pointers to static what should be static objects are not used
anymore. This should heavily reduce heap allocations and GC activity.

The main change is that state.List now returns a channel from which to read
the pins, rather than pins being all loaded into a huge slice.

Things reading pins have been all updated to iterate on the channel rather
than on the slice. The full pinset is no longer fully loaded onto memory for
things that run regularly like StateSync().

Additionally, the /allocations endpoint of the rest API no longer returns an
array of pins, but rather streams json-encoded pin objects directly. This
change has extended to the restapi client (which puts pins into a channel as
they arrive) and to ipfs-cluster-ctl.

There are still pending improvements like StatusAll() calls which should also
stream responses, and specially BlockPut calls which should stream blocks
directly into IPFS on a single call.

These are coming up in future commits.
2022-03-19 03:02:55 +01:00
Hector Sanjuan
333b933cd3 service: load pinsvc api first (just order consistency) 2022-03-11 00:45:44 +01:00
Hector Sanjuan
fd57a032e3 service: randomize pinsvcapi ports with --randomports too 2022-03-11 00:07:26 +01:00
Hector Sanjuan
5b0d9d68e3 Merge branch 'master' into feat/pinning-api 2022-03-10 13:41:54 +01:00
Hector Sanjuan
00b7925e78 ipfs-cluster-ctl: support "status cid1 cid2 ..." 2022-03-01 13:25:07 +01:00
Hector Sanjuan
3c56576439
Set development version v0.14.5-next 2022-02-16 17:12:14 +01:00
Hector Sanjuan
e95c4430ee
Release v0.14.5 2022-02-16 17:12:00 +01:00
Hector Sanjuan
2794bd89e8 Fix #1570: fix comment description about graph nodes' color 2022-02-14 14:54:24 +01:00
Hector Sanjuan
5f746f870b
Release candidate v0.14.5-rc1 2022-02-02 01:08:22 +01:00
Hector Sanjuan
524e2ecbc0 Wire in pinsvcapi to ipfs-cluster-service 2022-02-02 00:52:39 +01:00
Hector Sanjuan
dca8923aaa
Set development version v0.14.4-next 2022-01-11 19:13:39 +01:00
Hector Sanjuan
d80a8b42c8
Release v0.14.4 2022-01-11 19:13:28 +01:00
Hector Sanjuan
e7ae13e6cf service: add buffered io for import and export 2022-01-04 18:15:06 +01:00
Hector Sanjuan
e22655a3dc
Set development version v0.14.3-next 2022-01-03 18:01:52 +01:00
Hector Sanjuan
9704bb62e6
Release v0.14.3 2022-01-03 18:00:43 +01:00
Hector Sanjuan
f4c3fc4ce5 State import: allow replication factor and allocations overwrite on import 2021-12-14 11:21:19 +01:00
Hector Sanjuan
5a1d835d90
Set development version v0.14.2-next 2021-12-09 10:02:37 +01:00
Hector Sanjuan
c7cbdee01f
Release v0.14.2 2021-12-09 10:01:33 +01:00
Hector Sanjuan
54d696da60 ipfs-cluster-ctl: improve printing of health metrics
Make sure we print the value in all cases. Use the weight for the free-space
metric, no need to parse the value anymore.
2021-12-08 12:01:59 +01:00
Hector Sanjuan
ea8b392b72
Release candidate v0.14.2-rc1 2021-12-01 02:04:07 +01:00
Hector Sanjuan
7cf40de354 pintracker: Fix attempt count not increasing. Expose priority queueing.
"RetryCount" has been renamed to "AttemptCount", because it counts attempts.
2021-11-30 04:20:35 +01:00
Hector Sanjuan
29c277b67f Pintracker: add and track retry counts in the operation manager.
Report retry count in the PinStatus
2021-11-30 04:20:35 +01:00
Hector Sanjuan
a74b6faf96
Merge pull request #1484 from ipfs/feat/pin-time
Add: include a timestamp that tracks when a Pin was added to the state
2021-10-27 10:42:59 +02:00
Hector Sanjuan
c776051397 ctl: Include "added" column in pin ls command
Also, change format from humanize to "yyyy-mm-dd HH:MM:SS" for times.
2021-10-20 16:55:57 +02:00
Hector Sanjuan
3f895df8cf Fix: backwards compatibility for allocator default settings
When the allocator is not defined in the configuration, it will take defaults
and assume there is a "tags" informer. That is not the case. When not defined,
we assume it should allocate only by "freespace".
2021-10-20 16:55:35 +02:00
Hector Sanjuan
af9313d4fe Remove test files that should have not been committed 2021-10-19 13:51:17 +02:00
Hector Sanjuan
96db605c50
Merge pull request #1468 from ipfs/fix/159-improved-allocators
Add tags informer and enable partition-based peer allocations for intelligent distribution
2021-10-06 14:35:16 +02:00
Hector Sanjuan
26e229df94 Rename allocator/metrics to allocator/balanced 2021-10-06 11:26:38 +02:00
Hector Sanjuan
63972f2b2e API: Refactor REST API. Extract all functionality.
This is a preparatory PR to add additional APIs (Pinning Service API) easily
to cluster.

Instead of copy-pasting most of what the REST API does, I have refactored so
that the whole configuration, routing and request-handling utilities can be
re-used.

The worst part has been to divide the test between tests that test core
(common.API) functionality and tests that test specific REST API endpoint
functionality. I could not get away without an additional common/test package
to provide functions that are used from both places. This is a side effect of
testing both http and libp2p endpoints for every request etc.
2021-09-16 15:52:25 +02:00
Hector Sanjuan
cf4fb74993 service/follow: Enable new metrics allocator 2021-09-15 21:49:26 +02:00
Hector Sanjuan
267deeff28
Set development version v0.14.1-next 2021-08-16 18:03:18 +02:00
Hector Sanjuan
0162df60eb
Release v0.14.1 2021-08-16 18:02:52 +02:00
Hector Sanjuan
e2659af8f6 ctl: WaitFor replication factor min to be reached
Fixes #1427. Currently, if --wait is used when pinning it will wait until all
statuses reported for a pin are either Pinned or Remote. If a peer was lagging
behind and not syncing the state properly (reporting "unpinned" for example),
that would be enough to block waiting.

This modifies the behaviour of wait to return when replication_factor_min is
reached, regardless of what other statuses are.
2021-08-13 11:35:28 +02:00
Hector Sanjuan
2f21724d1d logging: correctly use defaults for LoggingFacilitiesExtra 2021-08-06 11:31:05 +02:00
Hector Sanjuan
ea4dd7ed98
Set development version v0.14.0-next 2021-07-09 00:25:18 +02:00
Hector Sanjuan
f7e6f4a26c
Release v0.14.0 2021-07-09 00:24:00 +02:00
Hector Sanjuan
7a954e4fd2
Merge pull request #1405 from ipfs/feat/speed-up-pin-ls
restapi: allocationsHandler: skip filtering pins when not needed.
2021-07-08 23:56:07 +02:00
Hector Sanjuan
3ba7d79d0a restapi: allocationsHandler: skip filtering pins when not needed.
The restapi component supports filters for the pinset. This was done to keep
expected output when sharding was fully supported by filtering out "internal"
pins.

However this filter requires looping on the full pinset and re-allocating  and
usually does nothing. The useless copy is significant for really big pinsets.

Additionally, ipfs-cluster-ctl set the filter by default to "pins". By setting
it to "all" instead we can skip the whole filtering step and, in practice, get the
same results.
2021-07-08 23:27:55 +02:00
Hector Sanjuan
33c7b5d81a Fix #1403: ctl: ssl errors when talking to https remote peers
When using SSL and not talking to libp2p-http endpoints, we should not
resolve the dns names in the multiaddresses as otherwise we cannot
verify the https certificates used by the remote endpoint.
2021-07-08 23:21:36 +02:00
Hector Sanjuan
3ba27bebb4
Release candidate v0.14.0-rc3 2021-07-08 12:48:30 +02:00
Hector Sanjuan
46a14f9602 Set badger as default datastore for ipfs-cluster-service
This goes back to badger as the default. Testing performed on 0.14.0-rc2
showed very successful GC behaviour on large clusters.

Being that we run with badger at scale and that the main problem seems
resolved, it seems appropiate to default to badger.
2021-07-08 00:37:03 +02:00
Hector Sanjuan
493089d6d0
Release candidate v0.14.0-rc2 2021-07-06 16:56:53 +02:00
Hector Sanjuan
a5ae9fffc4
Release candidate v0.14.0-rc1 2021-07-06 14:07:21 +02:00
Hector Sanjuan
099e23cbd1 Run tests also using leveldb backend 2021-06-11 18:43:54 +02:00