Browse Source

doc fix grammar issue

Xiang Li 12 years ago
parent
commit
59e98fcc62
3 changed files with 6 additions and 4 deletions
  1. 1 1
      store/node.go
  2. 2 2
      store/store_test.go
  3. 3 1
      third_party/github.com/coreos/raft/log.go

+ 1 - 1
store/node.go

@@ -179,7 +179,7 @@ func (n *node) Remove(dir, recursive bool, callback func(path string)) *etcdErr.
 
 	if n.IsDir() {
 		if !dir {
-			// cannot delete a directory without set recursive to true
+			// cannot delete a directory without recursive set to true
 			return etcdErr.NewError(etcdErr.EcodeNotFile, n.Path, n.store.Index())
 		}
 

+ 2 - 2
store/store_test.go

@@ -286,7 +286,7 @@ func TestStoreDeleteDiretory(t *testing.T) {
 	// create directory /foo
 	s.Create("/foo", true, "", false, Permanent)
 	// delete /foo with dir = true and recursive = false
-	// this should success, since the directory is empty
+	// this should succeed, since the directory is empty
 	e, err := s.Delete("/foo", true, false)
 	assert.Nil(t, err, "")
 	assert.Equal(t, e.Action, "delete", "")
@@ -299,7 +299,7 @@ func TestStoreDeleteDiretory(t *testing.T) {
 	assert.NotNil(t, err, "")
 
 	// delete /foo with dir=false and recursive = true
-	// this should success, since recursive implies dir=true
+	// this should succeed, since recursive implies dir=true
 	// and recursively delete should be able to delete all
 	// items under the given directory
 	e, err = s.Delete("/foo", false, true)

+ 3 - 1
third_party/github.com/coreos/raft/log.go

@@ -366,7 +366,8 @@ func (l *Log) setCommitIndex(index uint64) error {
 	// this is not error any more after limited the number of sending entries
 	// commit up to what we already have
 	if index > l.startIndex+uint64(len(l.entries)) {
-		debugln("raft.Log: Commit index", index, "set back to ", len(l.entries))
+		debugln("raft.StartIndex", l.startIndex)
+		debugln("raft.Log: Commit index", index, "set back to ", l.startIndex+uint64(len(l.entries)))
 		index = l.startIndex + uint64(len(l.entries))
 	}
 
@@ -386,6 +387,7 @@ func (l *Log) setCommitIndex(index uint64) error {
 	// follower 2 should reply success and let leader 3 update the committed index to 80
 
 	if index < l.commitIndex {
+		debugln("raft.Log: index", index, "committedIndex", l.commitIndex)
 		return nil
 	}