• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ipfs / ipfs-cluster / 2201
68%
master: 65%

Build:
Build:
LAST BUILD BRANCH: feat/expvar
DEFAULT BRANCH: master
Ran 30 Apr 2018 04:10PM UTC
Jobs 1
Files 42
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2201

push

travis-ci

hsanjuan
Feat: emancipate Consensus from the Cluster component

This commit promotes the Consensus component (and Raft) to become a fully
independent thing like other components, passed to NewCluster during
initialization. Cluster (main component) no longer creates the consensus
layer internally. This has triggered a number of breaking changes
that I will explain below.

Motivation: Future work will require the possibility of running Cluster
with a consensus layer that is not Raft. The "consensus" layer is in charge
of maintaining two things:
  * The current cluster peerset, as required by the implementation
  * The current cluster pinset (shared state)

While the pinset maintenance has always been in the consensus layer, the
peerset maintenance was handled by the main component (starting by the "peers"
key in the configuration) AND the Raft component (internally)
and this generated lots of confusion: if the user edited the peers in the
configuration they would be greeted with an error.

The bootstrap process (adding a peer to an existing cluster) and configuration
key also complicated many things, since the main component did it, but only
when the consensus was initialized and in single peer mode.

In all this we also mixed the peerstore (list of peer addresses in the libp2p
host) with the peerset, when they need not to be linked.

By initializing the consensus layer before calling NewCluster, all the
difficulties in maintaining the current implementation in the same way
have come to light. Thus, the following changes have been introduced:

* Remove "peers" and "bootstrap" keys from the configuration: we no longer
edit or save the configuration files. This was a very bad practice, requiring
write permissions by the process to the file containing the private key and
additionally made things like Puppet deployments of cluster difficult as
configuration would mutate from its initial version. Needless to say all the
maintenance associated to making sure peers and... (continued)

376 of 376 new or added lines in 9 files covered. (100.0%)

4807 of 7128 relevant lines covered (67.44%)

409.81 hits per line

Uncovered Changes

Lines Coverage ∆ File
40
100.0
pstoremgr/pstoremgr.go
35
100.0
consensus/raft/raft.go
20
100.0
cluster_config.go
5
100.0
cluster.go
5
100.0
consensus/raft/consensus.go
4
100.0
consensus/raft/data_helper.go
2
100.0
consensus/raft/config.go

Coverage Regressions

Lines Coverage ∆ File
134
100.0
cluster.go
84
100.0
consensus/raft/raft.go
70
100.0
consensus/raft/consensus.go
33
100.0
cluster_config.go
33
100.0
api/rest/restapi.go
10
100.0
consensus/raft/config.go
7
100.0
util.go
2
100.0
consensus/raft/data_helper.go
2
100.0
ipfsconn/ipfshttp/ipfshttp.go
Jobs
ID Job ID Ran Files Coverage
1 2201.1 30 Apr 2018 04:10PM UTC 0
67.44
Travis Job 2201.1
Source Files on build 2201
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2201
  • 28add34d on github
  • Prev Build on feat/promote-consensus (#2195)
  • Next Build on feat/promote-consensus (#2229)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc