Commit Graph

8700 Commits

Author SHA1 Message Date
Hector Sanjuan
9abb9923af Fix/GC: Do not recursively descend all internal pins
InternalPins() is a pinset composed by:

- Recursive pins CIDs
- Direct pins CIDs
- The empty node CID
- A root CID pointing to all above (and any of the subbuckets that may have been created)

It is only set during Flush/Load operations for the pinner.

Thus recursively exploring internal pins in order to decide which CIDs are safe
from GC only re-explores the recursive DAGs and should not be necessary.

Mind that, previously, the CidSet will correctly prune any already explored branches so
it did not have pernicious effects. But now it does.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-06-21 16:02:16 +02:00
Hector Sanjuan
45e9a4c922 Feat: add --max-depth to the "refs" command
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-06-21 14:35:42 +02:00
Hector Sanjuan
2bd401c5c6 Feat: Arbitrary-depth recursive pin levels.
This implements #5133 introducing an option to limit how deep we fetch and store
the DAG associated to a recursive pin ("--max-depth"). This feature
comes motivated by the need to fetch and pin partial DAGs in order to do
DAG sharding with IPFS Cluster.

This means that, when pinning something to --max-depth, the DAG will be
fetched only to that depth and not more.

In order to get this, the PR introduces new recursive pin types: "recursive1"
means: the given CID is pinned along with its direct children (maxDepth=1)

"recursive2" means: the given CID is pinned along with its direct children
and its grandchildren.

And so on...

This required introducing "maxDepth" limits to all the functions walking down
DAGs (in merkledag, pin, core/commands, core/coreapi, exchange/reprovide modules).

maxDepth == -1 effectively acts as no-limit, and all these functions behave like
they did before.

In order to facilitate the task, a new CID Set type has been added:
thirdparty/recpinset. This set carries the MaxDepth associated to every Cid.
This allows to shortcut exploring already explored branches just like the original
cid.Set does. It also allows to store the Recursive pinset (and replaces cid.Set).
recpinset should be moved outside to a different repo eventually.

TODO: tests
TODO: refs -r with --max-depth

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-06-21 14:35:42 +02:00
Whyrusleeping
2a9de81e64
Merge pull request #5071 from ipfs/feat/ci/archive-trash-dirs
ci: Archive sharness trash dirs
2018-06-18 02:06:31 +08:00
Whyrusleeping
ebb040aa65
Merge pull request #5125 from ipfs/fix/5099
make republisher test robust against timing issues
2018-06-18 01:59:24 +08:00
Whyrusleeping
b516aa1c31
Merge pull request #5122 from ipfs/kevina/filestore-hookup-fix
Fix how filestore is hooked up.
2018-06-18 01:56:52 +08:00
Whyrusleeping
6627ef88e5
Merge pull request #5124 from ipfs/feat/extract-ipns
extract ipns record logic to go-ipns
2018-06-18 01:56:17 +08:00
Steven Allen
dafe495376 extract ipns record logic to go-ipns
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-15 20:10:26 -07:00
Steven Allen
a9cb26c6b8 make republisher test robust against timing issues
retry publishing with a longer EOL if the first attempt fails due to a timeout.

fixes #5099

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-15 20:07:50 -07:00
Łukasz Magiera
39b76d56db ci: archive sharness trash dirs
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-06-15 15:14:25 +02:00
Kevin Atkinson
a598a374e6 Fix how filestore is hooked up.
Closes #5121.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2018-06-15 02:33:01 -04:00
Whyrusleeping
d643c045d2
Merge pull request #5119 from ipfs/ci/disable-mac
disable the MacOS tests in jenkins
2018-06-15 12:59:55 +08:00
Steven Allen
fcf74d4cb7 disable the MacOS tests in jenkins
They've never really been enabled but they:

