Commit Graph

2891 Commits

Author SHA1 Message Date
Hector Sanjuan
c48f48d5a1
Merge pull request #1625 from ipfs/dependabot/go_modules/dependency-upgrades/github.com/ipfs/go-ipld-format-0.4.0
build(deps): bump github.com/ipfs/go-ipld-format from 0.3.1 to 0.4.0
2022-04-07 14:30:02 +02:00
Hector Sanjuan
595d8c8aeb
Merge pull request #1624 from ipfs/dependabot/go_modules/dependency-upgrades/github.com/ipfs/go-log/v2-2.5.1
build(deps): bump github.com/ipfs/go-log/v2 from 2.5.0 to 2.5.1
2022-04-07 14:29:53 +02:00
Hector Sanjuan
153eeb2107
Merge pull request #1623 from ipfs/feat/always-include-error-trailer
Always include the X-Stream-Error trailer (even without errors)
2022-04-07 14:29:38 +02:00
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
dependabot[bot]
4984e446d7
build(deps): bump github.com/ipfs/go-ipld-format from 0.3.1 to 0.4.0
Bumps [github.com/ipfs/go-ipld-format](https://github.com/ipfs/go-ipld-format) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/ipfs/go-ipld-format/releases)
- [Commits](https://github.com/ipfs/go-ipld-format/compare/v0.3.1...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-ipld-format
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 11:08:14 +00:00
dependabot[bot]
68e1037f0f
build(deps): bump github.com/ipfs/go-log/v2 from 2.5.0 to 2.5.1
Bumps [github.com/ipfs/go-log/v2](https://github.com/ipfs/go-log) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/ipfs/go-log/releases)
- [Commits](https://github.com/ipfs/go-log/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-log/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 11:07:34 +00:00
Hector Sanjuan
d1ab0bd0ee Adjust test checking for trailer errors 2022-04-04 12:45:34 +02:00
Hector Sanjuan
787aea5f31 Always include the X-Stream-Error trailer (even without errors)
This is to potentially address things like this:

https://github.com/nodejs/undici/issues/432#issuecomment-1047931107
2022-04-04 12:09:54 +02:00
Hector Sanjuan
a2b89f9b3b
Release candidate v1.0.0-rc3 2022-03-28 20:44:41 +02:00
Hector Sanjuan
e19809af9d
Merge pull request #1621 from ipfs/rc-fixes
Fixes to BlockStream and adder
2022-03-28 20:44:13 +02:00
Hector Sanjuan
b7769493f4
Merge pull request #1618 from ipfs/dependabot/go_modules/dependency-upgrades/github.com/ipfs/go-path-0.3.0
build(deps): bump github.com/ipfs/go-path from 0.2.2 to 0.3.0
2022-03-28 20:22:54 +02:00
Hector Sanjuan
c5a887f579
Merge pull request #1620 from ipfs/dependabot/go_modules/dependency-upgrades/github.com/ipfs/go-ipld-format-0.3.1
build(deps): bump github.com/ipfs/go-ipld-format from 0.3.0 to 0.3.1
2022-03-28 20:22:38 +02:00
Hector Sanjuan
e287bd1189 adder/single: do not re-add the same node twice
The ipfsadder actually ends up DAG-putting some nodes several times
(i.e. non-leafs, root)... but usually one after the other. This prevents that
and avoids sending the same data multiple times over the wire (not a good
thing to 3x a small payload because of this).
2022-03-28 20:22:03 +02:00
Hector Sanjuan
f07c1e6552 fix: BlockStream rpc: only cancel response context at the end 2022-03-28 17:55:31 +02:00
Hector Sanjuan
8908da32be ipfshttp: abort adding when context cancelled 2022-03-28 17:54:55 +02:00
Hector Sanjuan
e06c1eb8e2 adder: Do not warn about errors when there were none 2022-03-28 13:59:09 +02:00
dependabot[bot]
e41cd74e61
build(deps): bump github.com/ipfs/go-ipld-format from 0.3.0 to 0.3.1
Bumps [github.com/ipfs/go-ipld-format](https://github.com/ipfs/go-ipld-format) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/ipfs/go-ipld-format/releases)
- [Commits](https://github.com/ipfs/go-ipld-format/compare/v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-ipld-format
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 11:06:14 +00:00
Hector Sanjuan
a10f608270
Release candidate v1.0.0-rc2 2022-03-25 13:41:04 +01:00
dependabot[bot]
befec2cc82
build(deps): bump github.com/ipfs/go-path from 0.2.2 to 0.3.0
Bumps [github.com/ipfs/go-path](https://github.com/ipfs/go-path) from 0.2.2 to 0.3.0.
- [Release notes](https://github.com/ipfs/go-path/releases)
- [Commits](https://github.com/ipfs/go-path/compare/v0.2.2...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 12:40:27 +00:00
Hector Sanjuan
aeb69df560
Merge pull request #1617 from ipfs/fix-alternative-architectures
Fix builds on darwin, openbsd...
2022-03-25 13:39:34 +01:00
Hector Sanjuan
267d8c2a17 Fix builds on darwin, openbsd...
go-libp2p-connmgr does not build on some architectures due to some
dependencies (https://github.com/libp2p/go-libp2p-connmgr/pull/103). By
extension, go-libp2p does not build when using the connmgr.

The fix is in master.
2022-03-25 13:38:05 +01:00
Hector Sanjuan
116ee23b32
Release candidate v1.0.0-rc1 2022-03-24 20:06:15 +01:00
Hector Sanjuan
3f1591d544
Merge pull request #1616 from ipfs/fix/policy-gen
RPC: Remove BlockPut from the policy
2022-03-24 19:14:05 +01:00
Hector Sanjuan
15b51e8ab4
Merge pull request #1615 from ipfs/rpc-version-bump
Bump cluster rpc protocol version
2022-03-24 19:13:50 +01:00
Hector Sanjuan
41a33e40c1 RPC: Remove BlockPut from the policy
Since we removed the method
2022-03-24 19:13:11 +01:00
Hector Sanjuan
cf6c2ee85d Bump cluster rpc protocol version 2022-03-24 19:11:02 +01:00
Hector Sanjuan
5207cb34ae
Merge pull request #1614 from ipfs/feat/810-streaming-blocks
Adders: stream blocks to destinations
2022-03-24 18:56:03 +01:00
Hector Sanjuan
1d98538411 Adders: stream blocks to destinations
This commit fixes #810 and adds block streaming to the final destinations when
adding. This should add major performance gains when adding data to clusters.

Before, everytime cluster issued a block, it was broadcasted individually to
all destinations (new libp2p stream), where it was block/put to IPFS (a single
block/put http roundtrip per block).

Now, blocks are streamed all the way from the adder module to the ipfs daemon,
by making every block as it arrives a single part in a multipart block/put
request.

Before, block-broadcast needed to wait for all destinations to finish in order
to process the next block. Now, buffers allow some destinations to be faster
than others while sending and receiving blocks.

Before, if a block put request failed to be broadcasted everywhere, an error
would happen at that moment.

Now, we keep streaming until the end and only then report any errors. The
operation succeeds as long as at least one stream finished successfully.

Errors block/putting to IPFS will not abort streams. Instead, subsequent
blocks are retried with a new request, although the method will return an
error when the stream finishes if there were errors at any point.
2022-03-24 17:24:58 +01:00
Hector Sanjuan
58aea6c392
Merge pull request #1606 from ipfs/dependabot/go_modules/dependency-upgrades/contrib.go.opencensus.io/exporter/prometheus-0.4.1
build(deps): bump contrib.go.opencensus.io/exporter/prometheus from 0.4.0 to 0.4.1
2022-03-23 14:13:10 +01:00
Hector Sanjuan
10e93a7c46
Merge pull request #1608 from ipfs/dependabot/go_modules/dependency-upgrades/google.golang.org/protobuf-1.28.0
build(deps): bump google.golang.org/protobuf from 1.27.1 to 1.28.0
2022-03-23 14:13:02 +01:00
Hector Sanjuan
400869efc0
Merge pull request #1613 from ipfs/update-go-codec-dagpb
Dependency: update go-codec-dagpb
2022-03-23 14:12:50 +01:00
Hector Sanjuan
2dd8d5b1ec Dependency: update go-codec-dagpb 2022-03-23 02:05:38 +01:00
Hector Sanjuan
3884f6a9d5
Merge pull request #1611 from ipfs/streaming-peers
Streaming Peers(): make Peers() a streaming call
2022-03-23 02:03:00 +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
dependabot[bot]
7aa1f3344d
build(deps): bump google.golang.org/protobuf from 1.27.1 to 1.28.0
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.27.1 to 1.28.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.27.1...v1.28.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 14:53:37 +00:00
Hector Sanjuan
2d94c42310
Merge pull request #1607 from ipfs/feat/streaming-status
Pintracker: streaming methods
2022-03-22 15:52:34 +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
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