From b2f4a5f5875c1387f93936f62ec219d9eeaaebc4 Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Fri, 11 Sep 2015 08:06:56 +1000 Subject: [PATCH] *: fix spelling issues (codespell). Signed-off-by: Dmitry Smirnov --- Documentation/api.md | 2 +- Documentation/auth_api.md | 2 +- Documentation/metrics.md | 2 +- client/discover.go | 2 +- client/srv_test.go | 2 +- discovery/srv_test.go | 2 +- etcdctl/command/member_commands.go | 2 +- etcdmain/etcd.go | 2 +- raft/design.md | 2 +- raft/raft.go | 2 +- raft/raft_test.go | 2 +- rafthttp/functional_test.go | 2 +- rafthttp/http.go | 2 +- storage/key_index_test.go | 2 +- wal/wal_test.go | 6 +++--- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Documentation/api.md b/Documentation/api.md index 9b1faeecc..60782b07e 100644 --- a/Documentation/api.md +++ b/Documentation/api.md @@ -359,7 +359,7 @@ curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=2008' #### Connection being closed prematurely The server may close a long polling connection before emitting any events. -This can happend due to a timeout or the server being shutdown. +This can happen due to a timeout or the server being shutdown. Since the HTTP header is sent immediately upon accepting the connection, the response will be seen as empty: `200 OK` and empty body. The clients should be prepared to deal with this scenario and retry the watch. diff --git a/Documentation/auth_api.md b/Documentation/auth_api.md index 78f8c3ac6..404ed0aed 100644 --- a/Documentation/auth_api.md +++ b/Documentation/auth_api.md @@ -19,7 +19,7 @@ Each role has exact one associated Permission List. An permission list exists fo The special static ROOT (named `root`) role has a full permissions on all key-value resources, the permission to manage user resources and settings resources. Only the ROOT role has the permission to manage user resources and modify settings resources. The ROOT role is built-in and does not need to be created. -There is also a special GUEST role, named 'guest'. These are the permissions given to unauthenticated requests to etcd. This role will be created automatically, and by default allows access to the full keyspace due to backward compatability. (etcd did not previously authenticate any actions.). This role can be modified by a ROOT role holder at any time, to reduce the capabilities of unauthenticated users. +There is also a special GUEST role, named 'guest'. These are the permissions given to unauthenticated requests to etcd. This role will be created automatically, and by default allows access to the full keyspace due to backward compatibility. (etcd did not previously authenticate any actions.). This role can be modified by a ROOT role holder at any time, to reduce the capabilities of unauthenticated users. #### Permissions diff --git a/Documentation/metrics.md b/Documentation/metrics.md index 26e9c0152..2a185a2ca 100644 --- a/Documentation/metrics.md +++ b/Documentation/metrics.md @@ -60,7 +60,7 @@ Example Prometheus queries that may be useful from these metrics (across all etc Rate of reads and writes by action, across all servers across a time window of `1m`. The reason why `max` is used for writes as opposed to `sum` for reads is because all of etcd nodes in the cluster apply all writes to their stores. - Shows the rate of successfull readonly/write queries across all servers, across a time window of `1m`. + Shows the rate of successful readonly/write queries across all servers, across a time window of `1m`. * `sum(rate(etcd_store_watch_requests_total{job="etcd"}[1m]))` Shows rate of new watch requests per second. Likely driven by how often watched keys change. diff --git a/client/discover.go b/client/discover.go index 269491c8d..ae88659f4 100644 --- a/client/discover.go +++ b/client/discover.go @@ -16,6 +16,6 @@ package client // Discoverer is an interface that wraps the Discover method. type Discoverer interface { - // Dicover looks up the etcd servers for the domain. + // Discover looks up the etcd servers for the domain. Discover(domain string) ([]string, error) } diff --git a/client/srv_test.go b/client/srv_test.go index a4a27f108..7121f454f 100644 --- a/client/srv_test.go +++ b/client/srv_test.go @@ -84,7 +84,7 @@ func TestSRVDiscover(t *testing.T) { if service == "etcd-server" { return "", tt.withoutSSL, nil } - return "", nil, errors.New("Unkown service in mock") + return "", nil, errors.New("Unknown service in mock") } d := NewSRVDiscover() diff --git a/discovery/srv_test.go b/discovery/srv_test.go index f61aae414..0d86791e9 100644 --- a/discovery/srv_test.go +++ b/discovery/srv_test.go @@ -106,7 +106,7 @@ func TestSRVGetCluster(t *testing.T) { if service == "etcd-server" { return "", tt.withoutSSL, nil } - return "", nil, errors.New("Unkown service in mock") + return "", nil, errors.New("Unknown service in mock") } resolveTCPAddr = func(network, addr string) (*net.TCPAddr, error) { if tt.dns == nil || tt.dns[addr] == "" { diff --git a/etcdctl/command/member_commands.go b/etcdctl/command/member_commands.go index be59886bd..2acd614c8 100644 --- a/etcdctl/command/member_commands.go +++ b/etcdctl/command/member_commands.go @@ -162,7 +162,7 @@ func actionMemberRemove(c *cli.Context) { err = mAPI.Remove(ctx, removalID) removeCancel() if err != nil { - fmt.Fprintf(os.Stderr, "Recieved an error trying to remove member %s: %s", removalID, err.Error()) + fmt.Fprintf(os.Stderr, "Received an error trying to remove member %s: %s", removalID, err.Error()) os.Exit(1) } diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 8eff3ae45..e4cb26a8d 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -367,7 +367,7 @@ func startProxy(cfg *config) error { uf := func() []string { gcls, err := etcdserver.GetClusterFromRemotePeers(peerURLs, tr) // TODO: remove the 2nd check when we fix GetClusterFromPeers - // GetClusterFromPeers should not return nil error with an invaild empty cluster + // GetClusterFromPeers should not return nil error with an invalid empty cluster if err != nil { plog.Warningf("proxy: %v", err) return []string{} diff --git a/raft/design.md b/raft/design.md index dd0803d8a..743475be5 100644 --- a/raft/design.md +++ b/raft/design.md @@ -45,7 +45,7 @@ When in `snapshot` state, leader stops sending any `replication message`. A newly elected leader sets the progresses of all the followers to `probe` state with `match` = 0 and `next` = last index. The leader slowly (at most once per heartbeat) sends `replication message` to the follower and probes its progress. -A progress changes to `replicate` when the follower replies with a non-rejection `msgAppResp`, which implies that it has matched the index sent. At this point, leader starts to stream log entries to the follower fast. The progress will fall back to `probe` when the follower replies a rejection `msgAppResp` or the link layer reports the follower is unreachable. We aggressively reset `next` to `match`+1 since if we receive any `msgAppResp` soon, both `match` and `next` will increase directly to the `index` in `msgAppResp`. (We might end up with sending some duplicate entries when agressively reset `next` too low. see open question) +A progress changes to `replicate` when the follower replies with a non-rejection `msgAppResp`, which implies that it has matched the index sent. At this point, leader starts to stream log entries to the follower fast. The progress will fall back to `probe` when the follower replies a rejection `msgAppResp` or the link layer reports the follower is unreachable. We aggressively reset `next` to `match`+1 since if we receive any `msgAppResp` soon, both `match` and `next` will increase directly to the `index` in `msgAppResp`. (We might end up with sending some duplicate entries when aggressively reset `next` too low. see open question) A progress changes from `probe` to `snapshot` when the follower falls very far behind and requires a snapshot. After sending `msgSnap`, the leader waits until the success, failure or abortion of the previous snapshot sent. The progress will go back to `probe` after the sending result is applied. diff --git a/raft/raft.go b/raft/raft.go index 281ea0108..59e4b418f 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -189,7 +189,7 @@ func newRaft(c *Config) *raft { lead: None, raftLog: raftlog, // 4MB for now and hard code it - // TODO(xiang): add a config arguement into newRaft after we add + // TODO(xiang): add a config argument into newRaft after we add // the max inflight message field. maxMsgSize: c.MaxSizePerMsg, maxInflight: c.MaxInflightMsgs, diff --git a/raft/raft_test.go b/raft/raft_test.go index 7d148f8e3..9534632db 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -780,7 +780,7 @@ func TestIsElectionTimeout(t *testing.T) { } // ensure that the Step function ignores the message from old term and does not pass it to the -// acutal stepX function. +// actual stepX function. func TestStepIgnoreOldTermMsg(t *testing.T) { called := false fakeStep := func(r *raft, m pb.Message) { diff --git a/rafthttp/functional_test.go b/rafthttp/functional_test.go index 0e45dd8dc..8e2556908 100644 --- a/rafthttp/functional_test.go +++ b/rafthttp/functional_test.go @@ -51,7 +51,7 @@ func TestSendMessage(t *testing.T) { data := []byte("some data") tests := []raftpb.Message{ - // these messages are set to send to itself, which faciliates testing. + // these messages are set to send to itself, which facilitates testing. {Type: raftpb.MsgProp, From: 1, To: 2, Entries: []raftpb.Entry{{Data: data}}}, // TODO: send out MsgApp which fits msgapp stream but the term doesn't match {Type: raftpb.MsgApp, From: 1, To: 2, Term: 1, Index: 3, LogTerm: 0, Entries: []raftpb.Entry{{Index: 4, Term: 1, Data: data}}, Commit: 3}, diff --git a/rafthttp/http.go b/rafthttp/http.go index 4febf6ff2..706c7377c 100644 --- a/rafthttp/http.go +++ b/rafthttp/http.go @@ -118,7 +118,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } // Write StatusNoContet header after the message has been processed by - // raft, which faciliates the client to report MsgSnap status. + // raft, which facilitates the client to report MsgSnap status. w.WriteHeader(http.StatusNoContent) } diff --git a/storage/key_index_test.go b/storage/key_index_test.go index a6631a13a..ea7aa575a 100644 --- a/storage/key_index_test.go +++ b/storage/key_index_test.go @@ -308,7 +308,7 @@ func TestKeyIndexCompact(t *testing.T) { }, } - // Continous Compaction + // Continuous Compaction ki := newTestKeyIndex() for i, tt := range tests { am := make(map[revision]struct{}) diff --git a/wal/wal_test.go b/wal/wal_test.go index 50a4d5ba1..9de5efc70 100644 --- a/wal/wal_test.go +++ b/wal/wal_test.go @@ -420,7 +420,7 @@ func TestOpenForRead(t *testing.T) { if err != nil { t.Fatal(err) } - // make 10 seperate files + // make 10 separate files for i := 0; i < 10; i++ { es := []raftpb.Entry{{Index: uint64(i)}} if err = w.Save(raftpb.HardState{}, es); err != nil { @@ -434,7 +434,7 @@ func TestOpenForRead(t *testing.T) { unlockIndex := uint64(5) w.ReleaseLockTo(unlockIndex) - // All are avaliable for read + // All are available for read w2, err := OpenForRead(p, walpb.Snapshot{}) defer w2.Close() if err != nil { @@ -475,7 +475,7 @@ func TestReleaseLockTo(t *testing.T) { if err != nil { t.Fatal(err) } - // make 10 seperate files + // make 10 separate files for i := 0; i < 10; i++ { es := []raftpb.Entry{{Index: uint64(i)}} if err = w.Save(raftpb.HardState{}, es); err != nil {