1. Are causing the tests to fail for various reasons (e.g., out of space).
2. Take time.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-14 09:38:01 -07:00
Whyrusleeping
dbaeb84499
Merge pull request #5091 from ipfs/fix/5029
reduce log level when we can't republish
2018-06-13 15:36:45 +08:00
Whyrusleeping
c39067b1f1
Merge pull request #5095 from Mr0grog/docs/5049-readme-for-docs
Add README to docs folder
2018-06-13 15:36:11 +08:00
Whyrusleeping
cdc349790c
Merge pull request #5072 from Bren2010/review/core
Fix panic. Don't handle errors with fallthrough.
2018-06-13 15:30:58 +08:00
Whyrusleeping
aedc3217b5
Merge pull request #5107 from ipfs/fix/5102
improve swarm connect/disconnect commands
2018-06-13 15:29:02 +08:00
Whyrusleeping
92f3725fd7
Merge pull request #5069 from ipfs/feat/cat-iptb-logs
cat iptb logs on iptb failure (for debugging CI)
2018-06-13 15:27:12 +08:00
Whyrusleeping
1f3a5fe481
Merge pull request #4991 from ipfs/feat/git-plugin-default
plugin: preload git plugin by default
2018-06-13 15:26:27 +08:00
Whyrusleeping
add70f7911
Merge pull request #5108 from Mr0grog/docs/add-coreapi-overview
Add package overview comments to coreapi
2018-06-13 15:24:44 +08:00
Whyrusleeping
9f9ddd561c
Merge pull request #5098 from schomatis/feat/unixfs/fsnode-include-pb
unixfs: integrate `pb.Data` into `FSNode` to avoid duplicating fields
2018-06-13 15:24:24 +08:00
Rob Brackett
319f006386
Add package overview comments to coreapi
License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
2018-06-12 15:56:15 -07:00
Steven Allen
98a1c44489 test swarm connect/disconnect
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-12 14:50:33 -07:00
Steven Allen
78f82e8e79 allow disconnecting from a peer by ID
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-12 14:50:16 -07:00
Steven Allen
39febb1910 make ipfs swarm connect /ipfs/QmId work
fixes #5102

Also, allow specifying multiple addresses for a single peer.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-12 14:37:29 -07:00
Lucas Molas
934b8b0ddc unixfs: integrate pb.Data into FSNode
To avoid duplicating fields and making the code easier to follow.

Remove all of `FSNode` previous fields in favor on a single `pb.Data` structure
that is not exported. Accessor methods are added only for the necessary internal
fields. This takes up more memory, `pb.Data` is always created inside `FSNode`
and it stays there instead of just being created and destroyed during the
(un)marshal operations.

The removed fields `Data`, `blocksizes` and `Type` had a direct counterpart in
the embedded `pb.Data` structure, in contrast (only) the `subtotal` field
doesn't have one, it was used as a temporary accumulator to track the
`Filesize`, which is now being kept updated on every modification (to ensure the
entire `FSNode` is always at a valid state), so `subtotal` could just be removed
without the addition of any other field (this temporary accumulator  was
obscuring how `Filesize` was computed).

To keep `Filesize` up to date a method was added (`UpdateFilesize()`) to adjust
its value in the two places where the file size could be modified, when changing
its data (in `SetData()`, accessor method added) and when adding or removing
child nodes (in `AddBlockSize()` and `RemoveBlockSize()`).

A constructor method was added (`NewFSNode()`) to initialize the required
fields, like `Type` which is explicitly set, this deprecates the previous
methodology of just calling `new(FSNode)` and relying in the default value of
`pb.Data_DataType` (`Data_Raw`) to avoid an explicit assignment. Also,
`Filesize` is initialized to avoid being left with a `nil` value before
marshaling empty nodes, which would result in a different hash from previous
versions, to be backwards compatible. Previous versions of `GetBytes()` always
set the `Filesize` value, even though it is reflected as an `optional` field in
the `.proto` file (this may be an inaccurate field rule).

Without the duplicated fields the functions `GetBytes()` and `FSNodeFromBytes()`
are now reduced to simple `Marshal()` and `Unmarshal()` operations respectively.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-06-11 09:31:33 -03:00
Whyrusleeping
c224ba1dc8
Merge pull request #5093 from ipfs/update/dist
Update dist_root
2018-06-11 12:23:52 +08:00
Whyrusleeping
08fb11fa89
Merge pull request #5100 from ipfs/gx/update-stuff
gx update go-log, sys, go-crypto
2018-06-11 10:55:00 +08:00
Steven Allen
85acad9a01 gx update go-log, sys, go-crypto
* go-log
* sys
* go-crypto

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-08 22:36:24 -07:00
Whyrusleeping
65b8d70eca
Merge pull request #4693 from ipfs/kevina/fix-zero-raw-leaf
Create a raw node instead of a file node when there is no content.
2018-06-08 16:41:24 +08:00
Rob Brackett
76f018cacf
Add README to docs folder, fixes #5049
Also adds a link to the authors list in the top-level README.

License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
2018-06-07 09:57:41 -07:00
Dominic Della Valle
62153f9457 Update dist_root
License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
2018-06-07 12:28:22 -04:00
Steven Allen
82ddae2ba9 reduce log level when we can't republish
This is almost never an error, it just means we don't have any connections. We
could leave this at Warning but we'd like to be able to turn those on by
default at some point.

fixes #5029

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-06 21:36:53 -07:00
Whyrusleeping
fc05376e94
Merge pull request #4817 from ipfs/feat/refactor
transport refactor update
2018-06-06 16:54:55 +08:00
Steven Allen
39f927aa04 update gx imports
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-05 23:55:08 -07:00
Steven Allen
b84a71de8c transport refactor update
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-05 23:51:06 -07:00
Whyrusleeping
e094a84fe0
Merge pull request #5075 from ipfs/gx/update-multiplexers
update multiplexers
2018-06-06 13:02:52 +08:00
Whyrusleeping
f2645c1eb8
Merge pull request #5079 from ipfs/feat/ipns-pubkey-record
embed public keys inside ipns records, use for validation
2018-06-06 01:13:07 +08:00
Jeromy
cc37903b92 drop review TODO comment
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-06-05 08:37:21 -07:00
Jeromy
c66c5c64bb add tests for pubkey mismatch and bad pubkey
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-06-05 07:51:46 -07:00
Jeromy
af68a38033 test to ensure embedding the key in the record works
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-06-05 04:52:17 -07:00
Jeromy
bc129ac5c7 embed public keys inside ipns records, use for validation
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-06-05 02:01:18 -07:00
Steven Allen
c9c9986c9e update multiplexers
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-04 10:05:20 -07:00
Brendan McMillion
8387c394e9 Fix panic. Don't handle errors with fallthrough.
License: MIT
Signed-off-by: Brendan McMillion <brendan@cloudflare.com>
2018-06-03 13:58:58 -07:00
Steven Allen
8f95badb12 cat iptb logs on iptb failure (for debugging CI)
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-03 12:47:52 -07:00
Whyrusleeping
f7a980926b
Merge pull request #4977 from ipfs/fix/4973-1
only resolve dnslinks once in the gateway
2018-06-03 17:20:45 +08:00
Whyrusleeping
d6086fb4bd
Merge pull request #5068 from ipfs/fix/duplicate-sys
fix the duplicate (multiple versions) sys import
2018-06-03 15:06:13 +08:00
Steven Allen
3a373ee349 fix the duplicate (multiple versions) sys import
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-02 23:27:50 -07:00
Whyrusleeping
c3e011b0c2
Merge pull request #5007 from ipfs/feat/routing-refactor
routing fixes/refactor
2018-06-03 13:30:49 +08:00
Steven Allen
e9928f7691 add test for 4973
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-02 20:43:00 -07:00