Commit Graph

2912 Commits

Author SHA1 Message Date
Hector Sanjuan
6716f5471a Fix: wrong pins metric when batching enabled
When batching is enabled, the "batchingstate" is used to add/remove pins, but the
non-batching state is used as read-only state for doing List().

This means that both states will be writing pins metrics but the batching
state is never used for List(), so it never has the right total number.

This fixes that.
2022-04-25 23:45:34 +02:00
Hector Sanjuan
cc40a37daa Fix date in changelog 2022-04-22 16:46:56 +02:00
Hector Sanjuan
6f01277bd1
Release v1.0.0 2022-04-22 16:42:17 +02:00
Hector Sanjuan
4075789167
Merge pull request #1619 from ipfs/v1.0.0/changelog
Changelog for v1.0.0
2022-04-22 16:39:23 +02:00
Hector Sanjuan
4d66390283 Changelog for v1.0.0 2022-04-22 16:35:17 +02:00
Hector Sanjuan
e69e690194
Merge pull request #1637 from ipfs/pintracker-metrics
metrics: track total pins, queued, pinning, pin error.
2022-04-22 16:15:13 +02:00
Hector Sanjuan
3169fba9d1 metrics: track total pins, queued, pinning, pin error.
This fixes #1470 and #1187.
2022-04-22 15:57:48 +02:00
Hector Sanjuan
4b351cad47
Merge pull request #1634 from ipfs/fix/1633-ctl-error-code
ctl: Set exit status to 1 when app.Run() fails
2022-04-12 12:04:15 +02:00
Hector Sanjuan
288e7f9e3d ctl: Set exit status to 1 when app.Run() fails
1 corresponds to arguments errors and anything that prevents the app from
making a request.
2022-04-12 11:49:26 +02:00
Hector Sanjuan
e4b91af901
Release candidate v1.0.0-rc5 2022-04-11 21:29:23 +02:00
Hector Sanjuan
df47b38b2d
Merge pull request #1632 from ipfs/fix-block-cid-mismatch
Fix warnings on block-cid mismatch when adding
2022-04-11 20:59:11 +02:00
Hector Sanjuan
cd2fe8f655 Fix warnings on block-cid mismatch when adding
Because we are adding blocks on a single call, and we choose the format
parameter based on the prefix of the first block, IPFS will return block CIDs
based on that option.

This caused warnings when adding content that has multiple CID prefixes: for
example, any cid-version=1 file will include both dag-pb CIDs and raw
CIDs. Since the first block is usually a leave, IPFS will only return
raw-cids, and cause a warning because of the CID-mistmatch.

This fixes things by comparing multihashes only.

But! We might be writing blocks with the wrong CID and then the good CID won't
work!

Correct, we might, in some corner cases.

In go-ipfs >= 0.12.0, all blocks are addressed by multihash so CID prefixes
are irrelevant. This problem does not exist in that case.

In go-ipfs < 0.12.0, if a read for a CIDv1 DAG-PB fails, it is retried as it
it was raw. This means that if we wrote something with cidv1/format=raw, that
should have been a cidv1/format=dag-pb, the read will still work. That covers
some common cases (i.e. adding with cid-version=1) because the first block
should be a raw-leaf. Default-params (cidv0) is not affected since everything
is raw multihashes. However, there are still possible CAR layouts etc.  where
cluster will write blocks wrongly to older IPFS versions.
2022-04-11 20:44:40 +02:00
Hector Sanjuan
2827427be8
Merge pull request #1631 from ipfs/fix/recover-all
Bug fixing for v1.0.0-rc4
2022-04-11 19:25:11 +02:00
Hector Sanjuan
fc93e23272 ipfshttp: make blockPut warning a debug message
Something is wrong with it, when adding CAR files.
2022-04-11 15:07:13 +02:00
Hector Sanjuan
3f07b20f3b pintracker: Deadlock on RecoverAll and StatusAll methods 2022-04-11 15:03:33 +02:00
Hector Sanjuan
81fa2c5665
Release candidate v1.0.0-rc4 2022-04-07 15:06:04 +02:00
Hector Sanjuan
e2403c682f
Merge pull request #1626 from ipfs/feat/cid-strings
Adopt api.Cid type - replaces cid.Cid everwhere.
2022-04-07 15:05:00 +02:00
Hector Sanjuan
6706cb9e51
Merge pull request #1628 from ipfs/feat/pin-type-json
types: serialize pin types as string and not as a number
2022-04-07 15:01:41 +02:00
Hector Sanjuan
fbeb7de9f1 Sharness: update state export file 2022-04-07 14:54:16 +02:00
Hector Sanjuan
95521b06a0
Merge pull request #1627 from ipfs/dependency-upgrades
Dependency upgrades
2022-04-07 14:48:02 +02:00
Hector Sanjuan
f01612ca63 types: serialize pin types as string and not as a number
The pin type in json objects will not be understandable by humans
2022-04-07 14:44:04 +02:00
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