Skip to content

Commit

Permalink
rename the module from go.etcd.io/etcd/raft to go.etcd.io/raft
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Nov 27, 2022
1 parent 52634f0 commit ffe5efc
Show file tree
Hide file tree
Showing 47 changed files with 67 additions and 77 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ This approach introduces a problem when removing a member from a two-member clus

## Go docs

More detailed development documentation can be found in go docs: https://pkg.go.dev/go.etcd.io/etcd/raft/v3.
More detailed development documentation can be found in go docs: https://pkg.go.dev/go.etcd.io/raft/v3.
2 changes: 1 addition & 1 deletion bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"errors"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

// Bootstrap initializes the RawNode for first use by appending configuration
Expand Down
6 changes: 3 additions & 3 deletions confchange/confchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"fmt"
"strings"

"go.etcd.io/etcd/raft/v3/quorum"
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
"go.etcd.io/raft/v3/quorum"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// Changer facilitates configuration changes. It exposes methods to handle
Expand Down
4 changes: 2 additions & 2 deletions confchange/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

func TestConfChangeDataDriven(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions confchange/quick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"testing/quick"

pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// TestConfChangeQuick uses quickcheck to verify that simple and joint config
Expand Down
4 changes: 2 additions & 2 deletions confchange/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package confchange

import (
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// toConfChangeSingle translates a conf state into 1) a slice of operations creating
Expand Down
4 changes: 2 additions & 2 deletions confchange/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"testing/quick"

pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

type rndConfChange pb.ConfState
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package raft

import (
pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

func applyToStore(ents []pb.Entry) {}
Expand Down
12 changes: 1 addition & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.etcd.io/etcd/raft/v3
module go.etcd.io/raft/v3

go 1.19

Expand All @@ -22,13 +22,3 @@ require (
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// Bad imports are sometimes causing attempts to pull that code.
// This makes the error more explicit.
replace go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY

replace go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY

replace go.etcd.io/etcd/client/pkg/v3 => ./FORBIDDEN_DEPENDENCY

replace go.etcd.io/etcd/api/v3 => ./FORBIDDEN_DEPENDENCY
2 changes: 1 addition & 1 deletion interaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3/rafttest"
"go.etcd.io/raft/v3/rafttest"
)

func TestInteraction(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"log"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

type raftLog struct {
Expand Down
2 changes: 1 addition & 1 deletion log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/stretchr/testify/require"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

func TestFindConflict(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion log_unstable.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package raft

import pb "go.etcd.io/etcd/raft/v3/raftpb"
import pb "go.etcd.io/raft/v3/raftpb"

// unstable.entries[i] has raft log position i+unstable.offset.
// Note that unstable.offset may be less than the highest log
Expand Down
2 changes: 1 addition & 1 deletion log_unstable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

func TestUnstableMaybeFirstIndex(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"errors"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

type SnapshotStatus int
Expand Down
2 changes: 1 addition & 1 deletion node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3/raftpb"
)

// readyWithTimeout selects from n.Ready() with a 1-second timeout. It
Expand Down
8 changes: 4 additions & 4 deletions raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft/v3/confchange"
"go.etcd.io/etcd/raft/v3/quorum"
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
"go.etcd.io/raft/v3/confchange"
"go.etcd.io/raft/v3/quorum"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// None is a placeholder node ID used when there is no leader.
Expand Down
2 changes: 1 addition & 1 deletion raft_flow_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"testing"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

// TestMsgAppFlowControlFull ensures:
Expand Down
2 changes: 1 addition & 1 deletion raft_paper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"sort"
"testing"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

func TestFollowerUpdateTermFromMessage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion raft_snap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"testing"

pb "go.etcd.io/etcd/raft/v3/raftpb"
pb "go.etcd.io/raft/v3/raftpb"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"strings"
"testing"

pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// nextEnts returns the appliable entries and updates the applied index
Expand Down
2 changes: 1 addition & 1 deletion raftpb/raft.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion raftpb/raft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message Snapshot {
}

// For description of different message types, see:
// https://pkg.go.dev/go.etcd.io/etcd/raft/v3#hdr-MessageType
// https://pkg.go.dev/go.etcd.io/raft/v3#hdr-MessageType
enum MessageType {
MsgHup = 0;
MsgBeat = 1;
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"math"
"strings"

"go.etcd.io/etcd/raft/v3"
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3"
pb "go.etcd.io/raft/v3/raftpb"
)

// InteractionOpts groups the options for an InteractionEnv.
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_add_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3"
pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3"
pb "go.etcd.io/raft/v3/raftpb"
)

func (env *InteractionEnv) handleAddNodes(t *testing.T, d datadriven.TestData) error {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_deliver_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3"
"go.etcd.io/raft/v3/raftpb"
)

func (env *InteractionEnv) handleDeliverMsgs(t *testing.T, d datadriven.TestData) error {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_process_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3"
"go.etcd.io/raft/v3/raftpb"
)

func (env *InteractionEnv) handleProcessReady(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_propose_conf_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3/raftpb"
)

func (env *InteractionEnv) handleProposeConfChange(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_raft_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3"
"go.etcd.io/raft/v3"
)

func (env *InteractionEnv) handleRaftLog(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_raftstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package rafttest
import (
"fmt"

"go.etcd.io/etcd/raft/v3"
"go.etcd.io/raft/v3"
)

// isVoter checks whether node id is in the voter list within st.
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_stabilize.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3/raftpb"
)

func (env *InteractionEnv) handleStabilize(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/v3/tracker"
"go.etcd.io/raft/v3/tracker"
)

func (env *InteractionEnv) handleStatus(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"strings"

"go.etcd.io/etcd/raft/v3"
"go.etcd.io/raft/v3"
)

type logLevels [6]string
Expand Down
2 changes: 1 addition & 1 deletion rafttest/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3/raftpb"
)

// a network interface
Expand Down
2 changes: 1 addition & 1 deletion rafttest/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3/raftpb"
)

func TestNetworkDrop(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft/v3"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/raft/v3"
"go.etcd.io/raft/v3/raftpb"
)

type node struct {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/node_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft/v3"
"go.etcd.io/raft/v3"
)

func BenchmarkProposal3Nodes(b *testing.B) {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft/v3"
"go.etcd.io/raft/v3"
)

func TestBasicProgress(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions rawnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package raft
import (
"errors"

pb "go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/raft/v3/tracker"
pb "go.etcd.io/raft/v3/raftpb"
"go.etcd.io/raft/v3/tracker"
)

// ErrStepLocalMsg is returned when try to step a local raft message
Expand Down
Loading

0 comments on commit ffe5efc

Please sign in to comment.