diff --git a/raft/README.md b/raft/README.md index 6ae005c95..0ddf3f48f 100644 --- a/raft/README.md +++ b/raft/README.md @@ -13,7 +13,7 @@ To keep the codebase small as well as provide flexibility, the library only impl In order to easily test the Raft library, its behavior should be deterministic. To achieve this determinism, the library models Raft as a state machine. The state machine takes a `Message` as input. A message can either be a local timer update or a network message sent from a remote peer. The state machine's output is a 3-tuple `{[]Messages, []LogEntries, NextState}` consisting of an array of `Messages`, `log entries`, and `Raft state changes`. For state machines with the same state, the same state machine input should always generate the same state machine output. -A simple example application, _raftexample_, is also available to help illustrate how to use this package in practice: https://github.com/coreos/etcd/tree/master/contrib/raftexample +A simple example application, _raftexample_, is also available to help illustrate how to use this package in practice: https://github.com/etcd-io/etcd/tree/master/contrib/raftexample # Features @@ -21,7 +21,7 @@ This raft implementation is a full feature implementation of Raft protocol. Feat - Leader election - Log replication -- Log compaction +- Log compaction - Membership changes - Leadership transfer extension - Efficient linearizable read-only queries served by both the leader and followers @@ -40,13 +40,13 @@ This raft implementation also includes a few optional enhancements: - Batching log entries to reduce disk synchronized I/O - Writing to leader's disk in parallel - Internal proposal redirection from followers to leader -- Automatic stepping down when the leader loses quorum +- Automatic stepping down when the leader loses quorum ## Notable Users - [cockroachdb](https://github.com/cockroachdb/cockroach) A Scalable, Survivable, Strongly-Consistent SQL Database - [dgraph](https://github.com/dgraph-io/dgraph) A Scalable, Distributed, Low Latency, High Throughput Graph Database -- [etcd](https://github.com/coreos/etcd) A distributed reliable key-value store +- [etcd](https://github.com/etcd-io/etcd) A distributed reliable key-value store - [tikv](https://github.com/pingcap/tikv) A Distributed transactional key value database powered by Rust and Raft - [swarmkit](https://github.com/docker/swarmkit) A toolkit for orchestrating distributed systems at any scale. - [chain core](https://github.com/chain/chain) Software for operating permissioned, multi-asset blockchain networks @@ -166,7 +166,7 @@ To propose changes to the state machine from the node to take application data, n.Propose(ctx, data) ``` -If the proposal is committed, data will appear in committed entries with type raftpb.EntryNormal. There is no guarantee that a proposed command will be committed; the command may have to be reproposed after a timeout. +If the proposal is committed, data will appear in committed entries with type raftpb.EntryNormal. There is no guarantee that a proposed command will be committed; the command may have to be reproposed after a timeout. To add or remove node in a cluster, build ConfChange struct 'cc' and call: diff --git a/raft/doc.go b/raft/doc.go index b55c591ff..43e484bc7 100644 --- a/raft/doc.go +++ b/raft/doc.go @@ -23,7 +23,7 @@ For more details on Raft, see "In Search of an Understandable Consensus Algorith A simple example application, _raftexample_, is also available to help illustrate how to use this package in practice: -https://github.com/coreos/etcd/tree/master/contrib/raftexample +https://go.etcd.io/etcd/tree/master/contrib/raftexample Usage diff --git a/raft/example_test.go b/raft/example_test.go index 26a1e0249..b56d2a28f 100644 --- a/raft/example_test.go +++ b/raft/example_test.go @@ -15,7 +15,7 @@ package raft import ( - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func applyToStore(ents []pb.Entry) {} diff --git a/raft/log.go b/raft/log.go index a3be7d486..50f28f87b 100644 --- a/raft/log.go +++ b/raft/log.go @@ -18,7 +18,7 @@ import ( "fmt" "log" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) type raftLog struct { diff --git a/raft/log_test.go b/raft/log_test.go index 8fa60db84..a9ee6ce06 100644 --- a/raft/log_test.go +++ b/raft/log_test.go @@ -18,7 +18,7 @@ import ( "reflect" "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func TestFindConflict(t *testing.T) { diff --git a/raft/log_unstable.go b/raft/log_unstable.go index a8a8f5ca1..1005bf65c 100644 --- a/raft/log_unstable.go +++ b/raft/log_unstable.go @@ -14,7 +14,7 @@ package raft -import pb "github.com/coreos/etcd/raft/raftpb" +import pb "go.etcd.io/etcd/raft/raftpb" // unstable.entries[i] has raft log position i+unstable.offset. // Note that unstable.offset may be less than the highest log diff --git a/raft/log_unstable_test.go b/raft/log_unstable_test.go index 52cb9a20d..2821a1e77 100644 --- a/raft/log_unstable_test.go +++ b/raft/log_unstable_test.go @@ -18,7 +18,7 @@ import ( "reflect" "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func TestUnstableMaybeFirstIndex(t *testing.T) { diff --git a/raft/node.go b/raft/node.go index 57a974fcf..7c5f329e4 100644 --- a/raft/node.go +++ b/raft/node.go @@ -18,7 +18,7 @@ import ( "context" "errors" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) type SnapshotStatus int diff --git a/raft/node_test.go b/raft/node_test.go index e2002208f..1a6501cb8 100644 --- a/raft/node_test.go +++ b/raft/node_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/coreos/etcd/pkg/testutil" - "github.com/coreos/etcd/raft/raftpb" + "go.etcd.io/etcd/pkg/testutil" + "go.etcd.io/etcd/raft/raftpb" ) // readyWithTimeout selects from n.Ready() with a 1-second timeout. It diff --git a/raft/raft.go b/raft/raft.go index 7de19f948..81bad3bec 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -25,7 +25,7 @@ import ( "sync" "time" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) // None is a placeholder node ID used when there is no leader. diff --git a/raft/raft_flow_control_test.go b/raft/raft_flow_control_test.go index c745050f8..db3d98d1e 100644 --- a/raft/raft_flow_control_test.go +++ b/raft/raft_flow_control_test.go @@ -17,7 +17,7 @@ package raft import ( "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) // TestMsgAppFlowControlFull ensures: diff --git a/raft/raft_paper_test.go b/raft/raft_paper_test.go index 3237b66f0..313f9e6e5 100644 --- a/raft/raft_paper_test.go +++ b/raft/raft_paper_test.go @@ -33,7 +33,7 @@ import ( "reflect" "sort" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func TestFollowerUpdateTermFromMessage(t *testing.T) { diff --git a/raft/raft_snap_test.go b/raft/raft_snap_test.go index de7f689d5..a80ed4da8 100644 --- a/raft/raft_snap_test.go +++ b/raft/raft_snap_test.go @@ -17,7 +17,7 @@ package raft import ( "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) var ( diff --git a/raft/raft_test.go b/raft/raft_test.go index 46bdefbcf..8619692f3 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -23,7 +23,7 @@ import ( "strings" "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) // nextEnts returns the appliable entries and updates the applied index @@ -1439,7 +1439,7 @@ func TestHandleHeartbeatResp(t *testing.T) { // TestRaftFreesReadOnlyMem ensures raft will free read request from // readOnly readIndexQueue and pendingReadIndex map. -// related issue: https://github.com/coreos/etcd/issues/7571 +// related issue: https://go.etcd.io/etcd/issues/7571 func TestRaftFreesReadOnlyMem(t *testing.T) { sm := newTestRaft(1, []uint64{1, 2}, 5, 1, NewMemoryStorage()) sm.becomeCandidate() diff --git a/raft/rafttest/network.go b/raft/rafttest/network.go index d10530e83..ee30fc0c4 100644 --- a/raft/rafttest/network.go +++ b/raft/rafttest/network.go @@ -19,7 +19,7 @@ import ( "sync" "time" - "github.com/coreos/etcd/raft/raftpb" + "go.etcd.io/etcd/raft/raftpb" ) // a network interface diff --git a/raft/rafttest/network_test.go b/raft/rafttest/network_test.go index 52cde4393..cbfae9605 100644 --- a/raft/rafttest/network_test.go +++ b/raft/rafttest/network_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - "github.com/coreos/etcd/raft/raftpb" + "go.etcd.io/etcd/raft/raftpb" ) func TestNetworkDrop(t *testing.T) { diff --git a/raft/rafttest/node.go b/raft/rafttest/node.go index 0c47bb2f9..57ff9b262 100644 --- a/raft/rafttest/node.go +++ b/raft/rafttest/node.go @@ -20,8 +20,8 @@ import ( "sync" "time" - "github.com/coreos/etcd/raft" - "github.com/coreos/etcd/raft/raftpb" + "go.etcd.io/etcd/raft" + "go.etcd.io/etcd/raft/raftpb" ) type node struct { diff --git a/raft/rafttest/node_bench_test.go b/raft/rafttest/node_bench_test.go index 77b5df1f4..f28744ae8 100644 --- a/raft/rafttest/node_bench_test.go +++ b/raft/rafttest/node_bench_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "github.com/coreos/etcd/raft" + "go.etcd.io/etcd/raft" ) func BenchmarkProposal3Nodes(b *testing.B) { diff --git a/raft/rafttest/node_test.go b/raft/rafttest/node_test.go index 00c54c6ff..455f56591 100644 --- a/raft/rafttest/node_test.go +++ b/raft/rafttest/node_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "github.com/coreos/etcd/raft" + "go.etcd.io/etcd/raft" ) func TestBasicProgress(t *testing.T) { diff --git a/raft/rawnode.go b/raft/rawnode.go index fbd7a49e8..a4cecfc8f 100644 --- a/raft/rawnode.go +++ b/raft/rawnode.go @@ -17,7 +17,7 @@ package raft import ( "errors" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) // ErrStepLocalMsg is returned when try to step a local raft message diff --git a/raft/rawnode_test.go b/raft/rawnode_test.go index f034521be..8b8ccf5d3 100644 --- a/raft/rawnode_test.go +++ b/raft/rawnode_test.go @@ -19,7 +19,7 @@ import ( "reflect" "testing" - "github.com/coreos/etcd/raft/raftpb" + "go.etcd.io/etcd/raft/raftpb" ) // TestRawNodeStep ensures that RawNode.Step ignore local message. diff --git a/raft/read_only.go b/raft/read_only.go index ae746fa73..aecc6b291 100644 --- a/raft/read_only.go +++ b/raft/read_only.go @@ -14,7 +14,7 @@ package raft -import pb "github.com/coreos/etcd/raft/raftpb" +import pb "go.etcd.io/etcd/raft/raftpb" // ReadState provides state for read only query. // It's caller's responsibility to call ReadIndex first before getting diff --git a/raft/status.go b/raft/status.go index f4d3d86a4..6d4aa7ba5 100644 --- a/raft/status.go +++ b/raft/status.go @@ -17,7 +17,7 @@ package raft import ( "fmt" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) type Status struct { diff --git a/raft/storage.go b/raft/storage.go index 69c3a7d90..14ad68608 100644 --- a/raft/storage.go +++ b/raft/storage.go @@ -18,7 +18,7 @@ import ( "errors" "sync" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) // ErrCompacted is returned by Storage.Entries/Compact when a requested diff --git a/raft/storage_test.go b/raft/storage_test.go index 71d50b4c9..71f9ac9df 100644 --- a/raft/storage_test.go +++ b/raft/storage_test.go @@ -19,7 +19,7 @@ import ( "reflect" "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func TestStorageTerm(t *testing.T) { diff --git a/raft/util.go b/raft/util.go index f4141fe65..d744927c4 100644 --- a/raft/util.go +++ b/raft/util.go @@ -18,7 +18,7 @@ import ( "bytes" "fmt" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) func (st StateType) MarshalJSON() ([]byte, error) { diff --git a/raft/util_test.go b/raft/util_test.go index 9d7eeb07b..52853892f 100644 --- a/raft/util_test.go +++ b/raft/util_test.go @@ -20,7 +20,7 @@ import ( "strings" "testing" - pb "github.com/coreos/etcd/raft/raftpb" + pb "go.etcd.io/etcd/raft/raftpb" ) var testFormatter EntryFormatter = func(data []byte) string {