Commit Graph

2705 Commits

Author SHA1 Message Date
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
dependabot[bot]
d2fc658e59
build(deps): bump contrib.go.opencensus.io/exporter/prometheus
Bumps [contrib.go.opencensus.io/exporter/prometheus](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus/releases)
- [Commits](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: contrib.go.opencensus.io/exporter/prometheus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-19 11:40:12 +00:00
Hector Sanjuan
d01fcdf25c
Merge pull request #1602 from ipfs/streaming-state
Pinset streaming and method type revamp
2022-03-19 12:38:52 +01:00
Hector Sanjuan
055afbfafd api client: do not break if streaming endpoint returns 204 2022-03-19 12:26:15 +01:00
Hector Sanjuan
957b3ec278 Sharness: fix tests for new pin ls json output 2022-03-19 12:19:12 +01:00
Hector Sanjuan
f5d78811c1 update go-libp2p-gorpc to 0.3.0 2022-03-19 12:09:23 +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
b77ad92ade
Merge pull request #1599 from ipfs/fix/1598
Fix 1598: Include allocations in responses from /add
2022-03-15 11:51:36 +01:00
Hector Sanjuan
6b0b0afdb0
Dependency upgrades (#1600)
Dependency upgrades
2022-03-15 11:50:44 +01:00
Hector Sanjuan
1c8b6eea03 Adders: try to never return an empty peer ID as part of allocations 2022-03-15 11:34:09 +01:00
Hector Sanjuan
759dd4802d Fix 1598: Include allocations in responses from /add
This adds a new allocations field to add response objects which
provides the cluster peers to which the content has been allocated.

In the case of sharded dags, it provides peers for the current shard.
2022-03-15 11:03:11 +01:00
Hector Sanjuan
358057b289
Merge pull request #1483 from ipfs/feat/pinning-api
Feat: add a new API component that implements the Pinning services API
2022-03-14 15:04:00 +01:00
Hector Sanjuan
e4b11b783b Pinsvcapi: address comments from review
- Add "Created" field to pinInfo.
- Support before/after filter
- 404 when something is unpinned or on a non-recognize state
2022-03-14 12:21:08 +01:00
Hector Sanjuan
0c556ef4fa tests: fix staticcheck/vet errors 2022-03-11 16:47:41 +01:00
Hector Sanjuan
3029972750 pinsvcapi: test GetPin and DeletePin endpoints 2022-03-11 16:41:48 +01:00
Hector Sanjuan
c871c85f98 stateless: cast empty peer.ID correctly 2022-03-11 16:41:22 +01:00
Hector Sanjuan
fbc69ee3c6 pinsvcapi: fix several API test failures 2022-03-11 16:18:08 +01:00
Hector Sanjuan
cd5f9c869d pinsvcapi: Test and fix bugs in Add Pin. Improve performance. 2022-03-11 14:01:15 +01:00
Hector Sanjuan
f8812b3af7 pinsvc: fixes and testing for List endpoint 2022-03-11 12:58:12 +01:00
Hector Sanjuan
fe4c0f61c9 stateless: fix test mock rpc 2022-03-11 09:58:19 +01:00
Hector Sanjuan
ab33ec668c pinsvcapi: fix some basic bugs 2022-03-11 00:46:39 +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
5fed4a2c5e types: include IPFSAddresses in pinInfo objects.
pinsvcapi: do not cache peer information here as all the needed information is
in the status objects.

This adds ipfs_addresses as a field broadcasted with the ping metrics.
2022-03-10 23:49:01 +01:00
Hector Sanjuan
5b0d9d68e3 Merge branch 'master' into feat/pinning-api 2022-03-10 13:41:54 +01:00
Hector Sanjuan
e1ff8989b9
Merge pull request #1596 from ipfs/feat/batch-log-info
crdt: log when batches are committed
2022-03-10 13:31:50 +01:00
Hector Sanjuan
b8327e25e3 crdt: log when batches are committed 2022-03-10 00:15:12 +01:00
Hector Sanjuan
b37580f91f
Merge pull request #1592 from ipfs/feat/1564-status-cids-client
Support querying status for multiple CIDs in clients
2022-03-01 13:43:57 +01:00
Hector Sanjuan
00b7925e78 ipfs-cluster-ctl: support "status cid1 cid2 ..." 2022-03-01 13:25:07 +01:00
Hector Sanjuan
a1b6dabbb0 Add StatusCids() to Restapi client 2022-03-01 13:13:52 +01:00
Hector Sanjuan
d4b2cf4857
Merge pull request #1591 from ipfs/fix/1585-pin-only-trusted
allocator: Filter out metrics from non-trusted peers when configured
2022-03-01 13:04:50 +01:00
Hector Sanjuan
116cef5cfc allocator: Filter out metrics from non-trusted peers when configured
Adds pin_only_on_cluster_peers configuration option
2022-03-01 11:25:16 +01:00
Hector Sanjuan
a046af811c
Merge pull request #1590 from ipfs/feat/pin-false
Adder: Add "no-pin" option.
2022-02-28 20:25:24 +01:00
Hector Sanjuan
00dffe23b8 Adder: Add "no-pin" option.
This does 3 things:

- Add a NoPin option to the adder. When set to true, the adding process does not
send a pin in the end.

- When user-allocations are set and local=true happens, we do not overwrite
  the allocations returned by the allocator to include the local peer
  anymore, as this could alter user-allocations.

- Some code improvement (remove pointers).
2022-02-28 20:10:12 +01:00
Hector Sanjuan
36c38be948
Merge pull request #1589 from ipfs/fix/1586-remove-distribution-test
monitor: Remove Distribution() method and test.
2022-02-28 18:33:30 +01:00
Hector Sanjuan
49825d1df7 monitor: Remove Distribution() method and test.
Follow up to #939. Fixes #1586.
2022-02-28 17:47:34 +01:00
Hector Sanjuan
9e35b7bc9b Fix links in latest CHANGELOG entry 2022-02-16 17:17:29 +01:00
Hector Sanjuan
4f2f59e6cd CHANGELOG: Mention that failure threshold no longer has effect 2022-02-16 17:17:04 +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
c88b056ab2
Merge pull request #1584 from ipfs/v0.14.5/changelog
Changelog for v0.14.5
2022-02-16 17:11:39 +01:00
Hector Sanjuan
7034d50f64 Changelog for v0.14.5 2022-02-16 17:10:47 +01:00
Hector Sanjuan
3ba9dda592
Merge pull request #1582 from ipfs/update-go-ds-crdt-4
Update go-ds-crdt with panic fix
2022-02-16 15:08:26 +01:00
Hector Sanjuan
8583953357 Update go-ds-crdt with panic fix 2022-02-16 14:20:46 +01:00
Hector Sanjuan
93efde804c
Merge pull request #1581 from ipfs/fix/log-levels
Fix/log levels
2022-02-15 20:22:33 +01:00
Hector Sanjuan
b36d2b1146 Log error by default in go-libp2p-gorpc 2022-02-15 19:39:24 +01:00
Hector Sanjuan
d0e905babe Fix critical log level
The CRITICAL log level no longer exists and we were logging more than we
wanted to.
2022-02-15 19:38:33 +01:00
Hector Sanjuan
3ffaf0fcc7
Merge pull request #1579 from ipfs/gorpc-upgrade
go-libp2p-gorpc upgrade
2022-02-15 19:33:43 +01:00
Hector Sanjuan
4c40ab5547
Merge pull request #1580 from ipfs/dependency-upgrades
Dependency upgrades
2022-02-15 19:33:14 +01:00
Hector Sanjuan
fa36958221 Merge branch 'master' into dependency-upgrades 2022-02-15 19:14:50 +01:00